> ## 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.

# Retention and live history

> What live listings keep, what they silently drop, and how to discover the caps.

Live list endpoints are **count-capped**. When a cap is hit, the oldest rows
are evicted and simply stop appearing — there is no error and no "truncated"
flag. Resting orders are never evicted; only terminal history is.

## Discover the caps

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
GET /v1/exchange/retention
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tape_cap": 256,
  "terminal_cap": 256,
  "reject_cap": 256,
  "fill_cap": 256
}
```

Defaults are typically 256. Treat the response as authoritative for the
deployment you are talking to.

## What each cap covers

| Cap            | Live endpoint                                | Evicts                                               |
| -------------- | -------------------------------------------- | ---------------------------------------------------- |
| `tape_cap`     | `GET /v1/markets/{id}/trades`                | Oldest public prints **per market**                  |
| `terminal_cap` | `GET /v1/portfolio/orders`                   | Oldest filled / canceled / expired rows **per user** |
| `reject_cap`   | Rejected-order history (same orders listing) | Oldest rejects **per user**                          |
| `fill_cap`     | `GET /v1/portfolio/fills`                    | Oldest own fills **per user**                        |

## Always available (not capped by retention)

| Data                                        | Why                                              |
| ------------------------------------------- | ------------------------------------------------ |
| Resting / partially filled orders           | Never evicted from the live order list           |
| Open positions                              | Live until settled / flattened                   |
| Current orderbook                           | Rebuilt from the active book, not a history ring |
| Round / market metadata for the live window | Bound to the active ring, not the tape           |

## Impacted live endpoints

| Endpoint                                            | Cap            | Gotcha                                                       |
| --------------------------------------------------- | -------------- | ------------------------------------------------------------ |
| `GET /v1/markets/{id}/trades`                       | `tape_cap`     | Walking with `cursor` eventually ends; older prints are gone |
| `GET /v1/portfolio/fills`                           | `fill_cap`     | Full fill history is not available via REST                  |
| `GET /v1/portfolio/orders?status=executed,canceled` | `terminal_cap` | Terminal rows disappear; resting ones stay                   |
| Rejected orders in the same list                    | `reject_cap`   | Same story                                                   |

<Warning>
  There is **no historical API** yet. Deeper history is deferred to an offline
  mirror and is not retrievable from these live endpoints. If you need durable
  history, persist fills and trades yourself from the WebSocket as they arrive.
</Warning>

## Practical pattern

1. Call `GET /v1/exchange/retention` once at startup.
2. Stream `trades` and `user` over WebSocket and append to your own store.
3. Treat REST list endpoints as "recent window" views, not archives.

Related: [Pagination](/concepts/pagination), [WebSocket channels](/websocket/channels).
