mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
15 KiB
15 KiB
Rate limits
Overview
- Nado uses a weight-based rate-limiting system across queries and executes. We limit based on
IP address,Wallet address, and a globalmax # of orders per subaccount per market. - These limits equally apply to both
httprequests andWebsocketmessages. - Limits are applied on a
1 minuteand10 secondsbasis.
Limits
- IP addresses have a max weight limit of
2400per minute or400every 10 seconds applied only to queries. - Wallet addresses have a max weight limit of
600per minute or100every 10 seconds applied only to executes. - Users can have up to
500open orders per subaccount per market. - Orders have the following additional limits:
- Place orders (with spot leverage): up to
600per minute or100every 10 seconds across all markets. - Place orders (without spot leverage): up to
30per minute or5every 10 seconds across all markets. Note: orders without spot leverage are20xmore expensive to place due to additional health checks needed. - Order cancellations: up to
600per minute or100every 10 seconds.
- Place orders (with spot leverage): up to
Query Weights
Queries are rate-limited based on IP. The following weights are applied per query:
- Status:
IP weight = 1 - Contracts:
IP weight = 1 - Nonces:
IP weight = 2 - Order:
IP weight = 1 - Orders:
IP weight = 2 * product_ids.length - Subaccount Info:
IP weight = 2(or10withtxns, or15withtxns+pre_state="true") - Isolated Positions:
IP weight = 10 - Market Liquidity:
IP weight = 1 - Symbols:
IP weight = 2 - All Products:
IP weight = 5 - Edge All Products:
IP weight = 5 - Market Prices:
IP weight = product_ids.length - Max Order Size:
IP weight = 5 - Max Withdrawable:
IP weight = 5 - Max NLP Mintable:
IP weight = 20 - Max NLP Burnable:
IP weight = 20 - NLP Pool Info:
IP weight = 20 - NLP Locked Balances:
IP weight = 20 - Health Groups:
IP weight = 2 - Linked Signer:
IP weight = 5 - Insurance:
IP weight = 2 - Fee Rates:
IP weight = 2 - Assets:
IP weight = 2 - Orderbook:
IP weight = 1
Archive (indexer) Weights
- Archive (indexer) queries are rate-limited based on IP.
- IP addresses have a max weight limit of
2400per minute or400every 10 seconds.
The following weights are applied per query:
- Orders:
IP Weight = 2 + (limit * subaccounts.length / 20); wherelimitandsubaccountsare query params. - Matches:
IP Weight = 2 + (limit * subaccounts.length / 10); wherelimitandsubaccountsare query params. - Events:
IP Weight = 2 + (limit * subaccounts.length / 10); wherelimitandsubaccountsare query params. - Candlesticks:
IP Weight = 1 + limit / 20; wherelimitis a query param. - Edge Candlesticks:
IP Weight = 1 + limit / 20; wherelimitis a query param. - Product Snapshots:
IP Weight = 10for singleproductsquery, or10 * timestamps.lengthfor multipleproduct_snapshotsquery with max_time parameter - Funding Rate:
IP Weight = 2 - Interest & funding payments:
IP Weight = 5 - Oracle Price:
IP Weight = 2 - Oracle Snapshots:
IP Weight = max((snapshot_count * product_ids.length / 100), 2); where snapshot_count isinterval.count.min(500) - Perp Prices:
IP Weight = 2(includes both singlepriceand multipleperp_pricesqueries) - Market Snapshots:
IP Weight = max((snapshot_count * product_ids.length / 100), 2); where snapshot_count isinterval.count.min(500) - Edge Market Snapshots:
IP weight = (interval.count.min(500) / 20) + (interval.count.clamp(2, 20) * 2) - Subaccounts:
IP Weight = 2 - Subaccount Snapshots:
IP Weight = 2 + (limit * subaccounts.length / 10); wherelimitandsubaccountsare query params. - Linked Signers:
IP Weight = 2 - Linked Signer Rate Limit:
IP Weight = 2 - Isolated Subaccounts:
IP Weight = 2 - Signatures:
IP Weight = 2 + len(digests) / 10; wheredigestsis a query param. - Fast Withdrawal Signature:
IP Weight = 10 - NLP Funding Payments:
IP Weight = 5 - NLP Interest Payments:
IP Weight = 5 - NLP Snapshots:
IP Weight = limit.min(500) / 100; wherelimitis a query param. - Tx Hashes:
IP Weight = idxs.length * 2; whereidxsis an array of submission indices (max 100). - Liquidation Feed:
IP Weight = 2 - Sequencer Backlog:
IP Weight = 1 - Direct Deposit Address:
IP Weight = 10 - Quote Price:
IP Weight = 2 - Ink Airdrop:
IP Weight = 2
Execute Weights
Executes are rate-limited based on Wallet address. The following weights are applied per execute:
- Place order:
- With spot leverage:
Wallet weight = 1 - Without spot leverage:
Wallet weight = 20
- With spot leverage:
- Place orders:
- With spot leverage:
Wallet weight = 1 per order - Without spot leverage:
Wallet weight = 20 per order - Note: 50ms processing penalty per request
- With spot leverage:
- Cancel orders:
- When no digests are provided:
Wallet weight = 1 - When digests are provided:
Wallet weight = total digests
- When no digests are provided:
- Cancel Product Orders:
- When no productIds are provided:
Wallet weight = 50 - When productIds are provided:
Wallet weight = 5 * total productIds
- When no productIds are provided:
- Cancel And Place:
- The sum of Cancel orders + Place order limits
- Withdraw Collateral:
- With spot leverage:
Wallet weight = 10 - Without spot leverage:
Wallet weight = 20
- With spot leverage:
- Liquidate Subaccount:
Wallet weight = 20 - Mint NLP:
Wallet weight = 10 - Burn NLP:
Wallet weight = 10 - Link Signer:
Wallet weight = 30- Can only perform a max of 50 link signer requests every 7 days per subaccount.
- Transfer Quote:
Wallet weight = 10- Can only transfer to a max of 5 new recipients within 24hrs.
Trigger Service Limits
The trigger service has additional limits specific to conditional orders:
- Pending trigger orders: Max of
25pending trigger orders per product per subaccount - TWAP orders: Must use IOC execution type and cannot be combined with isolated margin