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

# Orderbook responses

> Bids-only books, YES/NO reciprocity, and how to read spreads.

Binary markets only need bids. A YES bid at tick `t` is economically the same
as a NO ask at `100 − t`, so sending asks would duplicate the book.

## Shape

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
GET /v1/markets/{market_id}/orderbook?depth=10
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "market_id": 66,
  "yes": [[47, 1200], [46, 800]],
  "no":  [[52, 950],  [51, 400]],
  "as_of_seq": "182390"
}
```

| Field   | Meaning                                                                |
| ------- | ---------------------------------------------------------------------- |
| `yes`   | YES **bids**, YES-space ticks, **best first**                          |
| `no`    | NO **bids**, NO-space ticks, **best first**                            |
| Level   | `[tick, aggregate_qty]` — `tick` 1–99, `qty` a JSON **number** on REST |
| `depth` | Levels per side (default 10, max 99)                                   |

Per-order queue data is never published — this is an aggregated L2 book. For
shares ahead of **your** resting order, use
[`GET /v1/portfolio/orders/{id}/queue_position`](/api-reference/overview).

<Warning>
  WebSocket `orderbook_snapshot` / `orderbook_delta` render level `qty` as a
  **decimal string**. REST uses a JSON number. Do not assume the two wires are
  identical.
</Warning>

## Reciprocal pricing

| On the book         | Equivalent ask       |
| ------------------- | -------------------- |
| YES bid at tick `t` | NO ask at `100 − t`  |
| NO bid at tick `t`  | YES ask at `100 − t` |

### Best prices and spread (YES)

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
best_yes_bid = orderbook["yes"][0][0]          # highest YES bid
best_yes_ask = 100 - orderbook["no"][0][0]    # implied from best NO bid
spread = best_yes_ask - best_yes_bid
```

If either side is empty, that implied ask (or bid) does not exist.

## Live updates

Subscribe to `orderbook_delta` — the first frame per market is a full
`orderbook_snapshot`, then level deltas. On a delta, `qty` is the **new
aggregate** at that level (set it; do not add). `qty` of `0` clears the level.

After a sequence gap, re-baseline with
`update_subscription` / `get_snapshot` rather than inventing missing levels.
See [WebSocket overview](/websocket/overview) and
[Channels](/websocket/channels).
