Rate Limits
We enforce rate limits on both REST API and WebSocket usage. These limits apply to both IP address and L1 address. If you send transactions via Websocket, the sendTx and sendTxBatch channels will share the same rate limits that the REST API uses.
REST API Endpoint Limits
The following limits apply to the https://mainnet.zklighter.elliot.ai/api/v1/ base URL, different limits (listed further below) apply to https://explorer.elliot.ai/api/.
| Premium accounts | Standard accounts |
|---|---|
| 24,000 weighted requests per rolling minute | 60 requests per rolling minute |
ThesendTx and sendTxBatch transaction types are the only two endpoints constrained by Volume Quota ), necessary to create and modify orders.
Weights:
| Endpoint | Weight |
|---|---|
sendTx, sendTxBatch, nextNonce | 6 |
publicPools, txFromL1TxHash | 50 |
accountInactiveOrders, deposit/latest | 100 |
apikeys | 150 |
transferFeeInfo | 500 |
trades, recentTrades | 600 |
changeAccountTier, tokens/*, setAccountMetadata, notification/ack, createIntentAddress, fastwithdraw, referral/* | 3000 |
| Other endpoints | 300 |
While standard accounts rate limits are not weighted, whenever {premium_weighted_requests}/{endpoint_weight} < {standard_requests}, the former limit is going to be applied. For example, both standard and premium accounts will be able to make a maximum of 8 requests per rolling minute to the changeAccountTier endpoint.
Explorer REST API Endpoint Limits
The following limits apply to the https://explorer.elliot.ai/api/ Base URL.
Standard Users and Premium Users both have the same limit of 90 weighted requests per rolling minute window.
Weights
| Endpoint | Weight |
|---|---|
search | 3 |
accounts/* | 2 |
| Other endpoints | 1 |
WebSocket Limits
To prevent resource exhaustion, we enforce the following usage limits per IP:
- Connections: 100
- Subscriptions per connection: 100
- Total Subscriptions: 1000
- Max Connections Per Minute: 80 (not to be confused with channel subscriptions)
- Max Messages Sent By Client Per Minute: 200 (sendTx and sendBatchTx are not counted here, and follow the same limits as REST requests)
- Max Inflight Messages: 50
- Unique Accounts: 10
Additionally, every connection is automatically dropped after 24 hours. It's recommended to have proper reconnection logic, in addition to ping/pong logic.
Transaction Type Limits (per user)
The following limits only apply to Standard Accounts:
| Transaction Type | Limit |
|---|---|
| Default | 40 requests / minute |
L2Withdraw | 2 requests / minute |
L2UpdateLeverage | 1 request / minute |
L2CreateSubAccount | 2 requests / minute |
L2CreatePublicPool | 2 requests / minute |
L2ChangePubKey | 2 requests / 10 seconds |
L2Transfer | 1 request / minute |
Rate Limit Exceeding Behavior
If you exceed any rate limit:
- You will receive an HTTP
429 Too Many Requestserror - For WebSocket connections, excessive messages may result in disconnection
- When you're rate-limited on REST, WebSocket connections also get rate-limited, and viceversa
To avoid this, please ensure your clients are implementing proper backoff and retry strategies.
Cooldown
Depending on whether you have been rate-limited by our firewall, or by the api servers, the cooldown period varies:
- Firewall: 60 seconds, static
- Api servers:
weightOfEndpoint/(totalWeight/60)
As an example, making a request to the account endpoint (which carries a weight of 300) after having exhausted your weighted requests in a given minute window, results in a 750ms cooldown period.
Updated 7 days ago