Skip to main content
The userFundingFlows query returns your account’s funding settlement records, one row per position per settlement. Each row carries the funding index before and after the settlement, the amount paid or received, and the resulting balance. It shares its request parameters, pagination contract, and value conventions with userFills and orderHistory.

Request

string
required
Must be "userFundingFlows".
string
required
Your account ID. Must be greater than zero. A numeric value is also accepted.
int
Restrict results to one contract. Use 0 or omit for all contracts.
int64
Inclusive start of the time window, in Unix milliseconds. 0 or omitted means unbounded.
int64
Inclusive end of the time window, in Unix milliseconds. 0 or omitted means unbounded. A startTime later than endTime returns 400 BAD_REQUEST.
int
Maximum rows in this page. Defaults to 1000, which is also the maximum; a larger value returns 400 BAD_REQUEST.

Response

Envelope fields

int
Echoes the contractId filter that was applied. 0 means no filter.
int
Number of rows in this page. When count equals your limit, another page may be available.
boolean
true when the page was cut short at a row boundary because the response reached its byte ceiling.

Funding flow object fields

number
Settlement time in Unix milliseconds. This is the field you page on.
number
Block height at which the settlement was recorded.
number
Sequence number within the block.
number
Contract the position belongs to.
number
Market deployer the contract belongs to.
number
Coin the funding was settled in.
string
Size of the position at settlement (raw integer string).
string
"OneWay", "L" (long), or "S" (short).
string
Cumulative funding index before this settlement.
string
Cumulative funding index after this settlement.
string
Funding settled, signed — negative means you paid, positive means you received.
string
Balance after the settlement was applied.
string
Funding rate of the most recent interval covered by this row.
string
Mark price used for the most recent interval covered by this row, where ΔIndex = rate × price.
fundingRate and oraclePrice describe only the most recent interval. When a settlement spans several intervals, amount is their cumulative total and multiplying the rate by the price will not reproduce it. For exact reconciliation, use the difference between fundingIndexBefore and fundingIndexAfter — that is the same source amount is derived from.

Pagination

Rows come back in ascending timeMs order, at most limit per page. Pass the last row’s timeMs as the next request’s startTime and deduplicate the inclusive boundary row. A page with count below limit is the last one. See userFills for the full walkthrough.