A live subscription delivers new updates after subscribe is acknowledged. Replay reads a bounded stored window and ends with replay_completed. Live availability does not imply replay availability, and replay history is limited by the selected dataset and account entitlement.
Hyperliquid and Lighter WebSocket: live streams and historical replay
Stream market updates into your application. Feed retained Hyperliquid and Lighter history into event-driven research without replacing your own replay system.
BTC book reconstruction
Checkpoint
2026-08-10T00:00:42.644Z
| Side | Price USD | Size BTC | orders |
|---|---|---|---|
| B | 64,843 | 8.168 | 45 |
| B | 64,842 | 1.413 | 8 |
| B | 64,841 | 1.459 | 6 |
| B | 64,840 | 4.227 | 4 |
| B | 64,839 | 2.049 | 7 |
| B | 64,838 | 6.261 | 7 |
| B | 64,837 | 2.382 | 7 |
| B | 64,836 | 4.375 | 16 |
| B | 64,835 | 3.715 | 14 |
| B | 64,834 | 7.376 | 14 |
| B | 64,833 | 2.171 | 13 |
| B | 64,832 | 20.835 | 19 |
| B | 64,831 | 7.764 | 14 |
| B | 64,830 | 0.1001 | 9 |
| B | 64,829 | 33.221 | 11 |
| B | 64,828 | 6.519 | 15 |
| B | 64,827 | 5.181 | 7 |
| B | 64,826 | 6.71 | 7 |
| B | 64,825 | 0.80347 | 4 |
| B | 64,824 | 32.792 | 7 |
| A | 64,844 | 4.097 | 10 |
| A | 64,845 | 0.6947 | 2 |
| A | 64,846 | 0.95927 | 2 |
| A | 64,847 | 1.071 | 5 |
| A | 64,848 | 2.056 | 3 |
| A | 64,849 | 6.251 | 4 |
| A | 64,850 | 2.016 | 7 |
| A | 64,851 | 2.777 | 6 |
| A | 64,852 | 6.481 | 9 |
| A | 64,853 | 1.536 | 6 |
| A | 64,854 | 3.151 | 10 |
| A | 64,855 | 1.065 | 6 |
| A | 64,856 | 3.405 | 6 |
| A | 64,857 | 4.531 | 10 |
| A | 64,858 | 1.62 | 5 |
| A | 64,859 | 1.3 | 5 |
| A | 64,860 | 3.592 | 7 |
| A | 64,861 | 20.415 | 11 |
| A | 64,862 | 5.417 | 9 |
| A | 64,863 | 6.637 | 6 |
After 120 changes
2026-08-10T00:00:43.189Z
| Side | Price USD | Size BTC | orders |
|---|---|---|---|
| B | 64,843 | 6.523 | 43 |
| B | 64,842 | 1.413 | 8 |
| B | 64,841 | 1.459 | 6 |
| B | 64,840 | 4.922 | 5 |
| B | 64,839 | 1.355 | 6 |
| B | 64,838 | 7.305 | 9 |
| B | 64,837 | 3.984 | 10 |
| B | 64,836 | 4.375 | 16 |
| B | 64,835 | 4.415 | 15 |
| B | 64,834 | 7.376 | 14 |
| B | 64,833 | 4.329 | 14 |
| B | 64,832 | 20.835 | 19 |
| B | 64,831 | 7.764 | 14 |
| B | 64,830 | 1.8 | 10 |
| B | 64,829 | 33.221 | 11 |
| B | 64,828 | 8.35 | 17 |
| B | 64,827 | 5.181 | 7 |
| B | 64,826 | 8.51 | 8 |
| B | 64,825 | 0.80947 | 5 |
| B | 64,824 | 32.792 | 7 |
| B | 64,793 | 0.69508 | 1 |
| B | 64,788 | 4 | 1 |
| B | 58,359 | 0.08232 | 24 |
| A | 64,844 | 6.089 | 16 |
| A | 64,845 | 1.931 | 4 |
| A | 64,846 | 2.811 | 3 |
| A | 64,847 | 2.615 | 6 |
| A | 64,848 | 1.143 | 2 |
| A | 64,849 | 7.716 | 6 |
| A | 64,850 | 4.794 | 8 |
| A | 64,851 | 3.147 | 8 |
| A | 64,852 | 6.481 | 9 |
| A | 64,853 | 1.536 | 6 |
| A | 64,854 | 3.151 | 10 |
| A | 64,855 | 1.065 | 6 |
| A | 64,856 | 3.606 | 7 |
| A | 64,857 | 4.531 | 10 |
| A | 64,858 | 2.43 | 6 |
| A | 64,859 | 1.3 | 5 |
| A | 64,860 | 3.592 | 7 |
| A | 64,861 | 20.415 | 11 |
| A | 64,862 | 5.417 | 9 |
| A | 64,863 | 6.637 | 6 |
| A | 64,867 | 2.893 | 1 |
| A | 64,884 | 30.661 | 1 |
| A | 64,897 | 0.02569 | 1 |
| A | 64,898 | 15.33 | 1 |
| A | 64,996 | 0.90811 | 1 |
Your first subscription
One connection to wss://api.0xarchive.io/ws streams live Hyperliquid and Lighter order books, trades, funding and open interest, and replays history on the same socket: Hyperliquid API trades from 15 Apr 2023, every L4 order from 11 Mar 2026.
Request
wscat -c wss://api.0xarchive.io/ws -H "Authorization: Bearer $OXARCHIVE_API_KEY"
> {"op":"subscribe","channel":"trades","symbol":"BTC"}Response
{
"type": "data",
"channel": "trades",
"coin": "BTC",
"symbol": "BTC",
"data": [
{
"cloid": "0x0000000000000000000001a2121b67ee",
"coin": "BTC",
"crossed": false,
"dir": "Open Short",
"fee": -0.000362,
"fee_token": "USDC",
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oid": 617108722651,
"px": "60488.0",
"side": "A",
"start_position": -0.0014,
"sz": "0.0002",
"tid": 933761867018585,
"time": 1795677467007,
"users": [
"0xbb160cb61e694570f9d570f9fcde7c61dd2143ad"
]
}
]
}Free: 2 connections and 10 subscriptions, replaying the most recent 30 days; live streams for an account's first 30 days, then on Build. Build and above stream live and replay the full archive from the first day shown.
Hyperliquid BTC funding sample (Parquet), 23 KB WebSocket reference
Hyperliquid's native WebSocket
Hyperliquid streams live data on wss://api.hyperliquid.xyz/ws. Send one subscribe message per feed; the server answers each with a subscriptionResponse, then pushes updates.
Subscribe
{ "method": "subscribe", "subscription": { "type": "l2Book", "coin": "BTC" } }
{ "method": "subscribe", "subscription": { "type": "trades", "coin": "BTC" } }
{ "method": "subscribe", "subscription": { "type": "bbo", "coin": "BTC" } }
{ "method": "subscribe", "subscription": { "type": "userFills", "user": "<address>" } }Limits per IP address
- Connections
- 10
- New connections per minute
- 30
- Subscriptions
- 1,000
- Unique users across user subscriptions
- 10
- Messages sent per minute
- 2,000
- Idle timeout
- 60 seconds
Connection behavior
| Situation | What happens |
|---|---|
| Quiet connection | The server closes a connection it has sent nothing to for 60 seconds, so a quiet feed needs { "method": "ping" }, answered with { "channel": "pong" }. |
| Dropped connection | It can also disconnect without notice: reconnect and resubscribe. |
| First message on a feed | It carries the feed's current state, marked isSnapshot: true on user feeds such as userFills. |
| Earlier windows | The stream starts when you subscribe and has no replay of earlier windows. |
How 0xArchive streams differ
0xArchive streams the same markets, and Lighter, on wss://api.0xarchive.io/ws with an API key. Its order book, trade, L4, funding and open-interest channels also replay: send replay with a start and end instead of subscribe to receive that window of history on the same socket.
| Hyperliquid | 0xArchive channel | Replay |
|---|---|---|
l2Book | orderbook, top 20 levels; orderbook_full for every level | Yes |
trades | trades | Yes |
bbo | orderbook, first level | Yes |
userFills | trades, filtered by user_address | Yes |
| No native feed | l4_diffs and l4_orders, every resting order | Yes, from a checkpoint |
Subscribe, replay and ping
{ "op": "subscribe", "channel": "orderbook", "symbol": "BTC" }
{ "op": "replay", "channel": "trades", "symbol": "BTC", "start": 1795600000000, "end": 1795600060000 }
{ "op": "ping" }A book, then its changes
Start from a historical checkpoint and apply ordered changes. Reconstruct the book your application needs to study.
BTC wallet-attributed orders
Replay into your event-driven code
Feed retained checkpoints and events into your replay system. Revisit quoting, fills and liquidity under past market conditions.
BTC trades
Records
| Time UTC | Side | Price USD | Size BTC | Direction |
|---|---|---|---|---|
| Time UTC00:00:00.511 | SideB | Price USD64,866 | Size BTC0.00195 | DirectionClose Short |
| Time UTC00:00:02.457 | SideA | Price USD64,851 | Size BTC0.00304 | DirectionOpen Short |
| Time UTC00:00:02.457 | SideA | Price USD64,856 | Size BTC0.00016 | DirectionLong > Short |
| Time UTC00:00:03.728 | SideB | Price USD64,852 | Size BTC0.00091 | DirectionOpen Long |
| Time UTC00:00:08.205 | SideA | Price USD64,834 | Size BTC0.00018 | DirectionClose Long |
| Time UTC00:00:10.082 | SideB | Price USD64,837 | Size BTC0.00019 | DirectionOpen Long |
| Time UTC00:00:10.690 | SideB | Price USD64,838 | Size BTC0.06862 | DirectionOpen Long |
| Time UTC00:00:10.690 | SideB | Price USD64,837 | Size BTC0.00031 | DirectionOpen Long |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.03068 | DirectionOpen Short |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.01 | DirectionOpen Short |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.01 | DirectionOpen Short |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.08072 | DirectionOpen Short |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.01 | DirectionOpen Short |
| Time UTC00:00:14.524 | SideA | Price USD64,839 | Size BTC0.01 | DirectionOpen Short |
Keep your application current
Stream book and trade updates into market views and services. Use retained events when the same workflow needs history.
Live views
Keep market views and services updating.
Event-driven research
Feed retained events into your replay system.
Execution models
Reconstruct past book conditions for your analysis.
Put live and historical events into your code.
Use subscriptions for current updates and replay for retained events.