Skip to navigation

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-data opens this WebSocket only, and one created for trading is 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_PENDING with Retry-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-tickets answers 429 RATE_LIMITED with Retry-After.
  • POST /ws-tickets answers 503 TICKETS_UNAVAILABLE when 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

ParameterTypeRequiredDescription
streamstringYesThe WebSocket stream the ticket opens: trading (the trading WebSocket) or market-data (the market-data WebSocket). One of trading, market-data.

Response parameters

ParameterTypeRequiredDescription
ticketstringYesOpaque and URL-safe as served: put it in the WebSocket URL as ?ticket= unchanged, and never parse it. It opens one session, once.
expiresAtNsstringYesWhen the ticket stops opening sessions, in epoch nanoseconds: the ticket’s lifetime, or your token’s expiry if that comes first (an API key states none, so its ticket runs the whole lifetime). Open the WebSocket before then, or create another ticket.
streamstringYesThe stream the ticket opens, as the request named it. One of trading, market-data.

Refusals

StatusDescription
400Refused at the door — nothing reached the platform and the key was not journaled: a missing or malformed Idempotency-Key, a malformed If-Match (an absent one is 428 PRECONDITION_REQUIRED), malformed JSON, a body actor (or userId, its spelling before the actor), a body restating the path or If-Match differently, a money string off its pattern (an exponent, a plus sign, a bare point, surrounding whitespace) or past its maxLength, or one no value here can state (over 18 fractional digits, or past a 64-bit integer at its own scale), or any other value outside the schema.
401No bearer token, or one that does not verify.
403CAPABILITY_DENIED: a read your capabilities do not cover, or a staging route without its propose bit (accounts:propose). NOT_REGISTERED: no row or open invitation at your verified address, an unknown organisation, or an unclaimed row (an administrator admits it). EMAIL_UNVERIFIED: verify, then sign in again. INVITATION_EXPIRED: an administrator re-invites. FORBIDDEN_PRINCIPAL: no org_id, a non-ASCII ref, a disabled user, a binding with no user. ORG_NOT_ACTIVE: disabled, pending or deleted. Owners’ 403s carry the position header and Idempotent-Replay.
429Shed at once: INBOX_FULL or IN_FLIGHT_FULL (this member’s bounds; nothing queued, the key not journaled), the intake’s or the ticket route’s RATE_LIMITED, or the orders owner’s RATE_CEILING (the organisation’s per-minute ceiling — a refusal on the stream, replayed like any, so its retryable is false and the order goes again under a fresh key). Retry-After says when.
503This member cannot mint tickets now: NOT_PRIMED — it is still catching up; retry shortly — PROJECTION_BEHIND — behind your minGlobalSequence; retry after Retry-After — or TICKETS_UNAVAILABLE — it holds no ticket signing key, so a retry here changes nothing: a browser cannot open a WebSocket through this member until it serves tickets, and any other client sends its bearer token on the WebSocket handshake instead.

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.

ParameterTypeRequiredDescription
eventstringYessessionOpened
msgTypestringYessessionOpened
dataobjectYes
> expiresAtNsstringYesThe expiry of the access token behind the session (for a ticket, of the token it was created from), epoch nanoseconds as a decimal string; “0” when there is no such expiry.