Skip to main content
Two streams complement the REST API. Event frames are JSON text.

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

Use a new ticket for each connection attempt. An invalid or expired ticket gets 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:
The server replies with a snapshot frame of each market’s open requests, oldest first:
Then it streams events. Early events can repeat requests from the snapshot, so dedupe on 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:
  1. Mint a new ticket.
  2. Reconnect and handshake again. Rebuild your state from the new snapshot.
  3. /ws/user does not replay missed events. Catch up through /rfq/quote, /rfq/matches, and /custody/get-ledger.