跳到正文
DEV Community· diogenicious·· 21 分鐘前AI 評分49

如何用 Python 篩選 Hyperliquid 排行榜交易者,再決定是否跟單

Screen the Hyperliquid leaderboard before you copy a trader, in Python

AI 導讀

這篇教學用 Python 從免費 API 讀取 Hyperliquid 近 30 日排行榜,按最大回撤、勝率、持倉時間及單一幣種成交量佔比篩選交易者。示例讀取 20 名交易者,按四項檢查保留 9 名;篩選結果只供逐一查看,不代表投資建議。

正文

The Hyperliquid leaderboard is sorted by pnl, and pnl is the worst single number to pick a trader by. A wallet can sit at the top after one lucky month with a 60% drawdown on the way, or with every dollar on one coin, or with trades that last four minutes and that nobody can follow by hand.

This post reads the top of the 30 day Hyperliquid leaderboard from a free API in Python, then drops the traders that fail four simple checks: drawdown, win rate, hold time and concentration. What is left is a short list worth opening one by one.

Disclosure: I am the founder of copy.top. copy.top is independent and not affiliated with Hyperliquid.

Setup

python3 -m venv .venv
.venv/bin/pip install copytop

The copytop package is standard library only and needs no key. I tested with copytop 0.1.1 on Python 3.14.5. Everything here is read-only: nothing places an order.

What one row looks like

hl_traders returns the leaderboard for a window (24h, 7d, 30d or all), sorted by pnl or roi. Each row carries more than pnl:

from copytop import Client

row = Client().hl_traders(window="30d", sort="pnl", limit=1)["traders"][0]
for k in ("pnl", "roi", "winRate", "maxDd30dPct", "medianHoldMin", "tradesPerDay", "topCoins"):
    print(k, row[k])
pnl 16805410.328527
roi 0.675626767305912
winRate 0.58695652173913
maxDd30dPct 21.4361707066338
medianHoldMin 1829.63928333333
tradesPerDay 3.50731562174499
topCoins [{'coin': 'ETH', 'share': 0.6330822069245345}, {'coin': 'BTC', 'share': 0.36308972606286927}]
  • roi is pnl over what the trader put in, as a ratio (0.68 = +68%).
  • maxDd30dPct is the worst peak to trough drop of the account over 30 days, in percent.
  • medianHoldMin is the median time a position stays open, in minutes.
  • topCoins[].share is the share of the trader's volume on each market.

The four checks

MAX_DRAWDOWN_PCT = 25    # worst peak-to-trough drop over 30 days
MIN_WIN_RATE = 0.50      # share of closed trades in profit
MIN_HOLD_MIN = 60        # median hold: under an hour is hard to follow by hand
MAX_COIN_SHARE = 0.80    # one coin above 80% of volume = a single bet


def keep(t):
    top = t.get("topCoins") or []
    reasons = []
    if (t.get("maxDd30dPct") or 0) > MAX_DRAWDOWN_PCT:
        reasons.append("drawdown")
    if (t.get("winRate") or 0) < MIN_WIN_RATE:
        reasons.append("win rate")
    if (t.get("medianHoldMin") or 0) < MIN_HOLD_MIN:
        reasons.append("hold time")
    if top and top[0]["share"] > MAX_COIN_SHARE:
        reasons.append("one coin")
    return reasons

keep returns the reasons a trader fails, so an empty list means the trader passes. Returning reasons instead of a boolean is what makes the next step useful: you see why the list shrank, and you can loosen the one threshold that is too strict for you.

The thresholds are a starting point, not advice. A 25% drawdown is already a lot of pain if you copy with size. A one hour hold is the floor if you copy by hand; a bot can follow faster traders, and then hold time matters less than how much the price moves before your copy fills.

The full screen

from copytop import Client, hl_trader_url


def hours(minutes):
    return f"{minutes / 60:.0f} h" if minutes >= 60 else f"{minutes:.0f} min"


def main():
    data = Client().hl_traders(window="30d", sort="pnl", limit=20)
    rows = data["traders"]
    kept, dropped = [], {}
    for t in rows:
        why = keep(t)
        if why:
            for r in why:
                dropped[r] = dropped.get(r, 0) + 1
        else:
            kept.append(t)

    print(f"leaderboard of {data['updatedAt'][:10]}: {len(rows)} traders read, {len(kept)} kept")
    print("dropped for:", ", ".join(f"{k} {v}" for k, v in sorted(dropped.items(), key=lambda x: -x[1])))
    for i, t in enumerate(kept[:10], 1):
        coins = ", ".join(c["coin"].split(":")[-1] for c in (t.get("topCoins") or [])[:3])
        print(f"{i:>2}. pnl ${t['pnl'] / 1e6:.2f}m  roi {t['roi']:+.0%}  win {t['winRate']:.0%}  "
              f"dd {t['maxDd30dPct']:.0f}%  hold {hours(t['medianHoldMin'])}  {coins}")
    # each trader has a public page with the full history: hl_trader_url(t["address"])
    return [hl_trader_url(t["address"]) for t in kept]


if __name__ == "__main__":
    main()

On November 26, 2026 it printed:

leaderboard of 2026-11-26: 20 traders read, 9 kept
dropped for: win rate 8, drawdown 4, one coin 4, hold time 1
 1. pnl $16.81m  roi +68%  win 59%  dd 21%  hold 30 h  ETH, BTC
 2. pnl $4.59m  roi +243%  win 56%  dd 19%  hold 23 h  BTC, XYZ100, ZEC
 3. pnl $2.85m  roi +95%  win 59%  dd 20%  hold 150 h  ETH, BTC, SOL
 4. pnl $1.18m  roi +98%  win 51%  dd 11%  hold 9 h  BTC, ETH, XRP
 5. pnl $1.11m  roi +16%  win 76%  dd 13%  hold 1 h  BTC, HYPE, XYZ100
 6. pnl $1.01m  roi +302%  win 62%  dd 13%  hold 118 h  ETH, BTC, SP500
 7. pnl $0.96m  roi +79%  win 65%  dd 20%  hold 3 h  BTC, ETH, HYPE
 8. pnl $0.77m  roi +27%  win 70%  dd 2%  hold 120 h  HYPE, ZEC, ETH
 9. pnl $0.76m  roi +3%  win 61%  dd 2%  hold 7 h  BTC, HYPE

A trader can fail more than one check, so the "dropped for" counts can add up to more than the number of traders dropped. Markets like xyz:XYZ100 are HIP-3 markets (stocks, indices and more on Hyperliquid); the script keeps only the part after the colon for display.

What the screen does not tell you

  • 30 days is short. Run it on window="7d" and window="all" too: a trader who passes on all three is more interesting than one who passes on one.
  • Win rate hides size. A 59% win rate with small wins and a few large losses can still lose money. Drawdown catches part of that, the trade history catches the rest.
  • Leverage is not in the row. Open the trader with Client().hl_trader(address) to see open positions, and size your own copy from your own account, not theirs.

Going further

The same leaderboard, refreshed and readable without code, is on copy.top's hyperliquid copy trading page, with a page per market. If you are comparing data sources for Hyperliquid wallets, I wrote up how the free options differ in a HyperTracker alternative comparison.

The package is on PyPI as copytop, and the same data is available to AI agents through an MCP server. Figures are data, not advice: past performance does not predict results, and perps can lose more than a spot trade.

來源:DEV Community · dev.to