Rate limits
Limits are applied per client IP.
| Surface | Limit |
|---|---|
POST /info | 50 requests per second |
POST /exchange | 10 requests per second |
WS /ws | 10 live connections |
WS /api-ws | 10 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.
| Where | Response |
|---|---|
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 limit | The handshake fails with 429 and the plain-text body Too many websocket sessions from this IP |
Frame on an open /ws connection | The 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
/wschannel — trades, positions, order updates — should come from the subscription, not a loop over/info. - Batch where the endpoint allows it.
outcomeAssetCtxstakes a list of instruments;orderandcanceltake up to 50 and 200 entries per action. - Cache metadata.
perpMetaandfeeTierInfochange 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.