Skip to main content
0xArchive runs one WebSocket surface for Hyperliquid with two modes: subscribe to live channels, or replay an exact historical window in original sequence on the same socket, with the same channel names and the same message shapes. A backtest and a live client run identical code paths, and replay speed scales by plan from 10x to 300x, from 500x on Enterprise.
ws.send(JSON.stringify({ op: "subscribe", channel: "orderbook", symbol: "BTC" }));

Connect

Open the socket, authenticate, keep it alive, reconnect cleanly.

Channels

The full channel and symbol matrix by venue family.

Stream The Hyperliquid Order Book

The orderbook channel streams aggregated (L2) depth updates for core perp symbols such as BTC and ETH. Spot, HIP-3, and HIP-4 use venue-prefixed channels (spot_orderbook, hip3_orderbook, hip4_orderbook) with their own symbol shapes; Lighter is a separate venue family with lighter_orderbook and an order-level lighter_l3_orderbook.

L2 Book Streaming And L4 Book Streaming

Pick the depth by the downstream job, not by habit:
NeedChannelWhat arrives
Aggregated depth (L2 book)orderbookPrice levels with size, live or replayed
Order-level book (L4)l4_diffsPer-order book changes for local-state maintenance
Order eventsl4_ordersPlacements, fills, cancels, and status changes, including trigger orders
Fill streamtradesExecutions as they happen
L2 and L4 channels are available on every tier, including Free. For stateful L4 workflows, WebSocket L4 order book covers snapshots, diffs, gaps, and rebuilds.

Replay History On The Same Socket

Replay sends historical data over the WebSocket at a controlled speed, in original sequence. The command names the channel, symbol, window, and speed:
ws.send(JSON.stringify({
  op: "replay",
  channel: "orderbook",
  symbol: "BTC",
  start: 1681516800000,
  end: 1681603200000,
  speed: 10
}));
The server answers with replay_started, a replay_snapshot baseline, ordered historical_data messages, and replay_completed at the end of the window. gap_detected marks missing intervals so the client can stop or rebuild instead of silently corrupting local state. Controls are replay.pause, replay.resume, replay.seek, and replay.stop. Full command and event shapes live in WebSocket replay and the message schema.

Replay Speed And Subscriptions By Plan

PlanMax replay speedMax subscriptions
Free10x10
Build50x500
Pro100x3,000
Scale300x20,000
Enterprisefrom 500xUnlimited
Every tier gets WebSocket access and every channel family. Higher tiers raise the caps; see WebSocket tier limits for connection counts and bulk streaming.

Low Latency You Can Measure

Latency intent deserves a number, not an adjective. /v1/data-quality/latency returns current API, WebSocket, and freshness latency measurements per venue family, so a latency-sensitive client can check the live figure before and during a job instead of trusting marketing copy. Pair it with /v1/data-quality/status for per-family last_data_at and latency_ms.

History Behind The Stream

Live channels answer what is happening now; replay answers what happened, in order. Hyperliquid native L2 order books and trades reach back to April 2023. Order-level (L4) surfaces start March 2026. That archive is what replay draws from, so a strategy can be tested against years of event cadence with the same handler code that will run live. For reproducible runs, store the replay window, speed, gap events, and output state as WebSocket backtesting describes.

When To Use This Surface

Use WebSocket when sequence matters: local books, monitors, strategy harnesses, incident review, and backtests that react to event cadence. Use REST when one snapshot or one bounded historical window answers the question; it is simpler to retry and audit. If the job is a bounded data pull that later becomes a stream, start with Replay and reconstruction to pick the primitive before writing client code.

Next Step

Open WebSocket connection to get a socket up, pick channels in WebSocket channels, then run one bounded replay from WebSocket replay. For research workflows, continue to WebSocket backtesting and Point-in-time backtesting.
Last modified on July 4, 2026