Skip to main content
POST
l4BookSnapshot | Hyperliquid Info API

Credit Cost

1 per call

Processing

Realtime
The Hyperliquid info endpoint with type: "l4BookSnapshot" is used to fetch a full order-level (L4) order book snapshot for one coin - every resting order, not aggregated price levels - carrying the height, epoch, and per-coin seq needed to bootstrap and align the l4BookUpdates diff stream.
  • GoldRush-native. l4BookSnapshot is not a POST api.hyperliquid.xyz/info method - it is served only by the GoldRush endpoint.
  • Bootstrap for l4BookUpdates. That WebSocket stream is diff-only; this endpoint provides the initial order-level book to seed from, plus the height/epoch/seq to align the diffs onto it.
  • Order-level. Unlike the aggregated l2BookDiffSnapshot, each entry is an individual order (user, oid, side, sz, tif, trigger metadata), enabling queue-position reconstruction and per-trader flow attribution.
  • Perps only. No spot or prediction-market assets.
  • The snapshot already reflects every diff up to and including its own height (it is taken after that block is applied), so discard any diff at or below it.
Returns a point-in-time, full order-level book for one coin - two arrays of individual orders (bids first, then asks, each in queue order at its price) - together with the height, epoch, and per-coin seq that tie the snapshot to the l4BookUpdates stream.

Endpoint

Request

string
default:"l4BookSnapshot"
required
Always "l4BookSnapshot".
string
required
The perp asset symbol, e.g. "BTC". For HIP-3 markets use the deployer-prefixed form.

Example

Response

A single JSON object. levels is a two-element array: element 0 is the bid side, element 1 is the ask side. Each entry is an individual order (not an aggregated level), in queue order at its price.

Field descriptions

limitPx, sz, and triggerPx are returned as decimal strings, preserving upstream precision. Do not parse them as floats.
string
The asset the book is for - echoes the request coin.
int
Snapshot timestamp in milliseconds since Unix epoch.
int
HyperCore block height the snapshot was taken at. Discard any l4BookUpdates batch whose block_height is ≤ this value.
string
Server generation (UUID). Must match the epoch on the l4BookUpdates batches you apply; a different epoch means the stream reset and you should re-fetch.
int
The per-coin sequence this snapshot is aligned to. The first l4BookUpdates entry you apply for this coin should have prev_seq == seq.
array<array<Order>>
Two-element array: levels[0] are bids, levels[1] are asks. Each side is an array of individual Order objects (see below), in queue order at their respective price.

Order object

string
Wallet address that owns the order.
string
Asset symbol.
string
"B" for bid, "A" for ask.
string
Limit price (decimal string).
string
Resting size (decimal string, base units).
int
Hyperliquid order id - stable for the lifetime of the order.
int
Order-placement timestamp in HyperCore milliseconds.
string
Trigger condition string (e.g. "N/A" for plain limit orders).
boolean
True if this is a stop / take-profit trigger order.
string
Trigger price (decimal string, "0.0" for non-trigger orders).
boolean
True if this is a position-level TP/SL.
boolean
True if the order is flagged reduce-only.
string
Hyperliquid order type (e.g. "Limit").
string
Time-in-force (e.g. "Alo", "Gtc", "Ioc").
string | null
Client-supplied order id (hex string), or null if none was provided.

Bootstrapping the l4BookUpdates stream

Use this snapshot to seed a local order-level book, then keep it current with the l4BookUpdates WebSocket stream:
  1. Subscribe to l4BookUpdates for your coin(s) and start buffering Updates.
  2. Fetch this snapshot; note height, epoch, and seq.
  3. Drop any buffered batch whose block_height ≤ height.
  4. Confirm each remaining batch’s epoch equals this snapshot’s epoch (else re-fetch).
  5. Apply diffs in order - the first for the coin has prev_seq == seq. Insert (new), resize (update), or delete (remove) each order by oid.
  6. Keep checking per-coin prev_seq continuity; on a gap or epoch change, re-fetch and re-bootstrap.

l4BookUpdates

subscribe to a strictly-ordered, diff-only order-level (L4) book stream with per-coin sequence numbers and a server epoch for gap detection.

l4Book

subscribe to GoldRush’s order-level Hyperliquid book - initial snapshot of every resting order plus per-block diffs with full metadata.

l2BookDiffSnapshot

fetch a full-depth L2 order book snapshot for one coin, with height, epoch, and seq to bootstrap the l2BookDiff2 stream.
See all Hyperliquid endpoints: Overview hub · Info API reference