HomeDocumentationAPI Reference
Log In
API Reference

Get All Portfolios

Method Name

private/get_all_portfolios

Get all portfolios of a wallet
Required minimum session key permission level is read_only

Parameters

walletstringrequired
Wallet address

Response

idstring or integerrequired
resultarray of objectsrequired
result[].collaterals_initial_marginstringrequired
Total initial margin credit contributed by collaterals
result[].collaterals_maintenance_marginstringrequired
Total maintenance margin credit contributed by collaterals
result[].collaterals_valuestringrequired
Total mark-to-market value of all collaterals
result[].currencystringrequired
Currency of subaccount
result[].initial_marginstringrequired
Total initial margin requirement of all positions and collaterals.Trades will be rejected if this value falls below zero after the trade.
result[].is_under_liquidationbooleanrequired
Whether the subaccount is undergoing a liquidation auction
result[].labelstringrequired
User defined label
result[].maintenance_marginstringrequired
Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation.
result[].margin_typestringrequired
Margin type of subaccount (PM (Portfolio Margin), PM2 (Portfolio Margin 2), or SM (Standard Margin))
enum PMSMPM2
result[].open_orders_marginstringrequired
Total margin requirement of all open orders.Orders will be rejected if this value plus initial margin are below zero after the order.
result[].positions_initial_marginstringrequired
Total initial margin requirement of all positions
result[].positions_maintenance_marginstringrequired
Total maintenance margin requirement of all positions
result[].positions_valuestringrequired
Total mark-to-market value of all positions
result[].projected_margin_changestringrequired
Projected change in maintenance margin requirement between now and projected margin at 8:01 UTC. If this value plus current maintenance margin ise below zero, the account is at risk of being flagged for liquidation right after the upcoming expiry.
result[].subaccount_idintegerrequired
Subaccount_id
result[].subaccount_valuestringrequired
Total mark-to-market value of all positions and collaterals
result[].collateralsarray of objectsrequired
All collaterals that count towards margin of subaccount
result[].collaterals[].amountstringrequired
Asset amount of given collateral
result[].collaterals[].amount_stepstringrequired
Minimum amount step for the collateral
result[].collaterals[].asset_namestringrequired
Asset name
result[].collaterals[].asset_typestringrequired
Type of asset collateral (currently always erc20)
enum erc20optionperp
result[].collaterals[].average_pricestringrequired
Average price of the collateral, 0 for USDC.
result[].collaterals[].average_price_excl_feesstringrequired
Average price of whole position excluding fees
result[].collaterals[].creation_timestampintegerrequired
Timestamp of when the position was opened (in ms since Unix epoch)
result[].collaterals[].cumulative_intereststringrequired
Cumulative interest earned on supplying collateral or paid for borrowing
result[].collaterals[].currencystringrequired
Underlying currency of asset (ETH, BTC, etc)
result[].collaterals[].deltastringrequired
Asset delta w.r.t. the delta currency
result[].collaterals[].delta_currencystringrequired
Currency with respect to which delta is reported.For example, LRTs like WEETH have their delta reported in ETH
result[].collaterals[].initial_marginstringrequired
USD value of collateral that contributes to initial margin
result[].collaterals[].maintenance_marginstringrequired
USD value of collateral that contributes to maintenance margin
result[].collaterals[].mark_pricestringrequired
Current mark price of the asset
result[].collaterals[].mark_valuestringrequired
USD value of the collateral (amount * mark price)
result[].collaterals[].open_orders_marginstringrequired
USD margin requirement for all open orders for this asset / instrument
result[].collaterals[].pending_intereststringrequired
Portion of interest that has not yet been settled on-chain. This number is added to the portfolio value for margin calculations purposes.
result[].collaterals[].realized_pnlstringrequired
Realized trading profit or loss of the collateral, 0 for USDC.
result[].collaterals[].realized_pnl_excl_feesstringrequired
Realized trading profit or loss of the position excluding fees
result[].collaterals[].total_feesstringrequired
Total fees paid for opening and changing the position
result[].collaterals[].unrealized_pnlstringrequired
Unrealized trading profit or loss of the collateral, 0 for USDC.
result[].collaterals[].unrealized_pnl_excl_feesstringrequired
Unrealized trading profit or loss of the position excluding fees
result[].open_ordersarray of objectsrequired
All open orders of subaccount
result[].open_orders[].amountstringrequired
Order amount in units of the base
result[].open_orders[].average_pricestringrequired
Average fill price
result[].open_orders[].cancel_reasonstringrequired
If cancelled, reason behind order cancellation
enum user_requestmmp_triggerinsufficient_marginsigned_max_fee_too_lowcancel_on_disconnectioc_or_market_partial_fillsession_key_deregisteredsubaccount_withdrawncompliancetrigger_failedvalidation_failedalgo_completed
result[].open_orders[].creation_timestampintegerrequired
Creation timestamp (in ms since Unix epoch)
result[].open_orders[].directionstringrequired
Order direction
enum buysell
result[].open_orders[].filled_amountstringrequired
Total filled amount for the order
result[].open_orders[].instrument_namestringrequired
Instrument name
result[].open_orders[].is_transferbooleanrequired
Whether the order was generated through private/transfer_position
result[].open_orders[].labelstringrequired
Optional user-defined label for the order
result[].open_orders[].last_update_timestampintegerrequired
Last update timestamp (in ms since Unix epoch)
result[].open_orders[].limit_pricestringrequired
Limit price in quote currency
result[].open_orders[].max_feestringrequired
Max fee PER contract, denominated in USDC.Max fee must be > 2 x max(taker_fee, maker_fee) x spot_price + extra_fee / amount.If the order crosses the book, it must be >= 2 x max(taker_fee, maker_fee) x spot_price + base_fee / fill_amount + extra_fee / amount.Note, in this calculation, regardless of the account taker / maker fees, the standard taker / maker fees are used.
result[].open_orders[].mmpbooleanrequired
Whether the order is tagged for market maker protections
result[].open_orders[].nonceintegerrequired
Unique nonce defined as (UTC_timestamp in ms)(random_number_up_to_3_digits) (e.g. 1695836058725001, where 001 is the random number)
result[].open_orders[].order_feestringrequired
Order fee paid so far
result[].open_orders[].order_idstringrequired
Order ID
result[].open_orders[].order_statusstringrequired
Order status
enum openfilledcancelledexpireduntriggeredalgo_active
result[].open_orders[].order_typestringrequired
Order type
enum limitmarket
result[].open_orders[].quote_idstring or nullrequired
Quote ID if the trade was executed via RFQ
result[].open_orders[].signaturestringrequired
Ethereum signature of the order
result[].open_orders[].signature_expiry_secintegerrequired
Signature expiry timestamp
result[].open_orders[].signerstringrequired
Owner wallet address or registered session key that signed order
result[].open_orders[].subaccount_idintegerrequired
Subaccount ID
result[].open_orders[].time_in_forcestringrequired
Time in force
enum gtcpost_onlyfokioc
result[].open_orders[].algo_duration_secinteger or null
Total execution window in seconds
result[].open_orders[].algo_num_slicesinteger or null
Number of child executions
result[].open_orders[].algo_slices_completedinteger or null
Number of slices executed so far
result[].open_orders[].algo_typestring or null
Algo order type (twap or vwap)
enum twap
result[].open_orders[].extra_feestring or null
(Optional) Extra fee in USDC added to the total final fee paid by user (must be between 0.000001 and 1,000 USDC).
result[].open_orders[].replaced_order_idstring or null
If replaced, ID of the order that was replaced
result[].open_orders[].signed_limit_pricestring or null
The original limit price that the user signed. Only set when the order was adjusted (i.e., for post-only orders with reject_post_only=false that would have crossed). Used for on-chain submission.
result[].open_orders[].trigger_pricestring or null
(Required for trigger orders) Index or Market price to trigger order at
result[].open_orders[].trigger_price_typestring or null
(Required for trigger orders) Trigger with Index or Mark Price
enum markindex
result[].open_orders[].trigger_reject_messagestring or null
(Required for trigger orders) Error message if error occured during trigger
result[].open_orders[].trigger_typestring or null
(Required for trigger orders) Stop-loss or Take-profit.
enum stoplosstakeprofit
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}