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"
},
"nonce": 1735689600000,
"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) |
params.endTime | number | No | End timestamp for filtering (ms) |
params.limit | number | No | Maximum number of records (default: 100) |
| Parameter | Type | Required | Description |
|---|---|---|---|
nonce | uint64 | Yes | Unix milliseconds timestamp (must be monotonically increasing) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
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 current timestamp in milliseconds as nonce
- Each nonce must be greater than the previous one
- Recommended: Use
Date.now()or equivalent - If nonce conflicts occur, increment by 1 and retry
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,
"fundingTimestamp": 1735689600000
},
{
"paymentId": "fp_1958787130134106111",
"symbol": "ETH-USDT",
"positionSize": "-5.00000000",
"fundingRate": "-0.00002100",
"payment": "3.15000000",
"timestamp": 1735661200000,
"fundingTimestamp": 1735661200000
}
]
},
"request_id": "a3f7c2d1e9b8x67k",
"timestamp": "2025-01-01T00:00:00Z"
}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 | When payment was processed |
fundingTimestamp | number | Funding period timestamp |
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 = {
GetFundingPayments: [
{ name: "action", type: "string" },
{ name: "subAccountId", type: "string" },
{ name: "symbol", type: "string" },
{ name: "nonce", type: "uint256" }
]
};
const value = {
type: "getFundingPayments",
subAccountId: "1867542890123456789",
symbol: "BTC-USDT",
nonce: 1735689600000
};
const signature = await signer._signTypedData(domain, types, value);Error Responses
| Error | Description |
|---|---|
| Invalid signature | EIP-712 signature validation failed |
| Invalid market symbol | Market symbol not recognized |
| Nonce already used | Nonce must be greater than previous value |
| Rate limit exceeded | Too many requests in time window |
| Request expired | expiresAfter timestamp has passed |
Endpoint-Specific Errors
| Error Code | Error Type | Description | Solution |
|---|---|---|---|
| 40001 | INVALID_SUBACCOUNT | Subaccount not found or unauthorized | Verify subaccount ownership |
| 40002 | INVALID_SYMBOL | Invalid trading symbol filter | Use valid symbol from getMarkets |
| 40003 | INVALID_TIME_RANGE | Invalid time range parameters | Ensure startTime < endTime |
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