Get Rate Limits
Retrieve current rate limit usage and capacity for the authenticated user. This endpoint provides real-time information about API request consumption, helping developers monitor usage and avoid hitting rate limits.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getRateLimits",
"subAccountId": "1867542890123456789",
"user": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
},
"expiresAfter": 1704067500,
"signature": {
"v": 28,
"r": "0x19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef",
"s": "0xabcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600abcdef19480589384695193600"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getRateLimits" |
params.subAccountId | string | Yes | SubAccount ID for authentication |
params.user | string | Yes | Wallet address to check rate limits for |
| Parameter | Type | Required | Description |
|---|---|---|---|
nonce | uint64 | Yes* | Positive integer nonce (must be incrementing and unique per request) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
:::info Common Parameters
These are top-level request parameters. The subAccountId parameter is specified within the params object (see each endpoint's parameter table).
:::
:::info SubAccountAction Endpoints
Endpoints using SubAccountAction signing (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require the nonce parameter. Only signature and optional expiresAfter are needed.
:::
Response
Response Structure
| Field | Type | Description |
|---|---|---|
status | string | Always "ok" for successful requests or "error" for failures |
response | object | Rate limit data (omitted when status is "error") |
error | object | Error details (only present when status is "error") |
request_id | string | Request tracking identifier |
Success Response
{
"status": "ok",
"response": {
"requestsUsed": 45,
"requestsCap": 1200
},
"request_id": "5ccf215d37e3ae6d"
}Response Fields
| Field | Type | Description |
|---|---|---|
requestsUsed | integer | Total requests used in the current rate limit window |
requestsCap | integer | Maximum total requests allowed in the current window |
Error Response
{
"status": "error",
"error": {
"code": "INVALID_FORMAT",
"message": "Invalid request body"
},
"request_id": "5ccf215d37e3ae6d"
}Usage Examples
Check Rate Limit Status
{
"params": {
"action": "getRateLimits",
"subAccountId": "1867542890123456789",
"user": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
},
"expiresAfter": 1704067500,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}EIP-712 Signature
const domain = {
name: "Synthetix",
version: "1",
chainId: 1,
verifyingContract: "0x0000000000000000000000000000000000000000"
};
const types = {
SubAccountAction: [
{ name: "subAccountId", type: "uint256" },
{ name: "action", type: "string" },
{ name: "expiresAfter", type: "uint256" }
]
};
const message = {
subAccountId: "1867542890123456789",
action: "getRateLimits",
expiresAfter: 0
};
const signature = await signer._signTypedData(domain, types, message);Implementation Notes
- Returns rate limit usage for the authenticated user
- Authentication requires signature by account owner or authorized delegate
- Uses
SubAccountActionEIP-712 type (no nonce required, only optionalexpiresAfter)
Signing
All trading methods are signed using EIP-712. Each successful trading request will contain:
- A piece of structured data that includes the sender address
- A signature of the hash of that structured data, signed by the sender
For detailed information on EIP-712 signing, see EIP-712 Signing.
Nonce Management
The nonce system prevents replay attacks and ensures order uniqueness:
- Use any positive integer as nonce
- Each nonce must be greater than the previous one (incrementing)
Date.now()is a convenient option, not a requirement- If nonce conflicts occur, increment by 1 and retry
:::note SubAccountAction Exception
SubAccountAction endpoints (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require a nonce. Only the signature and optional expiresAfter parameters are needed.
:::
Rate Limit Information
:::info Rate Limits The Synthetix API enforces rate limits to ensure fair usage and system stability:
- Order Placement: 100 orders per second per subaccount
- WebSocket Connections: 100 connections per IP address
- WebSocket Subscriptions: 1000 subscriptions per IP address
See Rate Limits for detailed information and best practices. :::
This endpoint itself is subject to rate limiting. For detailed rate limit policies, see Rate Limits.
Error Handling
Common error scenarios:
| Error Code | Description | Retryable |
|---|---|---|
UNAUTHORIZED | EIP-712 signature validation failed | No |
VALIDATION_ERROR | Request validation failed | No |
MISSING_REQUIRED_FIELD | Required field is missing | No |
INVALID_FORMAT | Field format is invalid | No |
INVALID_VALUE | Invalid parameter value | No |
RATE_LIMIT_EXCEEDED | Too many requests in time window | Yes |
INSUFFICIENT_MARGIN | Not enough margin for trade | No |
ORDER_NOT_FOUND | Order does not exist | No |
OPERATION_TIMEOUT | Operation timed out | Yes |
| Error | Description |
|---|---|
| Invalid request format | Request payload could not be parsed |
| Authentication error | Invalid or missing EIP-712 signature |
Related Endpoints
- Rate Limits Overview — Comprehensive rate limiting documentation
- WebSocket Alternative — WebSocket API equivalent
