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

# Stream Quotes

> Server-Sent Events stream of live best-quote pricing for an open quote request. The preferred transport for live pricing in the trading UI.

Subscribe to a **Server-Sent Events** stream of live best-quote pricing while the user builds their slip. This is the **preferred** transport for live pricing — it pushes an update only when the best quote changes, replacing the old \~1s polling of [`GET /quote-requests/:id/quotes`](/api-reference/trading/poll-quotes) (which remains available as a fallback).

The response has `Content-Type: text/event-stream`. Use the browser `EventSource` API or any SSE-capable client. No API key is required — trading endpoints are open.

## Path Parameters

<ParamField path="id" type="string" required>
  The `requestId` returned by [`POST /quote-requests`](/api-reference/trading/create-quote-request).
</ParamField>

## Events

<ResponseField name="best_quote" type="event">
  Emitted whenever the best-quote payload changes. Data:

  <Expandable title="best_quote data">
    <ResponseField name="bestQuote" type="object | null">
      The current best quote (including `maker_id` and `quote_id`), or `null` if no valid quotes have been received.
    </ResponseField>

    <ResponseField name="quoteCount" type="number">
      Total number of valid quotes received.
    </ResponseField>

    <ResponseField name="status" type="string">
      Request status, e.g. `"open"`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="closed" type="event">
  Emitted when the request ends (committed, expired, or cancelled). Data: `{ "requestId": "..." }`.
</ResponseField>

## Errors

Returns HTTP `404` (JSON) if the quote request does not exist.

<RequestExample>
  ```bash theme={null}
  curl -N https://api.convallax.com/quote-requests/req-789/stream
  ```
</RequestExample>

<ResponseExample>
  ```text Stream theme={null}
  event: best_quote
  data: {"bestQuote":{"maker_id":"mm-1","quote_id":"8f3c2b1a-...","side":"buy","price":0.12,"size":10},"quoteCount":3,"status":"open"}

  event: best_quote
  data: {"bestQuote":{"maker_id":"mm-2","quote_id":"a1b2c3d4-...","side":"buy","price":0.11,"size":10},"quoteCount":4,"status":"open"}

  event: closed
  data: {"requestId":"req-789"}
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "error": "Quote request not found"
  }
  ```
</ResponseExample>
