Closed-position PNL
Retrieve aggregated profit and loss for closed collateral trading positions on a WhiteBIT account via the V4 API.
Authorizations
The public WhiteBIT API key.
Base64-encoded JSON request body.
HMAC-SHA512 signature of the payload, hex-encoded. Computed as hex(HMAC-SHA512(payload, api_secret)).
Body
Start of the query window as a Unix timestamp in seconds, applied to the position close time. Optional, no default. Must be ≤ endDate.
1778000000
End of the query window as a Unix timestamp in seconds, applied to the position close time. Optional, no default. Must be ≥ startDate and ≤ now + 1s.
1778100000
Maximum number of records to return. Default: 50. Minimum: 1. Maximum: 100.
1 <= x <= 10050
Number of records to skip. Default: 0. The sum of offset and limit must not exceed 10000.
x >= 00
"{{request}}"
1594297865000
Response
Successful response - returns an array with one aggregated record per closed position, sorted by closeDate descending, then positionId descending. Returns an empty array when no closed positions match the filters.
Unique identifier of the closed position.
111
Market of the position. Format: BASE_QUOTE.
"BTC_USDT"
Realized profit and loss of the position before funding. Trading fees are already deducted from the value; totalTradeFee is informational and must not be subtracted again.
"43.85"
Net profit and loss of the position: grossPnl minus totalFunding.
"42.6"
Sum of trading fees across all fills of the position, both opening and closing. Informational — already reflected in grossPnl and netPnl.
"6.15"
Cumulative funding fee over the whole position lifetime.
"1.25"
Volume-weighted average price of the fills that increased the position, trimmed to the market money precision.
"61000"
Volume-weighted average price of the fills that reduced the position, trimmed to the market money precision.
"62000"
Total closed volume in base currency — the sum of fills that reduced the position.
"0.05"
Remaining position size. Always returns "0" — a closed position holds no size.
"0"
Position direction. Returns BOTH for positions opened with hedge mode disabled. See positionSide.
LONG, SHORT, BOTH "LONG"
Whether the position was opened in hedge mode.
true
Position open time as a Unix timestamp in seconds.
1778000000
Position close time as a Unix timestamp in seconds. Primary sort key, descending.
1778077400