Skip to main content
L2 is price-level aggregated depth: each level carries a price, the total size resting at that price, and the order count behind it (px, sz, n), not the individual orders themselves. L2 is the shape of the book. Reach for it when you need spreads, depth charts, a top-of-book monitor, or a light historical window, and step up to L3 or L4 only when individual orders or full lifecycle matter. This page covers the two L2 surfaces: native venue snapshots capped at 20 levels per side, and the full-depth aggregated L2 route family derived from L4 on Hyperliquid core and HIP-3.

Get an L2 snapshot

Pick your venue. The path and symbol format change per family.
curl "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC/l2?depth=200" \
  -H "X-API-Key: $OXARCHIVE_API_KEY"
DepthRoute
Full-depth aggregated L2 from L4/v1/hyperliquid/orderbook/{symbol}/l2, /l2/history, /l2/diffs
Native L2 snapshot or history (20 levels)/v1/hyperliquid/orderbook/{symbol}, /v1/hyperliquid/orderbook/{symbol}/history
Plain perp symbols such as BTC and ETH. Use the /l2 routes for Build 200-level or Pro full-depth aggregated L2 from March 10, 2026 onward.

Native L2 versus full-depth L2

Hyperliquid core and HIP-3 expose two L2 surfaces, and they answer different questions:
JobRouteNotes
200-level or full-depth aggregated L2/v1/hyperliquid/orderbook/{symbol}/l2 or the HIP-3 equivalentDerived from L4, with March 10, 2026+ coverage
Native source snapshot or older top-book windows/v1/hyperliquid/orderbook/{symbol} and /history, or the HIP-3 equivalentsMirrors the venue snapshot; caps at 20 levels per side
Native Hyperliquid and HIP-3 L2 routes mirror the venue source snapshot and top out at 20 levels per side. A request like depth=200 on /v1/hyperliquid/orderbook/BTC/history still returns at most 20 levels. For 200-level or full-depth aggregated L2 on those families, use the /l2 route family. Spot, HIP-4, and Lighter serve native L2 depth and are tier-gated directly.

Request parameters

ParameterInTypeRequiredDescription
symbolpathstringYesTrading pair symbol, e.g. BTC
timestampqueryinteger (ms)NoSnapshot routes only; Unix milliseconds; omit for the latest snapshot
start, endqueryinteger (ms)NoHistory and diff routes; Unix-millisecond window bounds
depthqueryintegerNoSnapshot depth where documented. Native Hyperliquid/HIP-3 L2 caps at 20; full-depth /l2 snapshots are plan-capped (Build 200, Pro/Enterprise full); Lighter L2 is tier-gated directly
limitqueryintegerNoMax rows or checkpoints on history/diff routes
cursorquerystring/integerNoContinuation token from meta.next_cursor
The /l2/history routes return the plan-capped checkpoint depth and currently do not take a per-request depth override. Ask for a bounded start/end window and paginate with cursor.

Example response

The L2 snapshot returns the same envelope across venues:
{
  "success": true,
  "data": {
    "coin": "BTC",
    "symbol": "BTC",
    "timestamp": "2026-06-05T13:53:33.971Z",
    "bids": [
      { "px": "61077.0", "sz": "0.0003", "n": 1 },
      { "px": "61075.0", "sz": "1.60628", "n": 6 }
    ],
    "asks": [
      { "px": "61078.0", "sz": "11.73086", "n": 32 },
      { "px": "61079.0", "sz": "1.45565", "n": 4 }
    ],
    "mid_price": "61077.5",
    "spread": "1",
    "spread_bps": "0.16372641316360362"
  },
  "meta": { "request_id": "req_2c9a7f10b8e34d52" }
}
A price level is px (price), sz (total size), and n (order count). px, sz, mid_price, spread, and spread_bps are decimal strings, so parse them as decimals, not floats. n aggregates the orders at a level; L4 lists each one with its oid and user_address. The /l2 routes also return bid_levels, ask_levels, total_bid_size, and total_ask_size. Full field meanings live in the field dictionary, and the Endpoint Reference carries the exact types.

Stream it live

Every venue streams the L2 book. Subscribe to orderbook on Hyperliquid core; Spot, HIP-3, and HIP-4 use prefixed variants (spot_orderbook, hip3_orderbook, and so on), and Lighter adds lighter_orderbook.
ws.send(JSON.stringify({ op: "subscribe", channel: "orderbook", symbol: "BTC" }));
The full channel matrix is on WebSocket Channels.

Export in bulk

L2 books export as the l2_orderbook schema ($6/GB, $10 minimum), delivered as Parquet with ZSTD compression. Keep L2, L3, and L4 in separate tables. Build a selection in the Data Catalog; columns and coverage keys are on Export Schemas.

Other depths

L3 order book

Individual orders on Lighter, order-level detail without full lifecycle.

L4 order book

Every resting order with its oid and user_address, plus diffs and reconstruction.

Next

Start from Order books for the depth overview, Order Book Depth to choose a grain, Example Responses for more payload shapes, or Data Quality before any long historical window.
Last modified on June 25, 2026