Skip to main content

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.
If you need more, open another connection.

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:
  1. Every connection receives {"type":"reconnect"}.
  2. Connections are then closed with 1012 one by one, spread over about 20 seconds.
  3. New connection attempts to that instance get HTTP 503 during this time.
Your subscriptions are removed when the connection closes. Open a new connection and resubscribe with your stored cursors. See the reconnect loop.

Error codes

Errors are sent as error messages and never close the connection. The id field tells you which subscription failed. Errors about the message envelope itself have no id.
Every error code that /v1/ws can send today: Notes:
  • Address validation messages are must be a valid token or wallet address for token and tokens, and must be a valid token address or pool id for pool and pools.
  • Other validation wording, such as for missing fields or out-of-range numbers, comes from the schema library and may change. Match on code and details[].field, not on message text.
  • Only ohlcv checks 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, the id is free and you can retry with it.
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.