Skip to main content
Closed-position PNL

Authorizations

X-TXC-APIKEY
string
header
required

The public WhiteBIT API key.

X-TXC-PAYLOAD
string
header
required

Base64-encoded JSON request body.

X-TXC-SIGNATURE
string
header
required

HMAC-SHA512 signature of the payload, hex-encoded. Computed as hex(HMAC-SHA512(payload, api_secret)).

Body

application/json
startDate
integer

Start of the query window as a Unix timestamp in seconds, applied to the position close time. Optional, no default. Must be ≤ endDate.

Example:

1778000000

endDate
integer

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.

Example:

1778100000

limit
integer
default:50

Maximum number of records to return. Default: 50. Minimum: 1. Maximum: 100.

Required range: 1 <= x <= 100
Example:

50

offset
integer
default:0

Number of records to skip. Default: 0. The sum of offset and limit must not exceed 10000.

Required range: x >= 0
Example:

0

request
string
Example:

"{{request}}"

nonce
integer
Example:

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.

positionId
integer

Unique identifier of the closed position.

Example:

111

market
string

Market of the position. Format: BASE_QUOTE.

Example:

"BTC_USDT"

grossPnl
string

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.

Example:

"43.85"

netPnl
string

Net profit and loss of the position: grossPnl minus totalFunding.

Example:

"42.6"

totalTradeFee
string

Sum of trading fees across all fills of the position, both opening and closing. Informational — already reflected in grossPnl and netPnl.

Example:

"6.15"

totalFunding
string

Cumulative funding fee over the whole position lifetime.

Example:

"1.25"

avgEntryPrice
string

Volume-weighted average price of the fills that increased the position, trimmed to the market money precision.

Example:

"61000"

avgExitPrice
string

Volume-weighted average price of the fills that reduced the position, trimmed to the market money precision.

Example:

"62000"

closedSize
string

Total closed volume in base currency — the sum of fills that reduced the position.

Example:

"0.05"

amount
string

Remaining position size. Always returns "0" — a closed position holds no size.

Example:

"0"

side
enum<string>

Position direction. Returns BOTH for positions opened with hedge mode disabled. See positionSide.

Available options:
LONG,
SHORT,
BOTH
Example:

"LONG"

isHedge
boolean

Whether the position was opened in hedge mode.

Example:

true

openDate
integer

Position open time as a Unix timestamp in seconds.

Example:

1778000000

closeDate
integer

Position close time as a Unix timestamp in seconds. Primary sort key, descending.

Example:

1778077400