General
Rate limits
Ekiden’s API enforces rate limits to ensure fair usage and maintain system reliability. Limits vary depending on the endpoint type, authentication method, and protocol (REST or WebSocket). This document outlines the conventions and placeholders used for rate-limiting policies.
Overview
- Limits apply per IP address and per API key
- Public and authenticated endpoints have separate thresholds
- REST and WebSocket APIs are rate-limited independently
REST API Rate Limits
Global Limits
Access Type | Limit |
---|---|
Public (unauthenticated) | {PUBLIC_RATE_LIMIT} requests/min per IP |
Authenticated | {AUTHENTICATED_RATE_LIMIT} requests/min per API key |
Endpoint-Specific Limits
Endpoint | Limit | Scope |
---|---|---|
GET /v1/markets | {MARKETS_LIMIT} | Per IP |
GET /v1/orderbook | {ORDERBOOK_LIMIT} | Per IP |
POST /v1/orders | {PLACE_ORDER_LIMIT} | Per API key |
DELETE /v1/orders/{id} | {CANCEL_ORDER_LIMIT} | Per API key |
GET /v1/user/trades | {USER_TRADES_LIMIT} | Per API key |
WebSocket API Rate Limits
Limit Type | Value |
---|---|
Concurrent connections per IP | {MAX_WS_CONNECTIONS} |
Subscriptions per connection | {MAX_WS_SUBSCRIPTIONS} |
Messages per minute (per IP) | {MAX_WS_MESSAGES} |
Max in-flight messages per connection | {MAX_WS_INFLIGHT} |
Rate Limit Errors
If a client exceeds the allowed rate:
- HTTP Status Code:
429 Too Many Requests
- Response Header:
Retry-After: {SECONDS}
Error response body:
Best Practices
- Use WebSocket for high-frequency market data
- Implement retry logic with exponential backoff based on
Retry-After
- Batch requests where supported
- Contact the Ekiden team for rate limit customization based on usage
Operational Limits
Limit Type | Value |
---|---|
Open orders per market | {MAX_OPEN_ORDERS} |
Orders per minute | {ORDER_RATE_LIMIT} |
Cancels per minute | {CANCEL_RATE_LIMIT} |
For detailed API usage, refer to the API Reference.