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, error set, and value conventions with userFills and orderHistory.
Request
string
required
type (required) — Must be "userFundingFlows".string
required
accountId (required) — Your account ID. Must be greater than zero. A numeric value is also accepted.int
contractId — Restrict results to one contract. Use 0 or omit for all contracts.int64
startTime — Inclusive start of the time window, in Unix milliseconds. 0 or omitted means unbounded.int64
endTime — Inclusive end of the time window, in Unix milliseconds. 0 or omitted means unbounded. A startTime later than endTime returns 400 BAD_REQUEST.int
limit — Maximum rows in this page, from 1 to 1000. Defaults to 1000. A value outside the range returns HTTP 400 with code INVALID_PARAM, errors[].field "limit" and errors[].reason "OUT_OF_RANGE". See Errors for the shared error set.Response
Envelope fields
string
Always
"userFundingFlows".string
The account ID from the request.
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 response has an upper bound on its size and the page was cut at a row boundary, so it holds fewer than limit rows while more rows remain. Continue paginating from the last row. false when the page was not cut.object[]
The funding settlements in this page, in ascending time order. Each element carries the fields below.
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, an amount in the settlement coin (raw integer string, convert with the settlement coin’s
szDecimals), signed — negative means you paid, positive means you received.string
Balance after the settlement was applied, an amount in the settlement coin (raw integer string).
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.number | null
Index of the originating transaction within its block. Together with
height, (height, txIndex) identifies that transaction. null when not available.Pagination
Rows come back in ascendingtimeMs order, at most limit per page. Pass the last row’s timeMs as the next request’s startTime and deduplicate the inclusive boundary row on (height, seq). When count equals limit, or truncated is true, another page may be available. See userFills for the full walkthrough.