Api position history
A position lifecycle record.
When status is PARTIALLY_CLOSED, the position is still open. Fields that describe the close event (close_time, position_close_mark_price) will be omitted, and leverage reflects the current value
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
sub_account_idsa |
string | True | Trading account ID which held this position |
instrumenti |
string | True | Asset this position was for |
open_timeot |
string | True | Timestamp of first trade that opened this lifecycle |
statuss |
PositionCloseStatus | True | |
is_longil |
boolean | True | True if the closed position was long |
margin_typemt |
PositionMarginType | True | |
close_timect |
string | FalseNone |
Timestamp when the position lifecycle ended. Omitted when status is PARTIALLY_CLOSED |
entry_priceep |
string | True | Average entry price at 9 decimals |
exit_priceep1 |
string | True | Average exit price at 9 decimals |
position_close_mark_pricepc |
string | FalseNone |
Mark price at close. Omitted when status is PARTIALLY_CLOSED |
realized_pnlrp |
string | True | Cumulative realized PnL in quote currency |
cumulative_feecf |
string | True | Cumulative fees in quote currency |
cumulative_realized_funding_paymentcr |
string | True | Cumulative realized funding payment in quote currency |
closed_volume_basecv |
string | True | Sum of abs(reducingTradeSize) across all reducing trades |
closed_volume_quotecv1 |
string | True | Sum of abs(reducingTradeSize) * tradePrice across all reducing trades |
max_open_interest_basemo |
string | True | Max absolute position size reached during lifecycle |
max_open_interest_quotemo1 |
string | True | Max abs(size) * entryVWAP reached during lifecycle |
cumulative_initial_marginci |
string | True | Sum of markPrice * abs(tradeSize) / leverage for position-increasing trades |
max_initial_marginmi |
string | True | High-water mark of cumulativeInitialMargin during lifecycle |
leveragel |
string | True | Leverage at time of close. When status is PARTIALLY_CLOSED, this is the current leverage |
unrealized_pnlup |
string | FalseNone |
The unrealized PnL of the position, expressed in quote asset decimal unitsunrealized_pnl = (mark_price - entry_price) * size where size is signed (negative for short positions)Only present when status is PARTIALLY_CLOSED |
split_ratio_fromsr |
integer | FalseNone |
Stock split 'from' ratio (pre-split units); the position size scaled by to/from Only present when status is SPLIT_CLOSED. Example: 1 for a 1:4 split |
split_ratio_tosr1 |
integer | FalseNone |
Stock split 'to' ratio (post-split units) Only present when status is SPLIT_CLOSED. Example: 4 for a 1:4 split |
split_remaining_sizesr2 |
string | FalseNone |
Signed position size in base asset decimal units immediately before the split Only present when status is SPLIT_CLOSED |
PositionCloseStatus
| Value | Description |
|---|---|
CLOSED = 1 |
Position fully closed via reducing trade or flip |
LIQUIDATED = 2 |
Position closed via liquidation |
SETTLED = 3 |
Position closed via settlement |
PARTIALLY_CLOSED = 4 |
Position partially closed |
SPLIT_CLOSED = 5 |
Lifecycle ended by a stock split; reopened re-denominated |
PositionMarginType
| Value | Description |
|---|---|
ISOLATED = 1 |
Isolated Margin Mode: each position is allocated a fixed amount of collateral |
CROSS = 2 |
Cross Margin Mode: uses all available funds in your account as collateral across all cross margin positions |