HomeDocumentationAPI Reference
Log In
API Reference

Get Positions

Method Name

private/get_positions

Get active positions of a subaccount
Required minimum session key permission level is read_only

Parameters

subaccount_idintegerrequired
Subaccount_id

Response

idstring or integerrequired
resultobjectrequired
result.subaccount_idintegerrequired
Subaccount_id
result.positionsarray of objectsrequired
All active positions of subaccount
result.positions[].amountstringrequired
Position amount held by subaccount
result.positions[].amount_stepstringrequired
Minimum amount step for the position
result.positions[].average_pricestringrequired
Average price of whole position
result.positions[].average_price_excl_feesstringrequired
Average price of whole position excluding fees
result.positions[].creation_timestampintegerrequired
Timestamp of when the position was opened (in ms since Unix epoch)
result.positions[].cumulative_fundingstringrequired
Cumulative funding for the position (only for perpetuals).
result.positions[].deltastringrequired
Asset delta (w.r.t. forward price for options, 1.0 for perps)
result.positions[].gammastringrequired
Asset gamma (zero for non-options)
result.positions[].index_pricestringrequired
Current index (oracle) price for position's currency
result.positions[].initial_marginstringrequired
USD initial margin requirement for this position
result.positions[].instrument_namestringrequired
Instrument name (same as the base Asset name)
result.positions[].instrument_typestringrequired
erc20, option, or perp
enum erc20optionperp
result.positions[].leveragestring or nullrequired
Only for perps. Leverage of the position, defined as abs(notional) / collateral net of options margin
result.positions[].liquidation_pricestring or nullrequired
Index price at which position will be liquidated
result.positions[].maintenance_marginstringrequired
USD maintenance margin requirement for this position
result.positions[].mark_pricestringrequired
Current mark price for position's instrument
result.positions[].mark_valuestringrequired
USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price
result.positions[].net_settlementsstringrequired
Net amount of USD from position settlements that has been paid to the user's subaccount. This number is subtracted from the portfolio value for margin calculations purposes.
Positive values mean the user has recieved USD from settlements, or is awaiting settlement of USD losses. Negative values mean the user has paid USD for settlements, or is awaiting settlement of USD gains.
result.positions[].open_orders_marginstringrequired
USD margin requirement for all open orders for this asset / instrument
result.positions[].pending_fundingstringrequired
A portion of funding payments that has not yet been settled into cash balance (only for perpetuals). This number is added to the portfolio value for margin calculations purposes.
result.positions[].realized_pnlstringrequired
Realized trading profit or loss of the position.
result.positions[].realized_pnl_excl_feesstringrequired
Realized trading profit or loss of the position excluding fees
result.positions[].thetastringrequired
Asset theta (zero for non-options)
result.positions[].total_feesstringrequired
Total fees paid for opening and changing the position
result.positions[].unrealized_pnlstringrequired
Unrealized trading profit or loss of the position.
result.positions[].unrealized_pnl_excl_feesstringrequired
Unrealized trading profit or loss of the position excluding fees
result.positions[].vegastringrequired
Asset vega (zero for non-options)

Example

{request_example_shell}
{request_example_javascript}
{request_example_python}

The above command returns JSON structured like this:

{response_example_json}