Limits
Connection Limits
| Limit | Value |
|---|---|
| Connections per user | 10 |
| Subscriptions per connection | 100 |
| Message size | 64 KB |
RPC Rate Limits
| Category | Rate Limit | Window |
|---|---|---|
| Query operations | 100 requests | per minute |
| Command operations | 50 requests | per minute |
| Subscription operations | 30 requests | per minute |
Message Throughput
| Channel Type | Updates |
|---|---|
| Order book | Up to 10/second per instrument |
| Trades | Up to 100/second per instrument |
| Account updates | Real-time (event-driven) |
Handling Rate Limits
When rate limited, the RPC call returns an error:
{
"error": {
"code": 22029,
"message": "Rate limit exceeded"
}
}
Backoff Strategy
import asyncio
async def rpc_with_retry(client, method, params, max_retries=3):
for attempt in range(max_retries):
try:
result = await client.rpc(method, params)
return result.data
except RpcError as e:
if e.code == 22029: # Rate limit
wait_time = 2 ** attempt
await asyncio.sleep(wait_time)
continue
raise
raise Exception("Rate limit exceeded after retries")
Subscription Limits
| Limit | Value |
|---|---|
| Order book subscriptions | 50 per connection |
| Trading account subscriptions | 20 per connection |
| Total subscriptions | 100 per connection |
Best Practices
- Reuse connections - Maintain a single connection per application
- Batch subscriptions - Subscribe to multiple channels in sequence
- Unsubscribe unused - Clean up subscriptions when no longer needed
- Handle disconnects - Implement reconnection with backoff
- Monitor throughput - Track message rates to avoid limits