Every client → server message uses the same envelope on both gateways:Documentation Index
Fetch the complete documentation index at: https://docs.adipredictstreet.com/llms.txt
Use this file to discover all available pages before exploring further.
id— client-side correlation id; echoed in the response.cmd— one ofsubscribe/update_subscription/unsubscribe/list_subscriptions/get_book_snapshot/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, missing required ids, or wallet-scoped channel (user_orders / user_fills) sent with ids |
forbidden | wrong gateway (public channel on /ws/user or private channel on /ws/market); also raised when vault_positions ids aren’t covered by the API key’s associated_vault row |
api_key_scope_missing | key is missing a scope required by the channel (private channels need portfolio:read) |
subscription_cap_exceeded | this connection already holds the maximum subscriptions (256); existing subscriptions are not evicted |
subscription_too_many_ids | a single subscription / add_ids call exceeded the per-channel id cap (100). Message: "subscription accepts at most 100 ids". Split your ids across multiple subscriptions on the same connection. |
update_subscription
Modify the id list of an existing id-based subscription instead of
opening a new one. Not allowed on subscription-less channels
(user_orders, user_fills).
Add ids
Remove ids
update_subscription on a subscription-less channel is rejected with
invalid_params.
get_book_snapshot
Force a fresh full-depth book_snapshot on a token_book
subscription without unsubscribing / resubscribing. Use on a sequence
gap (book_delta.prevSeq != lastSeq) or after a long pause.
By sid:
book_snapshot per resolved subscription, OR one
book_snapshot_failed per token if the snapshot fetch couldn’t
complete:
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.