Get Funding Payments
Retrieve detailed funding payment history and statistics for the authenticated subaccount. This endpoint provides user-specific funding data including payments received, paid, and net funding across all positions.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getFundingPayments",
"subAccountId": "1867542890123456789"
},
"expiresAfter": 1735689900,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getFundingPayments" |
params.subAccountId | string | Yes | SubAccount ID to retrieve funding data for |
params.symbol | string | No | Filter by specific trading pair |
params.startTime | number | No | Start timestamp for filtering (ms). Cannot be more than 30 days in the past. When omitted, defaults to now − 30 days. |
params.endTime | number | No | End timestamp for filtering (ms). If endTime is older than 30 days and startTime is not provided, the request is rejected. |
params.limit | number | No | Maximum number of records to return. Default: 100. Maximum: 1000. |
| 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, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts, getFeeRate, getSnaxpotEpochTickets) do not require the nonce parameter. Only signature and optional expiresAfter are needed.
:::
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, getOrderHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates, getWithdrawableAmounts, getFeeRate, getSnaxpotEpochTickets) do not require a nonce. Only the signature and optional expiresAfter parameters are needed.
:::
Response
Success Response
{
"status": "ok",
"response": {
"summary": {
"totalFundingReceived": "125.75000000",
"totalFundingPaid": "89.25000000",
"netFunding": "36.50000000",
"totalPayments": "247",
"averagePaymentSize": "0.87044534"
},
"fundingHistory": [
{
"paymentId": "fp_1958787130134106112",
"symbol": "BTC-USDT",
"positionSize": "2.50000000",
"fundingRate": "0.00001250",
"payment": "-1.12500000",
"timestamp": 1735689600000,
"paymentTime": 1735689600000,
"fundingTimestamp": 1735689600000,
"fundingTime": 1735689600000
},
{
"paymentId": "fp_1958787130134106111",
"symbol": "ETH-USDT",
"positionSize": "-5.00000000",
"fundingRate": "-0.00002100",
"payment": "3.15000000",
"timestamp": 1735661200000,
"paymentTime": 1735661200000,
"fundingTimestamp": 1735661200000,
"fundingTime": 1735661200000
}
]
},
"request_id": "a3f7c2d1e9b8x67k"
}Response Fields
Summary Object
| Field | Type | Description |
|---|---|---|
totalFundingReceived | string | Total funding payments received |
totalFundingPaid | string | Total funding payments paid |
netFunding | string | Net funding (received - paid) |
totalPayments | string | Total number of funding payments |
averagePaymentSize | string | Average payment size (absolute value) |
Funding History Object
| Field | Type | Description |
|---|---|---|
paymentId | string | Unique identifier for the funding payment |
symbol | string | Trading pair symbol |
positionSize | string | Position size at funding time (signed) |
fundingRate | string | Funding rate applied (1-hour rate) |
payment | string | Funding payment amount (negative = paid out) |
timestamp | number | DEPRECATED - Use paymentTime instead. When payment was processed |
paymentTime | number | When payment was processed (replaces timestamp) |
fundingTimestamp | number | DEPRECATED - Use fundingTime instead. Funding period timestamp |
fundingTime | number | Funding period timestamp (replaces fundingTimestamp) |
Payment Calculation
Formula: Payment = Position Size × Funding Rate × Mark Price
- Positive payment: Funding received
- Negative payment: Funding paid
- Long positions: Pay when funding rate is positive
- Short positions: Receive when funding rate is positive
Authentication
This endpoint requires EIP-712 signature authentication.
Request Signing
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.
Example Authentication
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 value = {
subAccountId: "1867542890123456789",
action: "getFundingPayments",
expiresAfter: 0
};
const signature = await signer._signTypedData(domain, types, value);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 | Message | Solution |
|---|---|---|---|
| 400 | VALIDATION_ERROR | subAccountId is required | Provide a valid authenticated subaccount |
| 400 | INVALID_FORMAT | Invalid or empty symbol — message is "market name invalid" or "market name empty" | Use a valid symbol (e.g., BTC-USDT) from getMarkets |
| 400 | VALIDATION_ERROR | startTime must be less than endTime | Ensure startTime is strictly less than endTime |
| 400 | VALIDATION_ERROR | startTime must be a valid timestamp | Use a timestamp within the last 30 days and not in the future |
| 400 | VALIDATION_ERROR | startTime older than 30 days | startTime cannot be more than 30 days in the past |
| 400 | VALIDATION_ERROR | endTime older than 30 days | endTime is older than 30 days and no startTime was provided — provide a startTime within the last 30 days |
| 400 | VALIDATION_ERROR | limit must not exceed 1000 | Reduce the limit to 1000 or below |
| 400 | INVALID_FORMAT | Invalid request body | Check request structure and field types |
Use Cases
Funding Performance Analysis
// Analyze funding performance over time
const fundingData = await getFundingPayments({
subAccountId: "1867542890123456789",
startTime: Date.now() - (30 * 24 * 60 * 60 * 1000) // Last 30 days
});
const netFunding = parseFloat(fundingData.result.summary.netFunding);
console.log(`Net funding last 30 days: ${netFunding} USDT`);Position-Specific Funding
// Get funding for specific market
const btcFunding = await getFundingPayments({
subAccountId: "1867542890123456789",
symbol: "BTC-USDT"
});Funding Rate Impact
// Calculate funding rate impact on strategy
const fundingHistory = fundingData.result.fundingHistory;
const highRatePayments = fundingHistory.filter(
payment => Math.abs(parseFloat(payment.fundingRate)) > 0.01
);Related Endpoints
- Get Funding Rate - Current market funding rates
- Get Positions - Current positions
- Get Performance History - Overall performance metrics