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.
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 recognized trading pair; see getMarkets for the list of active markets
  • 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 must be strictly after startTime

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
400INVALID_FORMATMalformed symbol — message is "market name invalid"Use a valid symbol format (e.g., "BTC-USDT"). Symbols are normalized automatically.
400INVALID_FORMATEmpty symbol string — message is "market name empty"Supply a non-empty market symbol
400VALIDATION_ERRORMissing symbol field — message is "market name empty"Include symbol in params
400VALIDATION_ERRORMarket not in active registry — message is "unknown market"Use a symbol from getMarkets
400VALIDATION_ERRORMissing or zero startTime or endTime, or startTime >= endTimeProvide non-zero timestamps and ensure startTime is strictly before endTime
400VALIDATION_ERRORstartTime older than 30 days — message is "startTime cannot be more than 30 days in the past"Set startTime within the last 30 days
400VALIDATION_ERRORstartTime or endTime cannot be converted to a valid timestampProvide millisecond epoch timestamps
500INTERNAL_ERRORFailed to get funding rate historyRetry the request; contact support if persistent

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