Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Rate limits

Limits are applied per client IP.

SurfaceLimit
POST /info50 requests per second
POST /exchange10 requests per second
WS /ws10 live connections
WS /api-ws10 live connections

The WebSocket limits are counted separately for each endpoint, by open connections rather than subscriptions. Each connection is multiplexed, so one /ws and one /api-ws socket can carry every channel you need.

When you exceed a limit

A rejected request is stopped at the gateway and never reaches the node. The HTTP status is 429 with a Retry-After header in seconds.

WhereResponse
POST /info{"success":false,"code":10000,"message":"rate limit exceeded"}
POST /exchange{"status":"err","code":<n>,"response":"rate limit exceeded"}
New WebSocket connection over the limitThe handshake fails with 429 and the plain-text body Too many websocket sessions from this IP
Frame on an open /ws connectionThe frame is dropped and the server replies {"type":"error","code":"RISK_RATE_LIMITED","message":"rate limit exceeded"}; the connection stays open
Frame on an open /api-ws connection{"channel":"error","data":{"code":"RISK_RATE_LIMITED","message":"rate limit exceeded"}}

Wait for Retry-After, then retry with exponential backoff. A rate-limited /exchange action did not execute, so it is safe to sign it again with a fresh nonce. Only when a request times out or its response is lost should you confirm with a read before resending.

Staying inside the limits

  • Stream instead of polling. Anything on a /ws channel — trades, positions, order updates — should come from the subscription, not a loop over /info.
  • Batch where the endpoint allows it. outcomeAssetCtxs takes a list of instruments; order and cancel take up to 50 and 200 entries per action.
  • Cache metadata. perpMeta and feeTierInfo change rarely; resolve ids once at startup.
  • Reuse connections. Open one socket per endpoint and subscribe to many channels on it, rather than one socket per channel. Keep each alive with a 10-second ping.