# WebSocket Streams

Combo RFQ uses three streams:

| Stream | Auth | Use for |
|---|---|---|
| `requestForQuote` | Public | Discovering RFQ auctions (anonymous broadcast). |
| `requestForQuote@account` | Authenticated (`view_orders`) | Your private deliveries: the selected quote after your RFQ closes, acceptances of your quotes, and confirm/decline outcomes. Each delivery has a durable event ID for deduplication. |
| `requestForQuote@session` | Authenticated (`view_orders`) | Same account-scoped deliveries as `@account`; an alternate subscription form. Mutually exclusive with `@account`. |

## `requestForQuote`

Anonymous, real-time feed of combo request-for-quote auctions. When a taker opens an RFQ, this feed broadcasts the auction so makers can choose to quote it. Only the auction's existence and parameters are broadcast: the requester's identity, the maker accounts, and the individual quotes are never included. After close, only the selected quote is delivered privately to the requester over an authenticated stream.

**Auth:** public. Anyone can subscribe.

<StreamTester streamName="requestForQuote" url="wss://ws.gemini.com" />

### Message shape

```json
{
  "e": "requestForQuote",
  "E": 1780000000000,
  "r": "01J9Z3K7Q2N8M4P6R8T0V2W4X6",
  "l": [
    { "c": "123456", "o": "YES" },
    { "c": "123789", "o": "NO" }
  ],
  "n": "50000.00",
  "S": "OPEN",
  "w": 1780000001000,
  "x": 1780000120000,
  "c": 1780000000000
}
```

| Field | Type | Description |
|---|---|---|
| `e` | string | Event type — always `requestForQuote`. |
| `E` | number | Event timestamp (milliseconds). |
| `r` | string | `rfqId` — unique ULID for this request-for-quote. Pass it to `rfq.submit_quote`. |
| `l` | array | The contracts that make up the combo, in a fixed order. Each: `c` = CMS contract id, `o` = the outcome the combo takes on that contract (`YES` / `NO`). |
| `n` | string | Requested size as a USD notional, if sized that way. Omitted otherwise; mutually exclusive with `q`. |
| `q` | string | Requested size in whole contracts, if sized that way. Omitted otherwise; mutually exclusive with `n`. |
| `f` | string | Execution quantity calculated when the requester accepts. It is present on later lifecycle events and can appear on `FAILED`; only `S: "FINALIZED"` confirms successful execution. |
| `S` | string | Lifecycle state (`OPEN` / `PENDING_ACCEPTANCE` / `CONFIRMING` / `FINALIZING` / `FINALIZED` / `CANCELLED` / `EXPIRED` / `FAILED`). `OPEN` is live and quotable. |
| `w` | number | When the 1-second quoting window closes (milliseconds), 1 second after RFQ creation. Omitted when unset. |
| `x` | number | Hard expiry by which the auction must finalize (milliseconds). Omitted when unset. |
| `c` | number | When the request-for-quote was created (milliseconds). Omitted when unset. |

:::note
Exactly one of `n` (notional) and `q` (requested quantity) is present per event. For a notional-sized RFQ, the eventual fill is `floor(notional ÷ winning price)` whole contracts; for a quantity-sized one it is `floor(requestedQuantity)`.
:::

The public stream emits RFQ-existence transitions: creation, cancellation, close, expiry, finalization, and failure. It does not emit the requester acceptance or maker confirmation transitions, and it never carries quote contents.

### Replay on reconnect

`requestForQuote` is an event stream, not a state snapshot. Auctions broadcast while you were disconnected are **not** replayed. Auctions are short-lived (the quoting window is carried in `w`), so treat a reconnect as starting fresh.

## `requestForQuote@account`

Private combo-RFQ deliveries for the authenticated account.

- **As a requester**: receive only the selected quote after your RFQ closes, followed by the winning maker's confirm/decline and the terminal outcome.
- **As a maker**: receive the requester's acceptance of your quote and the terminal outcome. Respond to `ACCEPTED` with [`rfq.confirm_quote`](/prediction-markets/combos-rfq/quote-methods#rfqconfirm_quote) immediately; the 1-second deadline starts with the `CONFIRMING` transition, not delivery processing.

The quoting window is sealed: quote submissions and withdrawals produce no customer delivery while the RFQ is `OPEN`. At close, the requester receives one `CLOSED` delivery containing only the selected quote. Losing quotes remain undisclosed, and the requester is not told which maker submitted the selected quote (it is keyed by `quoteId` only).

The service does not assign session-level or RFQ-level participant pseudonyms. `r` identifies the RFQ and `q` identifies either the requested quantity or a quote, depending on the stream; neither identifies a participant. Counterparty account identities are not disclosed through these streams, including after execution.

**Auth:** required, with the `view_orders` capability. See [Authentication](/prediction-markets/websocket/authentication). Mutually exclusive with `requestForQuote@session`.

### Message shape

```json
{
  "e": "requestForQuote",
  "i": "b16097e9-3d7f-5910-9820-eeedf51a8be3",
  "E": 1780000001000,
  "r": "01J9Z3K7Q2N8M4P6R8T0V2W4X6",
  "x": "CLOSED",
  "S": "PENDING_ACCEPTANCE",
  "q": "01J9Z2K7Q2N8M4P6R8T0V2W4X6",
  "p": "0.55",
  "sz": "100",
  "qs": "ACTIVE",
  "vu": 1780000060000
}
```

| Field | Type | Description |
|---|---|---|
| `e` | string | Event type — always `requestForQuote`. |
| `i` | string | Durable lifecycle-event UUID. Use it as an idempotency key when a transition is redelivered. |
| `E` | number | Event timestamp (milliseconds). |
| `r` | string | `rfqId` this delivery concerns. |
| `x` | string | Which customer-visible lifecycle transition this delivery reports (`CLOSED` / `ACCEPTED` / `CONFIRMED` / `DECLINED` / `FINALIZED` / `FAILED`). `CLOSED` privately discloses the selected quote to the requester. |
| `S` | string | Lifecycle state of the RFQ after this transition (same vocabulary as the public feed). |
| `q` | string | `quoteId` this delivery concerns; the requester accepts by this id. Absent on RFQ-level deliveries. |
| `p` | string | The quote's single-sided bid per contract. Absent on RFQ-level deliveries. |
| `sz` | string | Quote quantity in contracts. Absent on RFQ-level deliveries. |
| `qs` | string | Quote status (`ACTIVE` / `WITHDRAWN` / `EXPIRED` / `WON` / `LOST`). Absent on RFQ-level deliveries. |
| `vu` | number | Quote close-time eligibility deadline (milliseconds). A selected quote had `vu >= w`; when the maker omitted `validUntil`, `vu` equals `w`. It is not checked again after selection. Absent on RFQ-level deliveries. |

:::note Field keys `x` and `q` differ between the two streams
On the public `requestForQuote` feed, `x` is the numeric hard-expiry timestamp and `q` is the requested quantity in whole contracts. On the authenticated deliveries, `x` is the string transition name and `q` is the `quoteId`. Parse per stream.
:::

### Redelivery and deduplication

Authenticated lifecycle delivery is at least once. A transition can therefore arrive more than once, with the same `i`. Persist or otherwise deduplicate on `i`; do not use `E`, `r`, or `x` alone as the idempotency key.

## `requestForQuote@session`

Identical account-scoped deliveries to `requestForQuote@account`, provided for subscription symmetry with the order streams. It does not filter RFQ events to the session that opened or quoted the RFQ. Subscribe to one or the other, not both — they are mutually exclusive on a connection.

## Connection notes

- Same endpoint as all other Predictions streams: `wss://ws.gemini.com`.
- Same subscribe message shape and connection parameters as the [Introduction](/prediction-markets/websocket/introduction).
- The maker quote actions ride the same connection as request/response methods — see [Quote Methods](/prediction-markets/combos-rfq/quote-methods) and the general [Message Format](/prediction-markets/websocket/message-format).

## See also

- [Quote Methods](/prediction-markets/combos-rfq/quote-methods) — submit, withdraw, confirm.
- [Maker Integration](/prediction-markets/combos-rfq/maker-integration) — the full workflow tying streams and methods together.
- [Standard Stream Reference](/prediction-markets/websocket/streams) — order, position, and balance streams for the resulting trades.
