GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
  • SDKs & Tools
Changelog
Gemini Crypto Exchange LogoGemini Crypto Exchange Logo

© 2026 Gemini Space Station, Inc.

Overview
TypeScript SDK
    QuickstartAuthenticationWebSocketError HandlingPatterns & Recipes
    API Reference
    Deep Dives
      Order Book ReconstructionRFQ ProtocolData TypesRequest ValidationWebSocket SessionsTransport & Signing
Deep Dives

Deep Dive — RFQ Protocol

Request-for-Quote (RFQ) lets makers respond to quote requests over WebSocket. The SDK exposes the public RFQ event stream, the private delivery stream, and the three maker quote methods.

Public discovery (rfqs() stream) works from both browser and server entry points — no authentication required. Quote submission, confirmation, and withdrawal are authenticated WebSocket operations that require the server entry point.

The flow

  1. A taker submits a request for quote. It appears on the public rfqs stream.
  2. A maker submits a quote in response (rfq.submitQuote).
  3. The taker confirms or rejects. The maker sees the outcome on the private rfqDeliveries stream.
  4. The maker confirms the fill (rfq.confirmQuote) or withdraws a live quote (rfq.withdrawQuote).

Watching for requests

The public rfqs stream emits RfqPublicEvent messages:

Code
const rfqs = client.websocket.rfqs(); rfqs.on("message", (event) => { // event.r — RFQ ID // event.l — legs (RfqLeg[]): each has c (contract) and o (side) // event.S — lifecycle state // event.q — quantity (optional) // event.s — symbol (optional) console.log("RFQ", event.r, "state", event.S); }); await rfqs.ready;

Submitting a quote

Code
const quote = await client.websocket.rfq.submitQuote({ rfqId: event.r, price: "0.65", // decimal string quantity: "100", // decimal string validUntil: 1710547200000n, // optional, millisecond timestamp (bigint) }); // quote: RfqSubmitQuoteResponse

RfqSubmitQuoteParams:

FieldTypeRequiredMeaning
rfqIdstringYesThe RFQ being quoted
pricestringYesQuote price (decimal string)
quantitystringYesQuote quantity (decimal string)
validUntilnumber | bigintNoExpiry (millisecond timestamp)

Confirming a quote

Code
await client.websocket.rfq.confirmQuote({ rfqId: event.r, quoteId: quote.quoteId, confirm: true, });

RfqConfirmQuoteParams:

FieldTypeRequiredMeaning
rfqIdstringYesThe RFQ
quoteIdstringYesThe quote being confirmed
confirmbooleanYestrue to confirm, false to reject

Withdrawing a quote

Code
await client.websocket.rfq.withdrawQuote({ rfqId: event.r, quoteId: quote.quoteId, });

RfqWithdrawQuoteParams:

FieldTypeRequiredMeaning
rfqIdstringYesThe RFQ
quoteIdstringYesThe quote to withdraw

Private delivery stream

The authenticated rfqDeliveries stream emits RfqPrivateDelivery messages — the private outcome of your quotes:

Code
const deliveries = client.websocket.rfqDeliveries({ scope: "account" }); deliveries.on("message", (delivery) => { // delivery.i — delivery ID // delivery.r — RFQ ID // delivery.S — lifecycle state // delivery.qs — quote status (optional) // delivery.p — price (optional) // delivery.sz — size (optional) console.log("Delivery", delivery.i, "state", delivery.S); });

rfqDeliveries takes a scope ("account" or "session"), like the orders stream.

Combos

RFQ often targets multi-leg combos. Create a combo instrument via REST before quoting:

Code
const combo = await client.predictions.createCombo({ /* legs */ }); const lookup = await client.predictions.getComboByInstrumentSymbol({ instrumentSymbol: combo.instrumentSymbol, });

See the Combos Reference for combo operations.

What's next

  • WebSocket Reference — RFQ type signatures
  • Data Types — decimal strings and bigint timestamps
Last modified on August 14, 2026
Order Book ReconstructionData Types
On this page
  • The flow
  • Watching for requests
  • Submitting a quote
  • Confirming a quote
  • Withdrawing a quote
  • Private delivery stream
  • Combos
  • What's next
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript