---
title: "RFQ quote stream"
description: "Stream the average fill price for your open RFQ's size on each side of the book, as the taker."
---

| | |
|---|---|
| SDK | `client.rfq_quote_stream(...)` |
| Channel | `v1.quote` on `wss://trades.<domain>/ws/full`, or `/ws/lite` for [lite names](../../guides/environments.md#encoding-full-or-lite) (the SDKs' default) |
| Selector | `<sub_account_id>[-<instrument>]` |
| Auth | Session required on the WebSocket upgrade ([Authentication](../../guides/authentication.md)) |
| Kind | `event`. Each frame is one event (an update to one object). |
| Sequenced | Yes: the first update's `prev_sequence_number` is at or below the subscribe reply's `latest_sequence_number`, then each one equals the last `sequence_number` ([rules](../../guides/websocket.md#sequence-numbers-and-gaps)). On a gap, re-subscribe, then fetch current state over HTTP for what you missed. |
| Contract id | `rfq.rfq_quote` (`StreamRfqQuoteV1`) |

## Selector

Grammar `<sub_account_id>[-<instrument>]`, e.g. `<sub_account_id>-AAPL_USDC_SFP`. Parts:

- `sub_account_id` · uint64 — The sub-account ID to filter by
- `instrument` · asset, optional — The instrument filter to apply.

## Frame

Type `WSRfqQuoteFeedDataV1`.

- `stream` · lite `s` · string · required — The stream this frame belongs to, e.g. `v1.quote`.
- `selector` · lite `s1` · string · required — The selector this frame is for, as you subscribed with it.
- `sequence_number` · lite `sn` · string (uint64) · required — This frame's number, an unsigned 64-bit integer sent as a decimal string: compare it as an integer. `"0"` on the snapshot sent right after subscribing.
  - With `use_global_sequence_number: true` (recommended), the number is unique across the exchange. One exchange event can produce several frames, so the number is `event number × 10^5 + a counter` that tells them apart.
  - With `false`, it counts up by one per frame of this stream and starts again when the server you are connected to restarts.
- `feed` · lite `f` · object RfqQuoteFeed · required — The taker's private quote book for their open RFQ on this instrument
- `feed.rfq_id` · lite `ri` · string (uint128) · required — The RFQ this estimate belongs to. A feed with no levels means the RFQ ended
- `feed.best_bid` · lite `bb` · string · optional — Average fill price to sell the RFQ size. Decimal string, e.g. "65000.5"; up to 9 decimals. Omitted when the bid side is empty
- `feed.best_ask` · lite `ba` · string · optional — Average fill price to buy the RFQ size. Decimal string, e.g. "65000.5"; up to 9 decimals. Omitted when the ask side is empty
- `feed.bid_levels` · lite `bl` · object RfqQuoteLevel[] · required — The sell-side estimate (at most one level), from the bids
- `feed.bid_levels[].price` · lite `p` · string · required — Average fill price for the size. Decimal string, e.g. "65000.5"; up to 9 decimals. Rounded against the taker: up for asks, down for bids
- `feed.bid_levels[].size` · lite `s` · string · required — Fillable size, up to the RFQ size. Decimal string, e.g. "0.01"; up to the instrument's base_decimals.
- `feed.bid_levels[].maker_anon_account_id` · lite `ma` · string (uint128) · required — The maker's derived anonymous account id shown to the taker. Real maker identity is never exposed
- `feed.bid_levels[].time_in_force` · lite `ti` · enum TimeInForce · required — Distinguishes an AON level (liftable only in full — POST-MVP) from a GTT level
  Values: `GOOD_TILL_TIME`, `ALL_OR_NONE`, `IMMEDIATE_OR_CANCEL`, `FILL_OR_KILL`, `RETAIL_PRICE_IMPROVEMENT` ([details](../enums.md#timeinforce)).
- `feed.ask_levels` · lite `al` · object RfqQuoteLevel[] · required — The buy-side estimate (at most one level), from the asks
  Fields: same as `feed.bid_levels[]` above.
- `prev_sequence_number` · lite `ps` · string (uint64) · required — The `sequence_number` of the frame before this one on this selector. If it doesn't match the last frame you accepted, you missed frames.

## Errors

Subscribe errors arrive as a JSON-RPC `error` object `{code, message}` (lite `{c, m}`). Codes this stream can return ([all error codes](../errors.md)):

`1000` Unauthorized (401) · `1001` Forbidden (403) · `1002` InternalServer (500) · `1101` InvalidFeedFormat (400) · `1102` PrimarySelectorParts (400) · `1103` SecondarySelectorParts (400) · `3000` InvalidInstrument (400) · `3020` InvalidSubAccountID (400)

## Example

```python
import asyncio
import os

from grvt import AsyncGrvt


async def main():
    async with AsyncGrvt(env=os.environ.get("GRVT_ENV", "testnet"), api_key=os.environ["GRVT_API_KEY"]) as client:
        async with client.rfq_quote_stream(instrument="AAPL_USDC_SFP", sub_account_id=os.environ["GRVT_SUB_ACCOUNT_ID"]) as sub:
            async for frame in sub:
                print(frame.sequence_number, frame.feed)


asyncio.run(main())
```

Raw WebSocket: connect to `wss://trades.$GRVT_DOMAIN/ws/full` (`/ws/lite` for lite names) with the `Cookie: gravity=...` and `X-Grvt-Account-Id` headers and send:

With full field names:

```json
{
  "jsonrpc": "2.0",
  "method": "subscribe",
  "params": {
    "stream": "v1.quote",
    "selectors": ["$GRVT_SUB_ACCOUNT_ID-AAPL_USDC_SFP"],
    "use_global_sequence_number": true
  },
  "id": 1
}
```

With lite field names:

```json
{
  "j": "2.0",
  "m": "subscribe",
  "p": {
    "s": "v1.quote",
    "s1": ["$GRVT_SUB_ACCOUNT_ID-AAPL_USDC_SFP"],
    "ug": true
  },
  "i": 1
}
```

The reply's `result` is a `WSSubscribeResult` (`subs`, `num_snapshots`, `latest_sequence_number`); then frames arrive in the shape under Frame above, with no JSON-RPC envelope.
