Method Name
private/get_positions
private/get_positionsGet active positions of a subaccount
Required minimum session key permission level is read_only
Parameters
subaccount_id integer required Subaccount_id |
Response
id string or integer required |
| result object required |
|
result.
subaccount_id
integer required Subaccount_id |
|
result.
positions
array of objects required All active positions of subaccount |
|
result.positions[].
amount
string required Position amount held by subaccount |
|
result.positions[].
amount_step
string required Minimum amount step for the position |
|
result.positions[].
average_price
string required Average price of whole position |
|
result.positions[].
average_price_excl_fees
string required Average price of whole position excluding fees |
|
result.positions[].
creation_timestamp
integer required Timestamp of when the position was opened (in ms since Unix epoch) |
|
result.positions[].
cumulative_funding
string required Cumulative funding for the position (only for perpetuals). |
|
result.positions[].
delta
string required Asset delta (w.r.t. forward price for options, 1.0 for perps)
|
|
result.positions[].
gamma
string required Asset gamma (zero for non-options) |
|
result.positions[].
index_price
string required Current index (oracle) price for position's currency |
|
result.positions[].
initial_margin
string required USD initial margin requirement for this position |
|
result.positions[].
instrument_name
string required Instrument name (same as the base Asset name) |
result.positions[].
instrument_type
string requirederc20, option, or perpenum erc20 option perp
|
|
result.positions[].
leverage
string or null required Only for perps. Leverage of the position, defined as abs(notional) / collateral net of options margin
|
|
result.positions[].
liquidation_price
string or null required Index price at which position will be liquidated |
|
result.positions[].
maintenance_margin
string required USD maintenance margin requirement for this position |
|
result.positions[].
mark_price
string required Current mark price for position's instrument |
|
result.positions[].
mark_value
string required 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_settlements
string required 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_margin
string required USD margin requirement for all open orders for this asset / instrument |
|
result.positions[].
pending_funding
string required 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_pnl
string required Realized trading profit or loss of the position. |
|
result.positions[].
realized_pnl_excl_fees
string required Realized trading profit or loss of the position excluding fees |
|
result.positions[].
theta
string required Asset theta (zero for non-options) |
|
result.positions[].
total_fees
string required Total fees paid for opening and changing the position |
|
result.positions[].
unrealized_pnl
string required Unrealized trading profit or loss of the position. |
|
result.positions[].
unrealized_pnl_excl_fees
string required Unrealized trading profit or loss of the position excluding fees |
|
result.positions[].
vega
string required 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}