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

# Orderbook Updates

> Full YES and NO bid ladders for a market.

A `prediction-orderbook` message carries a **full snapshot** of a market's order
book. It is not a delta — each message replaces your view entirely.

## Subscribe

```json theme={null}
{"type":"subscribe","data":{"targets":[{"target":"event-market","data":{"ticker":"ANTHROPIC-VALUATION-26Q3-2.1T"}}]}}
```

Public. No credential required.

## Fields

| Field | Type | Description |
| - | - | - |
| `type` | string | Always `"prediction-orderbook"` |
| `eventMarketId` | string | UUID of the market |
| `yesBids` | array | Buy-YES orders, one entry per price level |
| `noBids` | array | Buy-NO orders, one entry per price level |
| `ts` | number | Unix timestamp in **nanoseconds** |

Each entry in `yesBids` and `noBids` is a price level:

| Field | Type | Description |
| - | - | - |
| `price` | number | Price in cents, 1–99 |
| `size` | number | Total shares resting at this price |

## Example

```json theme={null}
{
  "type": "market-update",
  "data": {
    "type": "prediction-orderbook",
    "eventMarketId": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
    "yesBids": [
      { "price": 61, "size": 250 },
      { "price": 60, "size": 1200 },
      { "price": 58, "size": 400 }
    ],
    "noBids": [
      { "price": 37, "size": 800 },
      { "price": 36, "size": 150 }
    ],
    "ts": 1789238400123456789
  }
}
```

## Both sides are bids

There is no ask ladder. The book is expressed as two bid ladders, because a
buy-NO order **is** an offer to sell YES.

`noBids` is derived from the internal book as `100 − ask_price`. To reconstruct
a conventional YES book:

| Conventional view | Source |
| - | - |
| YES bid | `yesBids[i].price` |
| YES ask | `100 − noBids[i].price` |

So a NO bid at 37¢ is equivalent to a YES ask at 63¢.

<Note>
  This is why the two ladders do not overlap. If the best `yesBids` price were
  62 and the best `noBids` price were 39, that would imply a YES bid of 62 and a
  YES ask of 61 — a crossed book, which the engine would have matched.
</Note>

## Notes

* **Replace, don't merge.** Every message is a complete snapshot. Discard your
  previous book and apply the new one wholesale.
* **Do not rely on level ordering.** The ladders are passed through in the
  order the engine emits them. Sort by `price` yourself — descending for
  `yesBids`, descending for `noBids` — rather than assuming `[0]` is the best
  level.
* A price level absent from the snapshot has no resting size. There are no
  explicit zero-size entries to process.
* Snapshots are published on change, not on a fixed interval. A quiet market
  may go a long time between messages — that is not a stall.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.