Get Funding Rate History
Retrieve historical funding rates for a perpetual market over a specified time range. This is a public endpoint — no authentication required.
Endpoint
POST https://papi.synthetix.io/v1/infoRequest
Request Format
{
"params": {
"action": "getFundingRateHistory",
"symbol": "BTC-USDT",
"startTime": 1704067200000,
"endTime": 1704153600000,
"limit": 100
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params.action | string | Yes | Must be "getFundingRateHistory" |
params.symbol | string | Yes | Trading pair symbol (e.g., "BTC-USDT"). Normalized to canonical uppercase form — lowercase input is accepted and normalized automatically. |
params.startTime | integer | Yes | Start time in milliseconds since epoch. Must be non-zero and no more than 30 days in the past. |
params.endTime | integer | Yes | End time in milliseconds since epoch. Must be non-zero and after startTime. Cannot be more than 30 days in the past. |
params.limit | integer | No | Maximum number of records to return. If omitted, non-positive, or above 2160, the server uses the cap of 2160. |
Validation Rules
symbolmust be a valid, supported trading pairstartTimeis required, must be non-zero, and cannot be more than 30 days in the pastendTimeis required, must be non-zero, and cannot be more than 30 days in the paststartTimemust be strictly beforeendTime
Example Request
cURL
curl -X POST https://papi.synthetix.io/v1/info \
-H "Content-Type: application/json" \
-d '{
"params": {
"action": "getFundingRateHistory",
"symbol": "BTC-USDT",
"startTime": 1704067200000,
"endTime": 1704153600000,
"limit": 100
}
}'JavaScript
const response = await fetch('https://papi.synthetix.io/v1/info', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
params: {
action: 'getFundingRateHistory',
symbol: 'BTC-USDT',
startTime: Date.now() - 24 * 60 * 60 * 1000,
endTime: Date.now(),
limit: 100,
},
}),
});
const data = await response.json();
console.log(data.response.fundingRates);Python
import requests
import time
response = requests.post('https://papi.synthetix.io/v1/info',
json={
"params": {
"action": "getFundingRateHistory",
"symbol": "BTC-USDT",
"startTime": int((time.time() - 86400) * 1000),
"endTime": int(time.time() * 1000),
"limit": 100,
}
}
)
data = response.json()
for record in data["response"]["fundingRates"]:
print(record["fundingTime"], record["fundingRate"])Response
Success Response
{
"status": "ok",
"response": {
"symbol": "BTC-USDT",
"fundingRates": [
{
"fundingRate": "0.00001250",
"fundingTime": 1704153600000,
"appliedAt": 1704153660000
},
{
"fundingRate": "0.000010960225996",
"fundingTime": 1704150000000,
"appliedAt": 1704150060000
}
]
},
"request_id": "5ccf215d37e3ae6d"
}Response Object
| Field | Type | Description |
|---|---|---|
symbol | string | Trading pair symbol |
fundingRates | array | Array of funding rate records, newest first |
Funding Rate Record
| Field | Type | Description |
|---|---|---|
fundingRate | string | The published funding rate for the period |
fundingTime | integer | When the rate was published (milliseconds since epoch) |
appliedAt | integer | When the rate was applied to positions (milliseconds since epoch) |
Error Responses
| 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 |
Endpoint-Specific Errors
| HTTP Status | Error Code | Description | Solution |
|---|---|---|---|
| 400 | INVALID_FORMAT | Request body could not be decoded | Check request JSON structure |
| 400 | VALIDATION_ERROR | Invalid symbol, missing or zero time value, or startTime >= endTime | Use a valid symbol from getMarkets and ensure startTime < endTime |
| 400 | VALIDATION_ERROR | startTime or endTime older than 30 days | Both timestamps must be within the last 30 days |
Use Cases
Average funding rate over a time window
const now = Date.now();
const oneDayAgo = now - 24 * 60 * 60 * 1000;
const response = await fetch('https://papi.synthetix.io/v1/info', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
params: {
action: 'getFundingRateHistory',
symbol: 'BTC-USDT',
startTime: oneDayAgo,
endTime: now,
},
}),
});
const { response: { fundingRates } } = await response.json();
const avgRate = fundingRates.reduce((sum, r) => sum + parseFloat(r.fundingRate), 0) / fundingRates.length;
console.log(`Average funding rate (24h): ${avgRate}`);:::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. :::
Related Endpoints
- Get Funding Rate - Current funding rate for a market
- Get Funding Payments - Your account's funding payment history
- Get Markets - Available trading pairs
