Skip to main content
Your maker prices RFQs over one websocket. You keep one connection open. We push each RFQ to you, and you quote, decline, and confirm on the same connection. Overview walks through a round, from rfq_created to the last look.

Connect

Sign the upgrade request like any route. Connection shows how a signed upgrade works. The key’s subaccount must be a maker to open the socket. A trading::read key can connect and read. To quote, decline, or confirm, use a trading key. Open no more than 10 sockets per key. Close one before you open another. Two upgrade errors are specific to this socket.

Channels

A channel is a stream of events you subscribe to. There are three. We send rfq and executions events to every maker, and quotes events only to you.
Subscribe to rfq and quotes to trade. Without quotes you never see quote_accepted, so we reject every trade you win.

Message format

Every message is a JSON text frame. Each message you send must be 64 KiB or smaller. A message you send has a nonce and one method, named as a key beside it. The nonce is a whole number you choose, from 0 up. We echo it on our reply, so use a new one for each message. We answer every message you send with one ack or one error. Every event we send carries type and ts, when the event happened in Unix milliseconds. ts isn’t when we sent the frame, so a delayed event carries an older ts. Branch on type, because we may add new ones. We send decimal amounts like price, maxWager, and wager as JSON strings. Send yours as strings too.

Messages you send

We ack with subscribed.
array of strings
required
Any of "rfq", "quotes", and "executions".
We ack with unsubscribed.
array of strings
required
The channels to drop.
We ack with quoted. Needs a trading key.
UUID string
required
The RFQ, from rfq_created.
decimal string
required
The probability the parlay wins, from 0.001 to 0.999. "0.45" means a $0.45 stake per $1.00 payout.
decimal string
required
The largest stake this quote covers, in dollars. It must be above zero.
UUID string
Your own ID for the quote. We return it on quote_accepted. Leave it out if you don’t need one.
You get one quote per RFQ, and your first quote stands. We ignore a second quote for the same rfqId and ack it with superseded.
We ack with declined. Needs a trading key.
UUID string
required
The RFQ, from rfq_created.
Declining is optional. An RFQ you don’t answer closes on its own.
We ack with confirmed. Needs a trading key.
UUID string
required
The RFQ, from quote_accepted.
UUID string
required
Our ID for your quote, from quote_accepted. It’s not your clientId.
boolean
required
true fills the trade at your quoted price. false rejects it.
You have 1 second, and silence rejects the trade. A late answer, or a dropped connection before you answer, rejects it just as false does.
Your first answer counts. A second answer gets CONFIRM_ALREADY_DECIDED, or NO_CONFIRM_WINDOW once the window has closed. Every rejected or missed last look counts against your confirm rate.

Events we send

You get a channel’s events after you subscribe to it.
Send your quote or decline before expiresTs.
UUID string
required
The RFQ. Send it on every message about this RFQ.
array of UUID strings
required
The legs. See Universe model to look each one up.
integer
required
When the auction closes, in Unix milliseconds. It’s 3 seconds after the RFQ opened.
decimal string
required
The smallest stake a quote must cover: the user’s minimum or $10.00, whichever is higher. We pass over a quote whose maxWager is below it.
Stop pricing the RFQ. A quote that arrives after this gets RFQ_CLOSED.
UUID string
required
The RFQ that closed.
UUID string
required
Our ID for your quote. quote_accepted and confirm use it.
Send confirm within 1 second.
decimal string
required
The user’s actual stake.
decimal string
required
Your quoted price.
UUID string
The clientId you sent on quote, or null.
integer
required
When the trade filled, in Unix milliseconds.
string
required
taker_insolvent: the user couldn’t cover the stake. maker_insolvent: your subaccount couldn’t cover the collateral. both_insolvent: neither could.
string
required
below_min_wager: maxWager was below minWager, which we include. unbacked: your balance couldn’t cover requiredCollateral, which we include. own_rfq: the RFQ is your own. declined_recently: you rejected or missed a last look on these legs in the past 2 minutes.
integer
required
When the trade filled, in Unix milliseconds. For your own fills, it matches ts on GET /rfq/v3/executions.
integer
required
Goes up by one per execution. A jump, like 41 to 44, means you missed some. Executions shows how to fill a gap.
decimal string
required
The user’s stake.
decimal string
required
The execution price. It never says which maker won.

Acks

An ack confirms that we handled your message. It carries your nonce and one key that names what we did.
array of strings
The channels you added. unsubscribed lists the ones you dropped.
quote_created follows on quotes with your quoteId.
Your first quote stands, and we ignored this one.
It means we recorded your answer, not that the trade filled. Watch for quote_executed or quote_unfilled.

Errors

We answer a message we can’t handle with an error.
string
required
A stable code. Match on this, not on message.
string
required
A readable description. It can change.
integer
The nonce of the message that failed. We leave it out when we can’t parse your message.
Makers explains KYC_REQUIRED and SELF_EXCLUDED. An error never closes the connection. Handle it and keep trading. Don’t reconnect because of an error.

Timing and limits

We drop only event frames when your queue is full. We never drop acks or errors.

Keep the connection alive

We send a websocket Ping every 15 s. Answer with a Pong. Most clients do this for you. If no Pong arrives before our next Ping, we close the connection. There’s no JSON ping message and no idle timeout. A connection that answers every Ping stays open, unless a check closes it.

Why the socket closes

We check each open socket again about every 15 minutes. If its key was revoked or has expired, or your account’s location is no longer allowed, we close it.
  • A geolocation close carries the 451 code as its reason, such as GEOLOCATION_OUT_OF_BOUNDARY.
  • We check geolocation only for accounts that must share their location.
  • A geolocation that’s only out of date, GEOLOCATION_EXPIRED, doesn’t close the socket.

Reconnect

Subscribe again after every reconnect. Subscriptions belong to the connection, so a new one gets no events until you subscribe.
We don’t replay events. A new connection starts at the live edge, so you lose anything we sent while you were away. Get missed executions from GET /rfq/v3/executions. Reconnect with backoff, then subscribe again.