Skip to main content

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

BTC book reconstruction

Hyperliquid core
Ordered changes120

Checkpoint

2026-08-10T00:00:42.644Z

SidePrice USDSize BTCorders
B64,8438.16845
B64,8421.4138
B64,8411.4596
B64,8404.2274
B64,8392.0497
B64,8386.2617
B64,8372.3827
B64,8364.37516
B64,8353.71514
B64,8347.37614
B64,8332.17113
B64,83220.83519
B64,8317.76414
B64,8300.10019
B64,82933.22111
B64,8286.51915
B64,8275.1817
B64,8266.717
B64,8250.803474
B64,82432.7927
A64,8444.09710
A64,8450.69472
A64,8460.959272
A64,8471.0715
A64,8482.0563
A64,8496.2514
A64,8502.0167
A64,8512.7776
A64,8526.4819
A64,8531.5366
A64,8543.15110
A64,8551.0656
A64,8563.4056
A64,8574.53110
A64,8581.625
A64,8591.35
A64,8603.5927
A64,86120.41511
A64,8625.4179
A64,8636.6376

After 120 changes

2026-08-10T00:00:43.189Z

SidePrice USDSize BTCorders
B64,8436.52343
B64,8421.4138
B64,8411.4596
B64,8404.9225
B64,8391.3556
B64,8387.3059
B64,8373.98410
B64,8364.37516
B64,8354.41515
B64,8347.37614
B64,8334.32914
B64,83220.83519
B64,8317.76414
B64,8301.810
B64,82933.22111
B64,8288.3517
B64,8275.1817
B64,8268.518
B64,8250.809475
B64,82432.7927
B64,7930.695081
B64,78841
B58,3590.0823224
A64,8446.08916
A64,8451.9314
A64,8462.8113
A64,8472.6156
A64,8481.1432
A64,8497.7166
A64,8504.7948
A64,8513.1478
A64,8526.4819
A64,8531.5366
A64,8543.15110
A64,8551.0656
A64,8563.6067
A64,8574.53110
A64,8582.436
A64,8591.35
A64,8603.5927
A64,86120.41511
A64,8625.4179
A64,8636.6376
A64,8672.8931
A64,88430.6611
A64,8970.025691
A64,89815.331
A64,9960.908111
10 Aug 2026 · 00:00:42.644 to 00:00:43.189 UTC

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"
   ]
  }
 ]
}
DatasetFromAccessRows per request
Hyperliquid trades15 Apr 2023REST, live stream, replay50,000
Hyperliquid l2 order book15 Apr 2023REST, live stream, replay1,000
Hyperliquid l4 book diffs11 Mar 2026REST, live stream, replay10,000
Hyperliquid funding 1m to 1d20 May 2023REST, live stream, replay1,000
Lighter trades17 Jan 2025REST, live stream, replay50,000
Lighter l2 order book29 Jan 2026REST, live stream, replay1,000

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'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

Hyperliquid WebSocket connection behavior
SituationWhat happens
Quiet connectionThe server closes a connection it has sent nothing to for 60 seconds, so a quiet feed needs { "method": "ping" }, answered with { "channel": "pong" }.
Dropped connectionIt can also disconnect without notice: reconnect and resubscribe.
First message on a feedIt carries the feed's current state, marked isSnapshot: true on user feeds such as userFills.
Earlier windowsThe 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 subscriptions and 0xArchive channels
Hyperliquid0xArchive channelReplay
l2Bookorderbook, top 20 levels; orderbook_full for every levelYes
tradestradesYes
bboorderbook, first levelYes
userFillstrades, filtered by user_addressYes
No native feedl4_diffs and l4_orders, every resting orderYes, 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

BTC wallet-attributed orders

Hyperliquid core
Price USD81,821
Size BTC0.08586
OrderA
WalletC
Price USD81,821
Size BTC0.10903
OrderB
WalletC
8 Oct 2026 20:08:43.489 UTC

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

BTC trades

Hyperliquid core
Last trade64,839
Last size0.01

Records

Time UTCSidePrice USDSize BTCDirection
Time UTC00:00:00.511SideBPrice USD64,866Size BTC0.00195DirectionClose Short
Time UTC00:00:02.457SideAPrice USD64,851Size BTC0.00304DirectionOpen Short
Time UTC00:00:02.457SideAPrice USD64,856Size BTC0.00016DirectionLong > Short
Time UTC00:00:03.728SideBPrice USD64,852Size BTC0.00091DirectionOpen Long
Time UTC00:00:08.205SideAPrice USD64,834Size BTC0.00018DirectionClose Long
Time UTC00:00:10.082SideBPrice USD64,837Size BTC0.00019DirectionOpen Long
Time UTC00:00:10.690SideBPrice USD64,838Size BTC0.06862DirectionOpen Long
Time UTC00:00:10.690SideBPrice USD64,837Size BTC0.00031DirectionOpen Long
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.03068DirectionOpen Short
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.01DirectionOpen Short
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.01DirectionOpen Short
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.08072DirectionOpen Short
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.01DirectionOpen Short
Time UTC00:00:14.524SideAPrice USD64,839Size BTC0.01DirectionOpen Short
10 Aug 2026 · 00:00:00.511 to 00:00:14.524 UTC

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.

Frequently asked questions

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.