> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Build with the L4 Order Book

> Get per-order Hyperliquid book data — individual orders with user, order ID, and trigger metadata — for flow attribution and microstructure analysis.

The `l4Book` channel is a GoldRush-native, **order-level** book stream. Where L2 aggregates orders into price levels, L4 exposes the **individual orders** that make up each level — with the user, order ID, client order ID, time-in-force, and trigger metadata attached. Use it for per-trader flow attribution, queue-position estimation, and market microstructure analysis.

<Info>
  `l4Book` requires a specific `coin` — there's no wildcard subscription. It's
  billed at **2 credits/min per coin** (10,000 CU/min), and **20 credits/min for
  `BTC`**. See [pricing](/guides/hyperliquid/websockets/overview#pricing).
</Info>

## Subscribe

```json theme={null}
{
  "method": "subscribe",
  "subscription": { "type": "l4Book", "coin": "HYPE" }
}
```

Like `l2BookDiff`, you receive an initial **snapshot** of the current resting orders per coin, followed by per-block **updates** containing only the orders that were added, modified, or removed.

## What each order carries

Every order in the book exposes the fields that aggregated L2 levels hide:

| Field     | Meaning                                                       |
| --------- | ------------------------------------------------------------- |
| `user`    | Address that placed the order.                                |
| `oid`     | Order ID assigned by HyperCore.                               |
| `cloid`   | Client order ID, if the placer set one.                       |
| `px`      | Limit price, as a string.                                     |
| `sz`      | Remaining size on the order.                                  |
| `side`    | `"B"` (bid) or `"A"` (ask).                                   |
| `tif`     | Time-in-force (e.g. `Gtc`, `Ioc`, `Alo`).                     |
| `trigger` | Trigger metadata for stop / take-profit orders, when present. |

Snapshots and updates follow the same `Snapshot` / `Updates` envelope as [`l2BookDiff`](/guides/hyperliquid/websockets/l2-book-diff) — apply added and modified orders to a local map keyed by `oid`, and remove orders as they leave the book.

## When to use L4

<CardGroup cols={2}>
  <Card title="Reach for L4" icon="circle-check">
    Attributing flow to specific wallets, estimating queue position, or reconstructing exact order-level microstructure.
  </Card>

  <Card title="Reach for L2 instead" icon="circle-half-stroke">
    You only need aggregated depth or top-of-book — [`l2Book`](/guides/hyperliquid/websockets/l2-book) or [`l2BookDiff`](/guides/hyperliquid/websockets/l2-book-diff) are far cheaper.
  </Card>
</CardGroup>

## Pair with account streams

L4 tells you what's resting on the book; the account channels tell you what executes. Combine `l4Book` with:

* `allFills` — every fill across the venue.
* `liquidationFills` — the global liquidation stream.
* `userFills` / `orderUpdates` — per-wallet fills and order lifecycle events.

See the full list in the [WebSocket overview](/guides/hyperliquid/websockets/overview#available-channels).
