Authentication
URL wss://marketdata.immix.xyz/
Credentials
ticket
Sent as query parameter ticket
The browser’s credential. A browser cannot send an Authorization header on the
WebSocket handshake, so it first exchanges its bearer token for a ticket with the REST
API’s POST /ws-tickets ({"stream": "market-data"}, answered
{"ticket", "expiresAtNs", "stream"}), then opens the WebSocket with ?ticket=<ticket>
on its URL, the ticket unchanged: it is URL-safe as served. One of the two schemes,
never both.
- One ticket, one session, soon. A ticket opens one session, once, and only before
expiresAtNs: 10 seconds after it is created by default, or your token’s expiry if that comes first. Create a new ticket for every connection attempt, a reconnect included; a ticket you used, or one refused at the handshake, opens nothing. - One stream. A ticket created for
market-dataopens this WebSocket only, and one created fortradingis refused here (401 — to a browser, a failed handshake like any other). Both streams draw on the same budget when you create them. - It is a credential. It carries your identity, so treat it like your token: the
answer that carries it is
Cache-Control: no-store, and nothing should log the ticket or the URL that carries it. - Creating one is admitted like any other REST call. A token that does not verify
is 401 and a user the platform refuses 403, so a refused user never gets a ticket —
and, unlike a refused handshake, a browser can read why: stop on either. A token with
no expiry cannot create one (401). A first sign-in that is still claiming its
invitation is answered 503
REGISTRATION_PENDINGwithRetry-After: the same request succeeds once the claim lands. - Creating one is limited to 60 a minute per user, across both streams. Past it,
POST /ws-ticketsanswers 429RATE_LIMITEDwithRetry-After. POST /ws-ticketsanswers 503TICKETS_UNAVAILABLEwhen the REST API member you reached holds no ticket signing key, so a retry there changes nothing — unlike the handshake’s 503, which is retried. A browser cannot open this socket until the REST API serves tickets; any other client sends its bearer token on the handshake instead.
bearer
Sent as header Authorization: Bearer … (JWT)
Every other client’s credential: the access token as Authorization: Bearer … on the handshake, stating an expiry. One of the two schemes, never both.
Create a WebSocket ticket
REST API POST /ws-tickets
Exchanges your bearer for a ticket that opens one WebSocket stream once — trading or market-data, as the body names it; the other refuses it. An API key’s opens trading alone (403 FORBIDDEN_PRINCIPAL). Pass it as ?ticket= on that URL before expiresAtNs. It carries your identity and never outlives a token; never cache or log it. No Idempotency-Key: every call mints a new one.
Request parameters
Response parameters
Refusals
The session is open and authenticated
The first frame of every session, sent before the client says anything. The session was authenticated on its handshake, so there is no auth to answer: subscribe straight away. expiresAtNs is when the access token behind the session expires — a bearer token’s own expiry, or for a ticket the expiry of the token it was created from, never the ticket’s own short expiresAtNs. This stream does not close the session then, so it is information, not a deadline.