Connecting
Browsers cannot set headers on websocket upgrades, so authentication uses a short-lived ticket passed as a query parameter:1
Mint a ticket
POST /auth/ws-ticket from a session (ticket carries read), or
POST /auth/ws-ticket/signed with an HMAC-signed request (ticket carries the
key’s scopes). Both streams require read.2
Connect within 30 seconds
401, and a ticket without read gets 403, before the socket opens.Subscribing
/ws/user needs no subscription: it streams your events as soon as the socket
opens.
On /ws/rfq, send one handshake frame right after connecting, listing up to 500
distinct markets:
request_id. A bad handshake gets a plain-text error and the connection
closes.
Event frames
Every event has the same envelope:/ws/rfq sends nothing when a request is cancelled or matched, and quoting one
returns 409. Ignore unknown event_kind values, since new kinds may be added.
Reconnecting
There is no resume token, and the server drops connections that fall too far behind. On disconnect:- Mint a new ticket.
- Reconnect and handshake again. Rebuild your state from the new snapshot.
/ws/userdoes not replay missed events. Catch up through/rfq/quote,/rfq/matches, and/custody/get-ledger.