Skip to main content
The l2BookDiff channel is a bandwidth-efficient way to track order book changes. Instead of a full book on every update, you get an initial snapshot per coin followed by per-block Updates carrying only the price levels that changed — the same { px, sz, n } structure as l2Book. It’s a GoldRush-native channel, unavailable on the public Hyperliquid feed, and the cheapest way to keep a live book across many assets.
l2BookDiff is billed at 0.1 credits/min per coin (500 CU/min) — a fifth of l2Book. See pricing.

Subscribe

coin accepts:
  • a single asset: "HYPE"
  • an array: ["HYPE", "BTC", "ETH"]
  • omitted entirely — streams all perps on one connection. When omitted, specify marketTypes like ["spot"] or ["*"] for multi-market coverage.

Payload shapes

The first message per coin is a Snapshot; subsequent messages are Updates.

Snapshot

levels is [bids, asks] — each entry is a price object.

Update

Maintain a local book

  1. On Snapshot: initialize (or reset) the coin’s book with bid and ask maps.
  2. On Updates: for each book_diff, apply the changed levels to the matching side.
  3. When sz === "0", delete that price level; otherwise set or update it.
Reconstruct top-of-book by scanning your local maps for the highest bid and lowest ask.

Reconnection

On reconnect, resend your original subscription. Fresh snapshots arrive first — discard local state for affected coins and re-seed from those snapshots rather than attempting to replay missed updates.