Skip to content

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/info

Request

Request Format

{
  "params": {
    "action": "getFundingRateHistory",
    "symbol": "BTC-USDT",
    "startTime": 1704067200000,
    "endTime": 1704153600000,
    "limit": 100
  }
}

Request Parameters

ParameterTypeRequiredDescription
params.actionstringYesMust be "getFundingRateHistory"
params.symbolstringYesTrading pair symbol (e.g., "BTC-USDT"). Normalized to canonical uppercase form — lowercase input is accepted and normalized automatically.
params.startTimeintegerYesStart time in milliseconds since epoch. Must be non-zero and no more than 30 days in the past.
params.endTimeintegerYesEnd time in milliseconds since epoch. Must be non-zero and after startTime. Cannot be more than 30 days in the past.
params.limitintegerNoMaximum number of records to return. If omitted, non-positive, or above 2160, the server uses the cap of 2160.

Validation Rules

  • symbol must be a valid, supported trading pair
  • startTime is required, must be non-zero, and cannot be more than 30 days in the past
  • endTime is required, must be non-zero, and cannot be more than 30 days in the past
  • startTime must be strictly before endTime

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

FieldTypeDescription
symbolstringTrading pair symbol
fundingRatesarrayArray of funding rate records, newest first

Funding Rate Record

FieldTypeDescription
fundingRatestringThe published funding rate for the period
fundingTimeintegerWhen the rate was published (milliseconds since epoch)
appliedAtintegerWhen the rate was applied to positions (milliseconds since epoch)

Error Responses

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes

Endpoint-Specific Errors

HTTP StatusError CodeDescriptionSolution
400INVALID_FORMATRequest body could not be decodedCheck request JSON structure
400VALIDATION_ERRORInvalid symbol, missing or zero time value, or startTime >= endTimeUse a valid symbol from getMarkets and ensure startTime < endTime
400VALIDATION_ERRORstartTime or endTime older than 30 daysBoth 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