Skip to main content

Rate Limiting

All API endpoints are rate-limited to prevent abuse and ensure fair access. Limits are enforced per client IP address and endpoint path using Redis.

How It Works​

  • Each endpoint has a configured maximum number of requests per 1 minute window
  • Limits are tracked per client IP + normalized endpoint path combination
  • Path parameters are normalized (e.g., /users/123 becomes /users/:id)
  • When a limit is exceeded, the API returns 429 Too Many Requests
  • If Redis is unavailable, rate limiting degrades gracefully (requests are allowed)

Response Headers​

Every API response includes rate limit headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per minute
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetMilliseconds until the window resets
Retry-AfterSeconds to wait before retrying (only on 429 responses)

Rate Limits by Endpoint​

Authentication​

EndpointMethodLimit
/auth/sign-upPOST5/min
/auth/sign-inPOST10/min
/auth/verify-emailPOST5/min
/auth/forgot-passwordPOST5/min
/auth/reset-passwordPOST5/min
/auth/google, /github, /vk, /yandexGET10/min
/auth/*/callbackGET20/min
/auth/logoutDELETE20/min
/auth/refreshPOST30/min
/auth/meGET60/min

Users​

EndpointMethodLimit
/users/me/withdrawPOST5/min
/users/me/avatarPOST/DELETE10/min
/users/mePUT20/min
/users/me/referral/*GET30/min
/users/me/watchlist/{id}POST/DELETE30/min
/users/* (read)GET60/min
/users/me/watchlistGET60/min
/users/me/pnl/chartGET60/min

Events​

EndpointMethodLimit
/events/{id}DELETE5/min
/eventsPOST10/min
/events/{id}/imagePOST/DELETE10/min
/events/{id}PUT20/min
/search_eventsGET60/min
/events, /events/feed, /events/{id}GET120/min

Pools​

EndpointMethodLimit
/events/{id}/poolsPOST10/min
/pools/{id}/ratio/chartGET60/min
/pools/batch, /pools/{id}GET120/min

Trading (Orderbook)​

EndpointMethodLimit
/market/ordersPOST30/min
/market/orders/{id}DELETE30/min
/market/orders/my, /market/orders/my/currentGET60/min
/market/positions/my, /market/positions/completedGET60/min

Trading (LMSR / AMM)​

EndpointMethodLimit
/lmsr/tradePOST30/min
/lmsr/previewGET60/min

P2P Exchange​

EndpointMethodLimit
/p2p/orders, /p2p/orders/{id}ALL120/min

Notifications​

EndpointMethodLimit
/notifications/read-allPUT10/min
/notifications/{id}/readPUT30/min
/notifications/{id}DELETE30/min
/notifications, /notifications/unread, /notifications/unread/countGET60/min

Comments​

EndpointMethodLimit
/comments/{id}PUT/DELETE20/min
/comments/{id}/reactionDELETE30/min
/events/{id}/commentsPOST30/min
/comments/{id}/replyPOST30/min
/comments/{id}/like, /comments/{id}/dislikePOST60/min
/events/{id}/comments, /comments/{id}/repliesGET120/min

Other​

EndpointMethodLimit
/currency/rateGET120/min
/ws/tradesGET480/min
All unknown endpointsANY30/min

429 Response​

When rate limited, the API returns:

{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Please try again later."
}
}

HTTP Status: 429 Too Many Requests

Client IP Detection​

The server determines client IP in this priority order:

  1. CF-Connecting-IP header (Cloudflare β€” trusted)
  2. RemoteAddr (direct connection, port stripped)

X-Forwarded-For and X-Real-IP are not used to prevent IP spoofing.

Best Practices​

  • Respect Retry-After headers when receiving 429 responses
  • Implement exponential backoff for retries
  • Cache responses where possible to reduce request frequency
  • Use WebSocket feeds for real-time data instead of polling