Subscribe
sid) and rejected items:
user_activity lives on /ws/user; the four public
channels live on /ws/market. A subscribe with a mix like the one
above runs on TWO separate WebSocket connections, not one.
Normalization rules
- All addresses lowercased.
tokenIdis decimal-string form (no leading zeroes).conditionIdis lowercased 32-byte hex.- Duplicate ids removed.
Rejection codes
A subscription that fails validation comes back underrejected[]:
| Code | When |
|---|---|
unknown_channel | channel name not in the catalog |
forbidden | wrong gateway (public channel on /ws/user or user_activity on /ws/market) |
api_key_scope_missing | key is missing a scope required by the channel (e.g. user_activity needs portfolio:read) |
invalid | malformed id (bad hex, bad address, missing required ids) |
Per-channel reference
user_activity — own orders / trades / account-control
- Gateway:
/ws/user ids: not allowed (always scoped to the key’s associated wallet)- Required scope:
portfolio:read
token_trades — public trade tape
- Gateway:
/ws/market ids: one or more outcometokenIds (decimal-string)
token_book — public orderbook snapshots + deltas
- Gateway:
/ws/market ids: one or more outcometokenIds
book_snapshot immediately after subscribe, then
book_delta events with monotonically increasing seq. See
Reconnect for resync rules.
condition_status — market-level lifecycle
- Gateway:
/ws/market ids: one or moreconditionIds (lowercased bytes32 hex)
system — platform-wide status
- Gateway:
/ws/market ids: must be["platform_status"]
Update existing subscription
For id-based channels (token_trades, token_book,
condition_status, system) you can change ids on an existing sid
instead of opening a new subscription.
Add ids
Remove ids
update_subscription is rejected with invalid_params for channels
that don’t take ids (e.g. user_activity).
Unsubscribe
List subscriptions
Ping
ts is the server clock in milliseconds — clients can use it as a
clock-skew probe.