user_activity)
on this gateway returns { "code": "forbidden" } in the rejected[]
array — use /ws/market for
own-activity streams.
Authentication
SameX-Api-Key scheme as the rest of the API — no separate auth
scheme for market data:
| How to send it |
|---|
X-Api-Key: ps_live_<keyId>_<secret> header on the upgrade request |
?key=<token> query parameter — for browser clients that can’t set custom headers on the WebSocket upgrade |
4401 <reason> (same close-code matrix as
/ws/user). Revoking a
key closes every live socket bound to that keyId immediately via
Redis pub/sub.
Connect greeting
Available channels
| Channel | ids shape | Server pushes |
|---|---|---|
token_trades | one or more tokenId (decimal string) | trade per public fill |
token_book | one or more tokenId (decimal string) | book_snapshot once on subscribe, then book_delta (see status note below) |
condition_status | one or more conditionId (lowercased bytes32 hex) | market_paused / market_unpaused / market_resolved / market_status |
system | must be ["platform_status"] | platform_status (frozen / maintenance banner) |
type.
Live status:
token_trades + system push reliably today.
condition_status accepts subscribes but has no upstream emitter
yet. token_book accepts subscribes but neither book_snapshot nor
book_delta is pushed currently — a backend fix is planned to wire
the matcher → gateway pipeline. Until then, fall back to
GET /api/markets/{symbol}/orderbook for snapshots.tokenId and conditionId come from REST
Subscribe by on-chain native ids, never by app symbol.
conditionId; resolve outcome token ids through the on-chain
NegRiskAdapter before subscribing.
Subscribe example
Subscribe response
Rejection codes
code | When |
|---|---|
invalid_params | unknown channel, malformed tokenId / conditionId, missing required ids, or system ids not ["platform_status"] |
forbidden | tried a private channel (user_activity) on this gateway |
Related
Commands
update_subscription / unsubscribe / list_subscriptions / ping.
Server events
Full event payload catalog per channel.