Historical

Query API

SQL over the complete archive (every trade, order event, and book delta since launch) without running your own warehouse. POST a query, get rows back as JSON (or CSV via Accept: text/csv). Same schema as the live streams, so a query you debug here deploys against the feed unchanged.

Endpoint

Endpoint
https://data.hyperliquidrpc.com/query
Protocol
HTTPS POST, SQL string body
Auth
API key in the x-api-key header
Results
JSON rows (default) or CSV
curl https://data.hyperliquidrpc.com/query \  -H 'x-api-key: YOUR_KEY' \  -d "SELECT count() FROM trades WHERE coin = 'BTC' AND block_time > now() - 86400"

The dialect is the same SQL the canonical examples use. ClickHouse-style functions like toStartOfMinute, argMin/argMax, and countIf work as written. Tables and columns are documented in Schemas; financial columns (px, sz, closed_pnl, fee) are stored with exact decimal precision.

Recipe: OHLCV from raw trades

Candles computed directly from the fill tape: one row per minute for the last hour of BTC. The ready-made ohlcv_1s/1m/1h/1d datasets hold the same shape precomputed; build from trades when you need a custom interval or filter (e.g. excluding liquidation fills).

ohlcv-1m.sqlsql
SELECT toStartOfMinute(block_time) m,       argMin(px, block_time)     o,       max(px)                    h,       min(px)                    l,       argMax(px, block_time)     c,       sum(sz)                    volFROM tradesWHERE coin = 'BTC' AND block_time > now() - 3600GROUP BY mORDER BY m
Sample result
mohlcvol
2026-06-09 08:11:0066998.067015.066990.067012.084.41280
2026-06-09 08:12:0067012.067034.067008.067029.0112.09455
2026-06-09 08:13:0067029.067031.066981.066984.096.77031
2026-06-09 08:14:0066984.067012.066975.067012.073.20988

Illustrative rows in the real shape. Prices are exact decimal strings, volume is base-asset size.

Recipe: wallet PnL

Every fill carries the trader's wallet, realized PnL, fees, and notional, so copy-trading research is a GROUP BY user away. Thirty-day realized PnL, volume, and win rate for one address:

wallet-pnl-30d.sqlsql
SELECT user,       sum(closed_pnl)                                     realized_pnl,       sum(notional)                                       volume,       countIf(closed_pnl > 0) / countIf(closed_pnl != 0)  win_rate,       count()                                             fillsFROM tradesWHERE user = '0x7c4ee0c0c5d3ab91f7f0f3c2a3d6b18452e9a3f9'  AND block_time > now() - 86400 * 30GROUP BY user
Sample result
userrealized_pnlvolumewin_ratefills
0x7c4e…a3f948211.07351412480394.220.56131842

Drop the WHERE user filter and add ORDER BY realized_pnl DESC LIMIT 100 for a leaderboard. The wallet_pnl derived dataset precomputes this per address.

Recipe: liquidation history

The liquidations derived dataset has one row per liquidation: victim wallet, size, execution price, and mark price at the time. The largest ETH liquidations of the past week:

eth-liquidations-7d.sqlsql
SELECT block_time, coin, victim, sz, px, mark_pxFROM liquidationsWHERE coin = 'ETH' AND block_time > now() - 86400 * 7ORDER BY px * sz DESCLIMIT 20
Sample result
block_timecoinvictimszpxmark_px
2026-06-07 21:48:11.204ETH0x2f8a…4b07412.55003441.103447.95
2026-06-05 03:12:40.871ETH0x5d20…e641268.02103502.603509.40
2026-06-08 14:30:02.633ETH0xe83b…08d5190.77023478.853484.10

The same events are on the live events stream. Backtest the query here, then subscribe with the identical field names.

Recipe: funding series

The funding derived dataset is the funding-rate time series per market, the input for basis and carry studies. BTC over the last week:

btc-funding-7d.sqlsql
SELECT block_time, funding_rateFROM fundingWHERE coin = 'BTC' AND block_time > now() - 86400 * 7ORDER BY block_time
Sample result
block_timefunding_rate
2026-06-09 07:00:00.0840.0000125
2026-06-09 08:00:00.1170.0000118
2026-06-09 09:00:00.0840.0000125

Per-wallet funding payments (amount, position size, rate) live in the events dataset with type = 'funding'.

Query guidance

  • Always constrain block_time (and coin where you can). book_updates alone holds 1B+ rows, and unbounded scans will hit your plan's query limits.
  • Treat financial columns as decimals end to end; casting px or closed_pnl to float reintroduces exactly the rounding error the archive exists to avoid.
  • Results are capped per response; page long extracts with LIMIT … OFFSET, or use bulk exports for anything that looks like a full-dataset pull.
  • For sustained interactive analytics, ask about direct read-only database access.