Limits
These are the current defaults. They may change, so don’t hard-code them where you can avoid it.
What counts as a message: every frame you send counts toward the 20-per-second limit, including
{"op":"ping"}, unsubscribe and frames the server rejects as invalid. When you resubscribe after a reconnect, pace your subscribe messages.
Subscription weight
Each subscription costs as many slots as the number of things it follows. The total across one connection must stay at or below 100.
For example, one
token-details subscription with 60 tokens plus 40 fast-trade subscriptions uses the full 100. Duplicate addresses in a list are removed and count once. The 100-item list maximum is checked before duplicates are removed.
Connection rejected at upgrade
These are plain HTTP responses to the WebSocket handshake. No WebSocket frames are sent.Close codes
The protocol also defines
1000 (normal) and 1008 (policy violation). The server does not currently send them.
Planned restarts
When a server instance shuts down:- Every connection receives
{"type":"reconnect"}. - Connections are then closed with
1012one by one, spread over about 20 seconds. - New connection attempts to that instance get HTTP
503during this time.
Error codes
Errors are sent aserror messages and never close the connection. The id field tells you which subscription failed. Errors about the message envelope itself have no id.
/v1/ws can send today:
Notes:
- Address validation messages are
must be a valid token or wallet addressfortokenandtokens, andmust be a valid token address or pool idforpoolandpools. - Other validation wording, such as for missing fields or out-of-range numbers, comes from the schema library and may change. Match on
codeanddetails[].field, not on message text. - Only
ohlcvchecks that a token or pool exists. The other channels accept any well-formed address, and an address that never trades simply produces no events. - After any subscribe error except
DUPLICATE_SUBSCRIPTION, theidis free and you can retry with it.
Recommended reactions
The protocol’s error code list also includes
ASSET_NOT_FOUND, UNAUTHORIZED, FORBIDDEN, RATE_LIMITED and SERVICE_UNAVAILABLE, shared with the REST API. /v1/ws does not send them today. Rate limiting on WebSockets is enforced with close code 4029, not with an error message.