sdk.rfq covers RFQ (block trades): a taker requests quotes for a size, makers quote privately, the taker accepts one side of the aggregated view, and the selected makers get a 250 ms last look. Every call is signed. Every write takes an optional idempotencyKey (1–64 letters, digits or . _ : -); the SDK generates one when you omit it, and a retry with the same key and body returns the first result.
RFQ is available only to accounts it is enabled for; other calls fail with RFQ_DISABLED.
Following the view
Follow the taker’s view on theRfqView pushes rather than polling getRfq. waitForRfqView(sdk, rfqId, predicate, options?) does that, matching rfqId in any letter case: it resolves with the first view that satisfies predicate, keeping the push with the highest sequence, and calls getRfq only where a push may have been missed:
- once at the start, since pushes sent before it subscribed (makers can quote before
createRfqreturns) are not replayed; - once after every reconnect;
- repeatedly, from 250 ms backing off to 2 s, while the socket is down or the
rfqsubscription is not confirmed; - once when
timeoutMspasses.
It resolves with
{ view, source }, where source is "push", "read" or "initial". It rejects with an InvalidStateError when no view matched by the timeout or when an RfqOutcome push says the RFQ ended. When quotes change quickly, views in between may be skipped, but the last view pushed always reflects the latest change, so a predicate on the latest state is always seen.
Pushes
New RFQs and last-look prompts arrive only on the authenticatedrfq WebSocket channel; there is no call that lists open RFQs to quote. Narrow on eventType:
getRfq. Keep the rfq connection open while you have quotes resting: see Disconnects.
