Limits and Security
Rate limits per surface, what a leaked key can do, error codes, and the per key policy for market makers: IP allowlists, tiers, rate limit headers.
Limits today
Per client IP unless stated. Limited responses are 429; WebSocket handshakes answer 429 or 503.
| Surface | Limit |
|---|---|
| Bot API, per key | 600 reads and 120 trading calls a minute, X-RateLimit-Remaining on every answer; IP allowlist, per-order and open-position caps in USD set on the key |
| TRUE market data REST | 600 requests a minute |
TRUE account reads (/api/perps-dex/* with a session) | 240 requests a minute |
| SSE stream | 32 concurrent streams, 240 connects a minute; 5,000 per server replica |
| WebSocket | 6 sockets and 60 handshakes a minute per account (32 and 240 per IP); 40 topics per socket; 30 client frames burst, 5 a second sustained; bots authenticate with a one hour token from POST /api/bot/v1/ws-token |
| MCP, per key | market data 120 a minute, chat 10 a minute, points 30 a minute, key validation 60 a minute |
Venue REST (dex-prod) | no published per IP limit today; treat 600 reads a minute and 120 order calls a minute as the ceiling you design for |
TRUE’s own services are exempt from every edge rule, so a limit you hit is yours alone.
What a leaked key can do
A bot key with trade can place, change and cancel orders on the one account it was made for, inside its notional caps and only from its allowlisted addresses, until revoked or paused. A sequencer API key can place, modify and cancel orders on its account until revoked. Neither can withdraw (owner signature only) or change the owner. An MCP key with trade:execute can propose trades, each still approved by the user in the app; with read it can see balances and positions. Revoke first, rotate second, then look at what was placed.
Store keys in a secret manager, never in a repository, a prompt or a shared document. Use one key per bot so a revoke stops one thing.
Errors
| Symptom | Cause |
|---|---|
401 invalid token format on the venue | missing apikey_ prefix |
ApiKeyIdentityConflict | pubkey headers on an API key read |
Invalid signature | wrong borsh order, digest bytes signed instead of the hex text, size or price string differs between signed payload and body, timestamp mismatch |
WebSocket upgrade 403 | bad or expired token; fetch a new one from POST /api/bot/v1/ws-token |
403 ip_not_allowed on the Bot API | the key has an allowlist and your address is not on it; the message names the address we saw |
403 order_notional_cap or position_notional_cap | the key’s own caps, set when it was created; raise them on the key or use another key |
WebSocket upgrade 429 | more than 6 sockets or 60 handshakes a minute for one account, or more than 32 sockets or 240 handshakes a minute from one IP |
429 on REST or SSE | over the per minute limit; back off for the rest of the minute |
| book looks wrong | a delta applied after a sequence gap; resubscribe orderbook:SYM |
Per key policy for market makers
The Bot API already carries an IP allowlist, per-key limits and Retry-After. The tier table below is the policy framework for keys that need more than the default allowance; a tier is granted by TRUE against a described use case:
| retail | pro | market maker | |
|---|---|---|---|
| requests a second (burst) | 5 (20) | 20 (100) | 100 (500) |
| sockets | 2 | 4 | 10 |
| topics per socket | 40 | 100 | 400 |
| streams | 4 | 8 | 16 |
| IP allowlist | optional | optional | required |
Still planned for the sequencer API key: the allowlist on the venue host itself, and RateLimit-* headers on dex-prod responses. Until then the allowlist, the caps and the headers live on the Bot API and the MCP endpoint. Tiers are granted, not self assigned.
Market makers: write to the team through the app (Kira) with your IPs and the markets you intend to quote, and we set the tier before you connect.