Api sub account history response
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
resultr |
[SubAccount] | True | The sub account history matching the request sub account |
nextn |
string | True | The cursor to indicate when to start the next query from |
SubAccount
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
event_timeet |
string | True | Time at which the event was emitted in unix nanoseconds |
sub_account_idsa |
string | True | The sub account ID this entry refers to |
margin_typemt |
MarginType | True | The type of margin algorithm this subaccount uses |
settle_currencysc |
string | True | The settlement, margin, and reporting currency of this account. This subaccount can only open positions quoted in this currency In the future, when users select a Multi-Currency Margin Type, this will be USD All other assets are converted to this currency for the purpose of calculating margin |
unrealized_pnlup |
string | True | The total unrealized PnL of all positions owned by this subaccount, denominated in quote currency decimal units.unrealized_pnl = sum(position.unrealized_pnl * position.quote_index_price) / settle_index_price |
total_equityte |
string | True | The notional value of your account if all positions are closed, excluding trading fees (reported in settle_currency).total_equity = sum(spot_balance.balance * spot_balance.index_price) / settle_index_price + unrealized_pnl |
initial_marginim |
string | True | The total_equity required to open positions in the account (reported in settle_currency).Computation is different depending on account's margin_type |
maintenance_marginmm |
string | True | The total_equity required to avoid liquidation of positions in the account (reported in settle_currency).Computation is different depending on account's margin_type |
available_balanceab |
string | True | The notional value available to transfer out of the trading account into the funding account (reported in settle_currency).available_balance = total_equity - initial_margin - min(unrealized_pnl, 0) |
spot_balancessb |
[SpotBalance] | True | The list of spot assets owned by this sub account, and their balances |
positionsp |
[Positions] | True | The list of positions owned by this sub account |
settle_index_pricesi |
string | True | The index price of the settle currency. (reported in USD) |
is_vaultiv |
boolean | FalseNone |
Whether this sub account is a vault |
vault_im_additionsvi |
string | FalseNone |
Total amount of IM (reported in settle_currency) deducted from the vault due to redemptions nearing the end of their redemption period |
derisk_margindm |
string | True | The derisk margin of this sub account |
derisk_to_maintenance_margin_ratiodt |
string | True | The derisk margin to maintenance margin ratio of this sub account |
total_cross_equitytc |
string | True | The total equity of this sub account for cross margin |
cross_unrealized_pnlcu |
string | True | The unrealized PnL of this sub account for cross margin |
sub_account_modesa1 |
SubAccountMode | True | The mode of the sub account |
margin_balancemb |
string | True | The margin balance of this sub account for cross margin |
MarginType
| Value | Description |
|---|---|
SIMPLE_CROSS_MARGIN = 2 |
Simple Cross Margin Mode: all assets have a predictable margin impact, the whole subaccount shares a single margin |
PORTFOLIO_CROSS_MARGIN = 3 |
Portfolio Cross Margin Mode: asset margin impact is analysed on portfolio level, the whole subaccount shares a single margin |
SpotBalance
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
currencyc |
string | True | The currency you hold a spot balance in |
balanceb |
string | True | This currency's balance in this trading account. |
index_priceip |
string | True | The index price of this currency. (reported in USD) |
entry_priceep |
string | True | The entry price of this spot currency. (reported in USD) |
realized_pnlrp |
string | True | The realized PnL of this spot currency. (reported in USD) |
unrealized_pnlup |
string | True | The unrealized PnL of this spot currency. (reported in USD) |
available_to_transferat |
string | True | The available to transfer amount of this spot currency. |
Positions
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
event_timeet |
string | True | Time at which the event was emitted in unix nanoseconds |
sub_account_idsa |
string | True | The sub account ID that participated in the trade |
instrumenti |
string | True | The instrument being represented |
sizes |
string | True | The size of the position, expressed in base asset decimal units. Negative for short positions |
notionaln |
string | True | The notional value of the position, negative for short assets, expressed in quote asset decimal units |
entry_priceep |
string | True | The entry price of the position, expressed in 9 decimalsWhenever increasing the size of a position, the entry price is updated to the new average entry price new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size) |
exit_priceep1 |
string | True | The exit price of the position, expressed in 9 decimalsWhenever decreasing the size of a position, the exit price is updated to the new average exit price new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size) |
mark_pricemp |
string | True | The mark price of the position, expressed in 9 decimals |
unrealized_pnlup |
string | True | The unrealized PnL of the position, expressed in quote asset decimal unitsunrealized_pnl = (mark_price - entry_price) * size |
realized_pnlrp |
string | True | The realized PnL of the position, expressed in quote asset decimal unitsrealized_pnl = (exit_price - entry_price) * exit_trade_size |
total_pnltp |
string | True | The total PnL of the position, expressed in quote asset decimal unitstotal_pnl = realized_pnl + unrealized_pnl |
roir |
string | True | The ROI of the position, expressed as a percentageroi = (total_pnl / (entry_price * abs(size))) * 100^ |
quote_index_priceqi |
string | True | The index price of the quote currency. (reported in USD) |
est_liquidation_priceel |
string | True | The estimated liquidation price |
leveragel |
string | True | The current leverage value for this position |
cumulative_feecf |
string | True | The cumulative fee paid on the position, expressed in quote asset decimal units |
cumulative_realized_funding_paymentcr |
string | True | The cumulative realized funding payment of the position, expressed in quote asset decimal units. Positive if paid, negative if received |
margin_typemt |
PositionMarginType | True | The margin type of the position |
isolated_balanceib |
string | FalseNone |
[IsolatedOnly] The wallet balance reserved for this isolated margin position, expressed in quote asset decimal units. If this positions is liquidated, this is the maximal balance that can be lost |
isolated_imii |
string | FalseNone |
[IsolatedOnly] The initial margin of the isolated margin position, expressed in quote asset decimal units. The total_equity required to open more size in the position |
isolated_mmim |
string | FalseNone |
[IsolatedOnly] The maintenance margin of the isolated margin position, expressed in quote asset decimal units. The total_equity required to avoid liquidation of the position |
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 |
SubAccountMode
| Value | Description |
|---|---|
SINGLE_ASSET_MODE = 1 |
Single asset mode: the subaccount is only allowed to hold one asset as collateral |