BlogDeveloper

How to Run a Trading Competition on Hyperliquid

Run a Hyperliquid trading competition: register wallets, score PnL over your own start and end time, filter out cheating, and track it live. Tested.

HydromancerTeam
How to Run a Trading Competition on Hyperliquid

The same ten traders, the same three days, two scoreboards. On one, a player is up $763k. On the other, the same player is down $10.7k. Both are right: one sums profit on every fill inside the window, the other counts only positions that closed inside it, net of funding. Whichever you publish, players will argue for the other one, so the first job of a Hyperliquid trading competition is to pick a rule and say it before registration opens.

Hyperliquid makes the rest easy. A trading competition (or trading challenge) is a prize pool, a leaderboard and a fixed window, and every entrant's trades are on-chain, so a fund, a community or an app can verify the scoreboard itself, with no exchange sponsor, while players' money never leaves their own wallets. The hard part is scoring over your window, Friday to Sunday say, when Hyperliquid's own leaderboard only knows day, week, month and all time.

Why run it on Hyperliquid

• Anyone can score real accounts from the chain. You only need each player's address, and funds and prop firms use that to find talent.
• Players keep custody the whole time. Funds stay in each player's own wallet.
• You set the window, the markets and the metric. Friday to Sunday, one market, or risk-adjusted returns.
• It brings trading to your app. Trades players make through your app during the event carry your builder code.

Step 1: Register players and prove the wallet is theirs

Each player gives a wallet address. To stop people entering a famous trader's address, ask them to sign a message with that wallet. If the competition is meant to bring volume to your app, require trades to go through your builder code and check each player has approved it with approvedBuilders or maxBuilderFee.

Use a fresh sub-account per player if they have one (Hyperliquid unlocks sub-accounts after $100,000 of trading volume). It separates competition trades from everything else in their wallet, which makes scoring simple.

Step 2: Score your window, not Hyperliquid's

Hyperliquid's portfolio request returns PnL for fixed windows only (day, week, month, all time). A competition from Friday 00:00 to Sunday 23:59 doesn't line up with any of them, so both prototypes score an exact start and end time.

Hyperliquid API

Every fill carries closedPnl and fee, so realized PnL for any window is their sum over the window's fills. The prototype pages through each player's fills and adds them up, pausing so a busy player doesn't use up the IP's rate limit:

code
import time, requests

end, board = int(time.time() * 1000), []
for p in open("players.txt").read().split():
    fills, start, page = {}, end - 3 * 86400000, [0] * 2000
    while len(page) == 2000:
        page = requests.post("https://api.hyperliquid.xyz/info", json={
            "type": "userFillsByTime", "user": p, "startTime": start,
            "endTime": end}).json()
        fills.update({f["tid"]: f for f in page})
        start = page[-1]["time"] if page else end
        time.sleep(6)                 # a full page weighs 120 of 1,200/min
    pnl = sum(float(f["closedPnl"]) - float(f["fee"]) for f in fills.values())
    board.append((round(pnl), len(fills), p[:10]))
print(sorted(board, reverse=True))
json
[(1342203, 26171, '0x58b27998'), (763365, 21303, '0x9546b9d4'), (213374, 4871, '0xda3768e9'), (178015, 10740, '0x9321d811'), (0, 0, '0xedcdcaa1'), (-16529, 2247, '0x051c2e6d'), (-45630, 5190, '0x90dbb196'), (-72618, 1795, '0x020ca66c'), (-82610, 3135, '0xe83b5e36'), (-142970, 4892, '0x77ee3604')]

Hydromancer API

userPnlSummary takes a startTime and endTime and scores the trades closed in that window, net of fees and funding:

code
import os, time, requests

H = {"Authorization": "Bearer " + os.environ["HYDROMANCER_API_KEY"]}
end = int(time.time() * 1000)
board = []
for p in open("players.txt").read().split():
    s = requests.post("https://api.hydromancer.xyz/info", headers=H, json={
        "type": "userPnlSummary", "user": p,
        "startTime": end - 3 * 86400000, "endTime": end}).json()
    board.append((round(float(s["totalPnl"])), s["totalTrades"], p[:10]))
print(sorted(board, reverse=True))
json
[(1433511, 16, '0x58b27998'), (615584, 18, '0x9321d811'), (59309, 26, '0xda3768e9'), (0, 0, '0xedcdcaa1'), (-10730, 8, '0x9546b9d4'), (-56565, 3, '0x020ca66c'), (-70455, 3, '0x051c2e6d'), (-73686, 7, '0xe83b5e36'), (-272758, 3, '0x90dbb196'), (-390351, 15, '0x77ee3604')]

How we tested. We scored the same 10 players over the same 3 days, once with each API and its own PnL measure, on 31 October 2026, and timed both. The examples that read a .txt file expect one full wallet address per line. To try them, take addresses (each row's ethAddress) from Hyperliquid's public leaderboard file, https://stats-data.hyperliquid.xyz/Mainnet/leaderboard. The snippets are prototypes that prove each step works, not an app to copy as is; the request bodies and URLs are exact.

userPnlSummary and batchPortfolioStates (Step 5) are Hydromancer endpoints, not part of Hyperliquid's own API. Orders still go to Hyperliquid.

Side by side

Fill sum (Hyperliquid) userPnlSummary (Hydromancer)
What it countsProfit on every fill in the window, before fundingWhole trades closed in the window, net of fees and funding
Leader0x58b279980x58b27998
Time for 10 players298 s1.7 s
Rate-limit cost5,007 weight of 1,200/min per IP200 points of 20,000/min (Growth plan)

Both work, and both put the same player first. The columns differ because they count different things: the fill sum books profit on every partial close inside the window, while userPnlSummary counts whole positions that closed in it, so the second column on Hydromancer is trades and on Hyperliquid is fills.

The fill sum also leaves out funding, while userPnlSummary is net of fees and funding. Those two differences are how one player can show +$763k on one board and -$10.7k on the other. It isn't a quirk of this test: the same trader can be down on the account and up on closed trades over the same month (a real example).

Pick one and publish it. The official version is slow because busy players make a lot of fills (more than 80,000 in three days here); it also only reaches each player's most recent fills (how far that goes), so for a long competition with busy players, record fills live from day one. userPnlSummary is a paid add-on.

Step 3: Publish the rule

Three ways to score a trading competition: realized PnL (easy to explain, but open losses can hide), account value change (counts open positions, but deposits must be taken out) and return percentage (lets small accounts compete). Publish the rule before registration opens.

Pick the measure before registration opens, and put it in the rules. The usual choices:

• Realized PnL (closed trades only) is easy to explain but lets a player hide a losing open position until the end.
• Account value change counts open positions too, but deposits and withdrawals must be taken out, or a player could deposit their way to the top.
• Return (%) instead of dollars lets small accounts compete with large ones.

Most competitions also set a minimum number of trades and close everything at the end time.

Step 4: Stop the obvious cheating

• Wash trading: a player trading with their own second wallet. Since every trade lists both addresses, flag players whose trades mostly hit the same counterparty.
• Deposit pumping: strip deposits and transfers out using userNonFundingLedgerUpdates.
• Multiple entries: one person, many wallets. Look for wallets funded from the same address.

Hydromancer's leaderboard (also a paid add-on) includes a heuristic humanScore that flags accounts trading like bots, if your rules exclude them.

Step 5: Keep the balances fresh

Players refresh the leaderboard constantly, so the "current balance" column has to stay fresh.

Hyperliquid API

Two requests per player, perps and spot. Fine for a 20-player league; for 200 players refreshed every minute, that's most of an IP's budget gone before the rest of your site runs.

Hydromancer API

batchPortfolioStates returns live account state for up to 500 wallets in one request. Send {"type": "batchPortfolioStates", "users": ["0x…", …]}; each wallet comes back with its perps (clearinghouseState), spot balances (spotClearinghouseState) and account mode. The reply's successful_states is a list of [address, state] pairs, with the mode in userAbstraction. For a standard account (disabled or default), the balance is the perp marginSummary.accountValue plus the spot balances. In unified and portfolio-margin accounts, perp margin is part of the spot balances, so count the spot side only.

Side by side

Hyperliquid API Hydromancer batchPortfolioStates
Requests to refresh 200 players4001 (main DEX; 100 players per request with every HIP-3 DEX)
Rate-limit cost per refresh800 weight of 1,200/min per IP200 points (3 per wallet, capped at 200 a request) of 20,000/min (Growth plan)

Recompute the window scores from Step 2 every few minutes, and the current balances as often as you like.

FAQ

Can anyone run a trading competition on Hyperliquid?

Yes. Trading data is public, so anyone can score real accounts. Check the rules where you and your players live if there's a prize.

How do I score PnL for a custom start and end time?

On the official API, add up closedPnl minus fee from each player's userFillsByTime over your window; it took five minutes for 10 busy players in our test. Hydromancer's userPnlSummary accepts startTime and endTime and took under two seconds.

How do competitions make money?

Usually by bringing traders to an app that earns builder fees on their orders, or through sponsors.

• Hyperliquid leaderboard: track top addresses' PnL
• How to build a Hyperliquid copy trading bot
• Hyperliquid builder codes

Sources

- Hyperliquid docs: Info endpoint, Sub-accounts
- Hydromancer docs: userPnlSummary, Pricing

Continue