Skip to main content
Market-data gateway. Use for the public trade tape (matcher + chain settlements), orderbook snapshots + deltas, OHLC candles, the live probability chart, market lifecycle, underlying crypto prices, and platform-wide firehoses and trade feed. Trying to subscribe to a private channel (user_orders, user_fills, vault_positions) on this gateway returns { "code": "forbidden" } in the rejected[] array — use /ws/user for own-activity streams.

Authentication

Same X-Api-Key scheme as the rest of the API — no separate auth scheme for market data: Market channels do not require any specific scope — any active key can subscribe. An invalid key is rejected at handshake with 4401 <reason> (same close-code matrix as /ws/user); an invalid or expired bearer token closes with 1008 unauthorized. Supplying credentials commits the handshake to that path: a bad credential never falls back to an anonymous session. Revoking a key, editing its scopes or suspending the partner immediately closes every live socket bound to that keyId with the retryable 4409 api_key_changed; reconnect, and the handshake either admits the key or refuses it with the precise 4401 <reason>. A request that supplies no credentials at all connects anonymously — the greeting reports "authMethod": "anon" — and may subscribe to every public channel on this gateway. Where the gateway enforces an origin allowlist, an anonymous upgrade must carry an allowed Origin header or it is closed with 1008 forbidden origin, while a key-authenticated upgrade may omit Origin. Use a key anyway when you have one, so the session is attributed to your partner account (partnerId in the greeting). The per-connection limits (resource limits) are the same either way.

Connect greeting

partnerId is the platform-side partner-record id corresponding to your API key. Useful for correlating WS sessions to your own audit trail without a separate REST call. Absent on JWT-authenticated sockets (retail web-app sessions).

Available channels

See Server events for full payload shapes per type.
Live status: token_trade_matches, token_trade_settlements, token_book, token_ohlc, market_price_tick, market_lifecycle, crypto_price_tick, the all_* channels and global_activity push reliably today; market_price_tick only sends when a price input changes, so a quiet market is silent. condition_lifecycle carries only the on-chain trading pause / unpause of a condition, so it is usually silent; follow status and resolution on market_lifecycle. system accepts subscribes, but no platform_status frames are published yet; poll GET /api/platform/status (partner API key; see Live status) for the freeze flag.
crypto_price_tick is keyed by instrument, not market symbol — one subscription per coin serves every crypto market on that asset. See Crypto price feeds.
Firehoses. all_trade_matches, all_trade_settlements, all_books and global_activity take no ids and carry every market on the platform. all_books in particular sends a full-depth book_update plus a book_delta for every book change; a client that can’t keep up is disconnected once its outbound buffer fills (resource limits). Token channels accept explicit token ids only — there is no * wildcard — and a connection that holds both token_book and all_books receives each frame once per sid. For an activity feed, global_activity sends one frame per trade instead of the two all_trade_matches sends for a binary trade.

tokenId and conditionId come from REST

Subscribe by on-chain native ids, never by app symbol.
Neg-risk (multi-outcome) events are listed as one market per question, and each question market carries its own conditionId, yesTokenId and noTokenId (also under outcomes[].tokenId) — subscribe with those. To go the other way, GET /api/markets/by-token/{id} and GET /api/markets/by-condition/{id} resolve a token or condition id back to its market.

Subscribe example

Subscribe response

Ids are normalized before the ack: market symbols (also inside market_price_tick ids) and crypto instrument ids come back lower-cased, so BTC-USD and btc-usd resolve to the same feed. The channels that take no ids (all_*, global_activity) are acknowledged without an ids field — { "sid": 19, "channel": "all_books" }.

Rejection codes

Market liquidity gate (RND-1798)

When enabled, OPEN markets whose orderbooks lack sufficient depth are hidden from non-market-maker viewers until quoted by an MM desk:
  • Non-MM sessions (anonymous or retail API keys): subscribe, add_ids, or get_book_snapshot naming a hidden market’s token id, symbol, or condition id is rejected with code market_unavailable. Real-time event broadcasts for hidden markets are withheld.
  • Market makers: API keys associated with a registered market-maker wallet retain full real-time access.
  • Session transitions: Within about 90 s of being designated a market maker (a 30 s re-check over a market-maker answer cached for up to 60 s), a session that was earlier refused market_unavailable is closed with code 4409 and reason market_access_changed so it reconnects and resubscribes; other sessions gain access without a close.

Markets hidden from the public (RND-3886)

A market that the platform has hidden from the public is answered on /ws/market exactly like an id that names no market, for every session, market makers and API keys included. Its token id, condition id or symbol (also inside a market_price_tick id) is accepted in the subscribe ack, with no rejection code, but the subscription receives no token_meta, a book_snapshot_failed instead of a book_snapshot (also on get_book_snapshot), and no live frame of that market on any channel, including all_* and global_activity. The list of hidden markets is re-read about every 15 seconds, so a market that is revealed is served within that interval; resubscribe to get its initial state.

Commands

update_subscription / unsubscribe / list_subscriptions / ping.

Server events

Full event payload catalog per channel.