> For the complete documentation index, see [llms.txt](https://k4k3ru.gitbook.io/k4k3ru-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k4k3ru.gitbook.io/k4k3ru-docs/api/market-hub/get-order-book-snapshot.md).

# Get a Consolidated OrderBook Snapshot

`MarketHub.OrderBook.Get` returns the latest venue-independent market depth for a canonical market.

The HTTP JSON-RPC method supports optional request signature authentication. Anonymous requests are limited to 3 per rolling 60 seconds per IP and method. When an `auth` envelope is supplied, Gateway asks CRM to verify the user API credential and signature; verified requests receive 60 per rolling 60 seconds per account and method. API keys and Console snapshot reads share this account quota. Invalid authentication is rejected without falling back to anonymous access. Snapshot reads consume no credit ticks. Gateway also retains its overall 300 requests/minute/IP limit.

## Request

```json
{
  "id": "1",
  "method": "MarketHub.OrderBook.Get",
  "params": {
    "marketType": "spot",
    "symbol": "BTC/USDC",
    "depth": 3
  }
}
```

Optional `assetClass` defaults to `crypto`. Optional `depth` defaults to `3` and accepts values from `1` through `20`. This method always consolidates all eligible sources. `sourceFilter` can restrict broad venue categories, liquidity models, or AMM chains; individual Venue selection is not exposed.

## Response

```json
{
  "id": "1",
  "result": {
    "ac": "crypto",
    "mt": "spot",
    "s": "BTC/USDC",
    "d": 3,
    "b": [
      {"p": "78891.9", "q": "0.016801"},
      {"p": "78889.1", "q": "0.01539"},
      {"p": "78886.4", "q": "0.011217"}
    ],
    "a": [
      {"p": "78892", "q": "0.01838"},
      {"p": "78896", "q": "0.90871"},
      {"p": "78901.2", "q": "0.021"}
    ],
    "svc": 2,
    "v": 6842374982615800523,
    "ts": 1788533857086000
  }
}
```

Bids are ordered from highest to lowest price and asks from lowest to highest. Quantities at the same price are combined across eligible sources. The response may contain fewer levels than requested when less fresh liquidity is available.

For order-book venues, levels come from the latest synchronized venue books. When a source only exposes executable synthetic BBO data, such as an AMM, its bid and ask contribute one level per side. The resulting depth is therefore a consolidated set of executable price levels and does not imply that every source provides a multi-level order book.

`svc` is the number of eligible fresh source venues. `v` identifies the published snapshot version and `ts` is the evaluation timestamp in Unix microseconds.

Possible errors include `invalid_parameter`, `not_found`, `rate_limit_error`, and `unexpected`.

## Bid-anchored non-crossed consolidation

From the 2026-09-07 implementation, BBO and OrderBook use the same consolidation rule for Get and Subscribe. Each eligible source must have fresh, valid positive prices and quantities on both sides, with its own best bid strictly below its best ask. Order-book snapshots must also be synchronized. Invalid or one-sided sources are excluded as a whole before any quantities are added.

The highest eligible bid anchors the result. All asks at or below that bid are excluded; retained prices are not modified and no trades are matched or netted. Equal-price quantities are combined. OrderBook reads all locally retained source levels and applies the requested depth after exclusion. BBO returns the first bid and ask of that same consolidated book. Depth-only source updates can therefore change the consolidated BBO even when the source's own BBO is unchanged. Synthetic BBO sources contribute only one level on each side.

The result always satisfies `bestBid < bestAsk`. It may have fewer levels than requested. If no eligible two-sided result exists, Get returns `not_found` and subscriptions emit no new price result; an earlier event is not a freshness guarantee. With valid two-sided sources, the source contributing the best bid also supplies at least one ask above it, so cross removal alone cannot empty all asks. `svc` counts eligible sources before cross removal, not sources at every returned level.

This changes the meaning of the consolidated ask: it is the lowest retained ask above the best bid, not necessarily the lowest ask across venues. Consumers must not use this filtered view to reconstruct cross-venue spread opportunities. VenueMarket snapshots and Parquet observations remain unfiltered; Spread and Carry continue to read their venue-level inputs directly. Non-crossed output does not establish an executable fill or an Oracle price guarantee. Production availability requires deploying the updated Market Hub application.

## Source freshness

BBO and OrderBook share the same source freshness policy: AMM quotes are eligible for 30 seconds after receipt; CEX and order-book DEX data remain eligible for 5 seconds. This accommodates the 15-second AMM quote polling cadence without increasing RPC traffic. Expired sources are excluded; when no eligible two-sided result remains, the API returns `not_found`. Unsynchronized books remain excluded.

This receipt-age limit does not refresh the underlying pool state or alter its cache TTL. Cached AMM quotes preserve their observed state timestamp, which may precede receipt. The policy is not a guarantee of execution-time quote validity.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://k4k3ru.gitbook.io/k4k3ru-docs/api/market-hub/get-order-book-snapshot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
