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

# Soft Quote Depth Streaming

> gRPC endpoint for real-time, synthetic soft-quote market depth streaming.

Soft quote depth is a synthetic, indicative market-depth view (bids and asks) derived from the soft-quote price ladder for each asset. It lets clients track quotable size at multiple price levels without polling the REST [Request a Soft Attestation Quote](/api-reference/attestations/request-a-soft-attestation-quote) endpoint per price for hundreds of assets. Depth is recomputed and pushed as the underlying ladder changes.

<Note>
  To generate a typed client for this endpoint, see [Protobuf Schema & Code Generation](/api-reference/protobuf-schema).
</Note>

## Authentication

All requests must include your API key in the `x-api-key` metadata header.

## Request

**Endpoint:** `grpc.gm.ondo.finance:443`

**RPC:** `ondo.gm.backend.v1.BackendService/StreamSoftQuoteDepth`

<ParamField body="symbols" type="string[]">
  Asset symbols to subscribe to. If empty, you will receive updates for all assets.
</ParamField>

## Response

A server stream of messages. Each message batches one or more `SoftQuoteDepth` entries (one per symbol that updated since the last send) into a single `updates` array.

Each entry holds the marginal depth ladder for a single asset: `asks` represent the buy (mint) side ordered best (lowest) price first, and `bids` represent the sell (redeem) side ordered best (highest) price first. Each level's `quantity` is the incremental token size available at the level's marginal `price`. Prices and quantities are decimal strings in human units. When `error` is set, `bids` and `asks` are empty.

<ResponseField name="updates" type="SoftQuoteDepth[]">
  Array of soft-quote depth updates.

  <Expandable title="SoftQuoteDepth">
    <ResponseField name="symbol" type="string">
      GM asset symbol.
    </ResponseField>

    <ResponseField name="ticker" type="string">
      Underlying stock ticker.
    </ResponseField>

    <ResponseField name="session_type" type="string">
      Trading session the depth was computed for. One of `premarket`, `regular`, `postmarket`, `overnight`, or `offhours`.
    </ResponseField>

    <ResponseField name="error" type="string">
      Asset-level failure (e.g. paused, market closed, stale price). When set, `bids` and `asks` are empty.
    </ResponseField>

    <ResponseField name="timestamp" type="uint64">
      Unix timestamp of the underlying computation (in nanoseconds).
    </ResponseField>

    <ResponseField name="bids" type="SoftQuoteDepthLevel[]">
      Sell side (redeem), best (highest) price first.

      <Expandable title="SoftQuoteDepthLevel">
        <ResponseField name="price" type="string">
          Marginal price for this level.
        </ResponseField>

        <ResponseField name="quantity" type="string">
          Token quantity available at this level.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="asks" type="SoftQuoteDepthLevel[]">
      Buy side (mint), best (lowest) price first.

      <Expandable title="SoftQuoteDepthLevel">
        <ResponseField name="price" type="string">
          Marginal price for this level.
        </ResponseField>

        <ResponseField name="quantity" type="string">
          Token quantity available at this level.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Streaming behavior

* **Snapshot on subscribe.** On connect, you receive the current depth for each subscribed symbol (when a fresh book is available), followed by live updates as the underlying ladder changes.
* **Batching.** Updates are flushed at most once every \~250 ms per stream. Within a window, only the latest book per symbol is kept, so a newer update supersedes an earlier one buffered in the same window.

## Errors

Asset-level problems (for example, a paused asset or a closed market) are reported inline: the affected `SoftQuoteDepth` entry carries a human-readable `error` with empty `bids` and `asks`, and the stream stays open (see the `GOOGLon` entry in the example).

Request-level problems terminate the stream with a gRPC status:

* `InvalidArgument` — a malformed symbol (must be at least 3 characters and end with `on`).
* `NotFound` — an unknown asset symbol.
* `Unauthenticated` — a missing or invalid `x-api-key`.
* `ResourceExhausted` — per-account stream rate limits exceeded.

<RequestExample>
  ```bash grpcurl theme={null}
  grpcurl \
    -H "x-api-key: <YOUR_API_KEY>" \
    -d '{"symbols": ["AAPLon", "GOOGLon"]}' \
    grpc.gm.ondo.finance:443 \
    ondo.gm.backend.v1.BackendService/StreamSoftQuoteDepth
  ```
</RequestExample>

<ResponseExample>
  ```json Streamed theme={null}
  {
    "updates": [
      {
        "symbol": "AAPLon",
        "ticker": "AAPL",
        "sessionType": "regular",
        "timestamp": "1773350214476688119",
        "bids": [
          { "price": "256.700000000000000000", "quantity": "100.000000000000000000" },
          { "price": "256.500000000000000000", "quantity": "250.000000000000000000" }
        ],
        "asks": [
          { "price": "256.900000000000000000", "quantity": "100.000000000000000000" },
          { "price": "257.100000000000000000", "quantity": "250.000000000000000000" }
        ]
      },
      {
        "symbol": "GOOGLon",
        "ticker": "GOOGL",
        "sessionType": "regular",
        "error": "market closed",
        "timestamp": "1773350214478735649",
        "bids": [],
        "asks": []
      }
    ]
  }
  ```
</ResponseExample>
