Skip to main content

Limits

Connection Limits

LimitValue
Connections per user10
Subscriptions per connection100
Message size64 KB

RPC Rate Limits

CategoryRate LimitWindow
Query operations100 requestsper minute
Command operations50 requestsper minute
Subscription operations30 requestsper minute

Message Throughput

Channel TypeUpdates
Order bookUp to 10/second per instrument
TradesUp to 100/second per instrument
Account updatesReal-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

LimitValue
Order book subscriptions50 per connection
Trading account subscriptions20 per connection
Total subscriptions100 per connection

Best Practices

  1. Reuse connections - Maintain a single connection per application
  2. Batch subscriptions - Subscribe to multiple channels in sequence
  3. Unsubscribe unused - Clean up subscriptions when no longer needed
  4. Handle disconnects - Implement reconnection with backoff
  5. Monitor throughput - Track message rates to avoid limits