id— client-side correlation id; echoed in the response.cmd— one ofsubscribe/update_subscription/unsubscribe/list_subscriptions/ping.params— command-specific payload (omitted forpingandlist_subscriptions).
sid (numeric).
Use sid for subsequent updates / unsubscribes and to route incoming
events. sids are not stable across reconnects.
subscribe
On /ws/user:
/ws/market:
Normalization rules
- All addresses lowercased.
tokenIdis decimal-string with no leading zeroes.conditionIdis lowercased 32-byte hex.- Duplicate ids removed.
Rejection codes
code | When |
|---|---|
invalid_params | unknown channel, malformed id (bad hex, bad address), missing required ids, or user_activity sent with ids |
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) |
update_subscription
Modify the id list of an existing id-based subscription instead of
opening a new one. Not allowed on user_activity (no ids).
Add ids
Remove ids
update_subscription on user_activity is rejected with
invalid_params.
unsubscribe
sids are silently ignored (idempotent — the response only
lists sids that were actually removed).
list_subscriptions
ping
ts is the server clock in milliseconds — clients can use it as a
clock-skew probe.
There is no application-level idle timeout, but production clients
should still send a ping every 20–30 s to defeat intermediate
proxies / load balancers that close idle TCP connections.