WebSocket Channels
Pick the channels, mode limits, and book depth before you design the consumer.
Channels
Channel matrix
Compare venue coverage, live versus replay support, and tier gates before you subscribe.
Hyperliquid
Historical data from April 2023. Symbols: BTC, ETH, SOL, etc.
| Channel | Description | Mode | Tier |
|---|---|---|---|
orderbook | L2 order book snapshots (~1.2s resolution) | Real-time & Historical | Build+ |
trades | Trade/fill updates (pre-March 2025 fills are taker-only) | Real-time & Historical | Build+ |
candles | OHLCV candles. Interval param: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w | Historical only (May 2025+) | Build+ |
open_interest | Open interest snapshots | Historical only (May 2023+) | Build+ |
funding | Funding rate snapshots | Historical only (May 2023+) | Build+ |
liquidations | Liquidation events | Historical only (December 2025+) | Build+ |
ticker | Price and 24h volume | Real-time only | Build+ |
all_tickers | All market tickers at once (no symbol param needed) | Real-time only | Build+ |
l4_diffs | L4 orderbook diffs with user wallet attribution. Batched by block (~100ms). | Real-time only | Pro+ |
l4_orders | Order lifecycle events (new, partial fill, filled, cancelled) with wallet attribution. Batched by block. | Real-time only | Pro+ |
HIP-3
Builder-deployed perpetuals on Hyperliquid. Data from December 2025. Symbols: km:US500, hyna:BTC, etc.
| Channel | Description | Mode | Tier |
|---|---|---|---|
hip3_orderbook | L2 order book snapshots | Historical only | Pro+ |
hip3_trades | Trade/fill updates | Historical only | Build+ |
hip3_candles | OHLCV candles. Interval param: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w | Historical only | Build+ |
hip3_open_interest | Open interest snapshots | Historical only | Build+ |
hip3_funding | Funding rate snapshots | Historical only | Build+ |
hip3_liquidations | Liquidation events with long/short direction | Historical only | Build+ |
hip3_l4_diffs | L4 orderbook diffs with user wallet attribution. Batched by block (~100ms). | Real-time only | Pro+ |
hip3_l4_orders | Order lifecycle events with wallet attribution. Batched by block. | Real-time only | Pro+ |
Lighter.xyz
Data from August 2025 for fills and January 2026 for orderbook / OI / funding. Symbols: BTC, ETH, SOL, etc.
| Channel | Description | Mode | Tier |
|---|---|---|---|
lighter_orderbook | Full-depth order book. Granularity param: checkpoint, 30s, 10s, 1s, tick | Historical only | Build+ |
lighter_trades | Trade/fill updates | Historical only | Build+ |
lighter_candles | OHLCV candles. Interval param: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w | Historical only | Build+ |
lighter_open_interest | Open interest snapshots | Historical only | Build+ |
lighter_funding | Funding rate snapshots | Historical only | Build+ |
lighter_l3_orderbook | L3 order-level orderbook snapshots with individual order IDs and sizes | Historical only | Pro+ |
Real-time subscriptions
Subscribe to live market data feeds when you need proxied venue updates with minimal latency.
JavaScript
// Subscribe to real-time order book updatesws.send(JSON.stringify({ op: "subscribe", channel: "orderbook", symbol: "BTC"}));
// Subscribe to real-time tradesws.send(JSON.stringify({ op: "subscribe", channel: "trades", symbol: "ETH"}));
// Subscribe to L4 orderbook diffs (Pro+, real-time only)// Messages are batched by block and include user wallet addressesws.send(JSON.stringify({ op: "subscribe", channel: "l4_diffs", symbol: "BTC"}));
// Subscribe to L4 order lifecycle events (Pro+, real-time only)// Streams order state changes (new, partial fill, filled, cancelled)ws.send(JSON.stringify({ op: "subscribe", channel: "l4_orders", symbol: "ETH"}));
// Subscribe to HIP-3 L4 channelsws.send(JSON.stringify({ op: "subscribe", channel: "hip3_l4_diffs", symbol: "km:US500"}));
ws.send(JSON.stringify({ op: "subscribe", channel: "hip3_l4_orders", symbol: "km:US500"}));
// Unsubscribews.send(JSON.stringify({ op: "unsubscribe", channel: "orderbook", symbol: "BTC"}));L4 orderbook streaming
L4 channels deliver a full snapshot first, then continuous diff batches so you can reconstruct the live order-level book.
Python
import websockets, json, asyncio
async def stream_l4(): uri = "wss://api.0xarchive.io/ws?apiKey=YOUR_KEY" async with websockets.connect(uri, max_size=20_000_000) as ws: # Subscribe to L4 diffs (works for l4_diffs or hip3_l4_diffs) await ws.send(json.dumps({ "op": "subscribe", "channel": "l4_diffs", "symbol": "BTC" }))
book = {"bids": {}, "asks": {}} snapshot_ts = None
async for msg in ws: data = json.loads(msg)
if data["type"] == "l4_snapshot": # Full book delivered first (every order including triggers) snapshot_ts = data["timestamp"] for order in data["data"]["bids"]: book["bids"][order["oid"]] = order for order in data["data"]["asks"]: book["asks"][order["oid"]] = order print(f"Snapshot: {len(book['bids'])} bids, {len(book['asks'])} asks")
elif data["type"] == "l4_batch" and snapshot_ts is not None: # Apply diffs to maintain the book for diff in data["data"]: if diff["ts"] <= snapshot_ts: continue side = "bids" if diff["side"] == "B" else "asks" oid = diff["oid"] if diff["dt"] == "new": book[side][oid] = { "oid": oid, "side": diff["side"], "price": diff["px"], "size": diff["sz"], "user_address": diff["user"] } elif diff["dt"] == "update": if oid in book[side]: book[side][oid]["size"] = diff["sz"] elif diff["dt"] == "remove": book[side].pop(oid, None)
asyncio.run(stream_l4())