fetch_leaderboard
Documentation for eth_defi.hyperliquid.api.fetch_leaderboard function.
- fetch_leaderboard(timeout=60.0)
Fetch the full Hyperliquid trader leaderboard.
Calls the public
stats-data.hyperliquid.xyz/Mainnet/leaderboardendpoint which returns 32K+ traders who have opted in, indexed by lowercased address for easy lookup.Does not require a
HyperliquidSession— this is a plain GET to a stats endpoint with no rate limiting.Example:
from eth_defi.hyperliquid.api import fetch_leaderboard leaderboard = fetch_leaderboard() print(f"Leaderboard has {len(leaderboard)} traders") # Look up a specific address entry = leaderboard.get("0x1234abcd...") if entry: print(f"{entry.display_name}: PnL={entry.all_time_pnl}, ROI={entry.all_time_roi}") # Example output: # HyperTrader42: PnL=1234567.89, ROI=0.4523The raw API response:
{"leaderboardRows": [{"ethAddress": "0x...", "accountValue": "123456.78", "displayName": "HyperTrader42", "windowPerformances": [["allTime", {"pnl": "1234567.89", "roi": "0.4523", "vlm": "98765432.10"}], ...]}, ...]}- Parameters
timeout (float) – HTTP request timeout in seconds.
- Returns
Dict mapping lowercased address to
LeaderboardEntry.- Return type