Skip to main content
Reference documentation for WebSocket connection limits, request limits, timeout behavior, and error codes.
Rate limits per account: 1000 new WebSocket connections per minute, 10000 order placements and 12000 other JSON-RPC requests per 10 seconds. The main account and all its sub-accounts share these limits across every connection. Per IP address, WebSocket requests are limited to 12000 per 10 seconds.

Connection and request limits

Limit WebSocket connection creation to 1000 new connections per minute per account. Order placements — the *_place methods on Order Management — count against a budget of 10000 requests per 10 seconds per account. Every other JSON-RPC request — subscriptions, one-time queries, order cancellations and modifications, authorize, ping — counts against a separate budget of 12000 requests per 10 seconds per account.

Account scope

Both request budgets are counted per account, not per connection, and the connection limit is counted per account too. New connections and requests from the main account and from every sub-account count together against the same limits. Opening an additional connection does not raise either request budget. The limit of 12000 requests per 10 seconds per IP address applies in addition to the account limits. Reuse a single WebSocket connection for multiple subscriptions. Opening a new connection per channel consumes the connection limit and increases latency.

Subscription limits

The request above counts as one message regardless of the number of markets in params.
Repeating a subscription replaces the previous one for the same channel. To track additional markets on an active channel, send a new subscribe request with the full target list — the server does not merge incremental subscribes. The Order Book Depth channel accepts a multiple subscription flag that adds a market to the existing subscriptions.

Market Trades subscriptions

When subscribing to specific markets via trades_subscribe, the server sends a snapshot of recent trades for each market. With a large market list, the snapshot volume can exceed what the client reads in time, and the connection is dropped. Pass no more than 100 markets in a single trades_subscribe request. Each new trades_subscribe request replaces the existing subscription on the connection, so to track more than 100 specific markets, use separate connections. To subscribe to all markets, send trades_subscribe with an empty params array. No snapshots are sent in this mode, and newly listed markets are included automatically. Filter the required markets on the client side.

Rate limit handling

Implement request throttling on the client side. Apply the throttle across all connections and sub-accounts of the account, because the request budgets are shared and a per-connection throttle does not keep the account within the budgets. Queue subscription requests instead of sending bursts of requests. Apply exponential backoff with jitter when the server rejects requests because a limit is exceeded. A request rejected by the order-placement budget returns error code 10001, and a request rejected by the budget for other requests returns error code 10000. Reuse active connections instead of creating new connections.

Rate limit error example

Connection timeout

The server closes the WebSocket connection after 60 seconds of inactivity. Inactivity means no messages sent by the client. Send a ping request every 50 seconds to keep the connection alive:
Expected response:
Code example:
JavaScript

Error codes

The server returns errors in the error field of a response message. The error object contains a code and a message. The server returns code 6 when a client invokes a protected method — a private-channel subscription or a balance query, for example — without first calling authorize on the connection. Send an authorize request before any private-channel subscription. See WebSocket Authentication for the authorization flow. Error response format:
The server closes the WebSocket connection immediately if the client sends invalid JSON.

Best practices

Reuse connections. Each subscription does not require a new connection. Subscribe to multiple channels on a single connection to stay within the 1,000 connections per minute limit. Implement reconnection logic. Handle unexpected disconnections with exponential backoff (for example, wait 1s, 2s, 4s, 8s between retries). Re-subscribe to all channels and re-authorize private channels after reconnecting. Batch subscriptions. Subscribe to all required channels immediately after connecting rather than one at a time. Batching reduces round-trips and keeps connection setup well inside the 12000 requests per 10 seconds budget. Monitor ping latency. A slow or missing pong response indicates network issues. Reconnect if the server does not return pong within 10 seconds after a ping.

Used in these guides