rfq_created to the last look.
Connect
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.rfq and executions events to every maker, and quotes events only to you.
Message format
Every message is a JSON text frame. Each message you send must be 64 KiB or smaller. A message you send has anonce 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
subscribe
Start getting channels' events
subscribe
Start getting channels' events
unsubscribe
Stop getting channels' events
unsubscribe
Stop getting channels' events
quote
Quote an open RFQ
quote
Quote an open RFQ
quoted. Needs a trading key.0.001 to 0.999. "0.45" means a $0.45 stake per $1.00 payout.quote_accepted. Leave it out if you don’t need one.rfqId and ack it with superseded.decline
Pass on an open RFQ
decline
Pass on an open RFQ
confirm
Answer the last look on a quote you won
confirm
Answer the last look on a quote you won
confirmed. Needs a trading key.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.rfq_created
An RFQ opened (rfq channel)
rfq_created
An RFQ opened (rfq channel)
rfq_closed
The auction closed (rfq channel)
rfq_closed
The auction closed (rfq channel)
quote_created
We recorded your quote (quotes channel)
quote_created
We recorded your quote (quotes channel)
quote_accepted
You won and must confirm (quotes channel)
quote_accepted
You won and must confirm (quotes channel)
quote_executed
Your quote filled (quotes channel)
quote_executed
Your quote filled (quotes channel)
quote_unfilled
Your confirmed quote won't fill (quotes channel)
quote_unfilled
Your confirmed quote won't fill (quotes channel)
quote_dropped
We passed over your quote (quotes channel)
quote_dropped
We passed over your quote (quotes channel)
executed
Any RFQ trade filled (executions channel)
executed
Any RFQ trade filled (executions channel)
ts on GET /rfq/v3/executions.41 to 44, means you missed some. Executions shows how to fill a gap.Acks
An ack confirms that we handled your message. It carries yournonce and one key that names what we did.
subscribed and unsubscribed
Your channels changed
subscribed and unsubscribed
Your channels changed
quoted
Your quote entered the auction
quoted
Your quote entered the auction
quote_created follows on quotes with your quoteId.superseded
You already quoted this RFQ
superseded
You already quoted this RFQ
declined
We recorded your decline
declined
We recorded your decline
confirmed
We recorded your last-look answer
confirmed
We recorded your last-look answer
quote_executed or quote_unfilled.Errors
We answer a message we can’t handle with an error.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
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
- A geolocation close carries the
451code as its reason, such asGEOLOCATION_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
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 fromGET /rfq/v3/executions.
Reconnect with backoff, then subscribe again.
