TheDocumentation Index
Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
l4Book channel on wss://hypercore.goldrushdata.com/ws?key=<GOLDRUSH_API_KEY> is a GoldRush-exclusive stream - it has no equivalent on wss://api.hyperliquid.xyz/ws. After subscribing, the server sends a single Snapshot of every resting order, then per-block Updates carrying lifecycle events and per-order book changes. Each order arrives with its user, oid, cloid, tif, and trigger metadata, so you can reconstruct queue position, attribute flow to specific wallets, and run microstructure analytics that l2Book’s aggregated {px, sz, n} view hides. For the raw subscription shape see the l4Book reference; for the connection model see the WebSocket API overview.
What you get
- Per-order visibility. Every level in the snapshot is an individual order keyed by
oid, withuser,cloid,tif,orderType, and trigger metadata attached.l2Bookonly exposes{px, sz, n}per price level. - Snapshot + diff transport. One full
Snapshoton subscribe, then per-blockUpdatescontainingorder_statuses(lifecycle events) andbook_diffs(per-order changes). Apply diffs to local state. - Per-block cadence. Updates fire on each HyperCore block where the book for the subscribed
coinchanged. Thetimeandblock_heightfields anchor each message to a specific block. - GoldRush-exclusive. Not available on the public Hyperliquid WebSocket - this stream surfaces user attribution and per-order metadata the public feed never exposes.
- One coin per subscription. Unlike
l2Book,coinis required. To cover multiple assets, open onel4Booksubscription per asset on the same connection.
Subscribe and maintain book state
The pattern below keeps aMap<oid, Order> per coin. The snapshot seeds the map; each Updates message applies book_diffs against it. Reconnects drop the map and re-seed from the next snapshot.
Patterns
Track individual orders by oid
oid is the Hyperliquid order id, stable for the lifetime of the order - use it as the primary key in your local map. cloid is the client-supplied id (may be null); index on it when you need to correlate fills back to a specific trading bot’s instructions.
Per-user flow attribution
Every order entry carriesuser. Group orders by wallet to surface market-maker behavior, identify spoofing patterns, or build a per-trader heatmap of resting size. Pair this with clearinghouseState for per-user position and margin context.
TypeScript
Reconstruct aggregated price levels
If a downstream consumer expects anl2Book-style aggregated view, sum sz across all orders sharing a limitPx on the same side. Going the other way isn’t possible - l2Book collapses the per-order detail you’d lose.
TypeScript
Handling reconnects
On reconnect, resend the samesubscribe payload. The first message back is always a fresh Snapshot - drop your local orders map and re-seed from it. Do not attempt to replay missed Updates - the snapshot is authoritative and supersedes anything you held before the disconnect.
TypeScript
Related
l4BookAPI reference - full subscription, snapshot, and update schema.l2Bookreference - aggregated price-level snapshots when per-order detail isn’t needed.- WebSocket API overview - endpoint URL, auth, and limits.
clearinghouseState- pair per-user resting orders with position and margin state.