v3

latestOpenAPI 3.0.02026-07-311784111.3 MB
Account Management
Private

Calculates portfolio margin requirements and risk metrics for simulated positions or the current portfolio. This method helps you understand margin requirements before opening new positions or assess the impact of potential trades.

You can simulate adding new positions to the current portfolio or calculate margin for a completely simulated portfolio. The response includes initial margin, maintenance margin, available funds, and other risk metrics.

Note: This method has a restricted rate limit of not more than once per second due to the computational complexity of portfolio margin calculations.

📖 Related Article: Portfolio Margin

Scope: account:read

Try in API console

get/private/simulate_portfolio

Query parameters

currency'BTC' | 'ETH' | 'USDC' | 'USDT' | 'EURR' required

Currency, i.e "BTC", "ETH", "USDC"

The currency symbol

add_positionsboolean

If true, adds simulated positions to current positions, otherwise uses only simulated positions. By default true

simulated_positionsstring

JSON string containing: object data

Object with positions in following form: {InstrumentName1: Position1, InstrumentName2: Position2...}, for example {"BTC-PERPETUAL": -1000.0} (or corresponding URI-encoding for GET). For futures in USD, for options in base currency.

Response

Success response

jsonrpc'2.0' required

The JSON-RPC version (2.0)

idinteger

The id that was sent in the request

Example response

{
  "result": {
    "currency": "BTC",
    "equity": 150075253.91354558,
    "balance": 150076473.4995114,
    "margin_balance": 153534213.79481918,
    "initial_margin": 37662472.03416069,
    "maintenance_margin": 30129215.84817124,
    "projected_initial_margin": 1,
    "projected_maintenance_margin": 1,
    "available_funds": 115871741.76065847,
    "available_withdrawal_funds": 115871741.76065847,
    "total_pl": 40419.10179263,
    "session_rpl": 0.1,
    "session_upl": 0.846863,
    "futures_pl": 39497.54616685,
    "futures_session_rpl": 1.309136,
    "futures_session_upl": -164.48253509,
    "options_pl": 921.55562578,
    "options_session_upl": -174.67960675,
    "options_value": -1056.41256672,
    "options_delta": 2883.38481,
    "options_gamma": -0.03907,
    "options_theta": 142583.29246,
    "options_vega": -39322.23046,
    "delta_total": 0.1334,
    "projected_delta_total": 0.1334,
    "additional_reserve": 0.3,
    "margin_model": "cross_pm",
    "portfolio_margining_enabled": true,
    "cross_collateral_enabled": true,
    "total_equity_usd": 13075634611389.318,
    "total_initial_margin_usd": 3139528603778.822,
    "total_maintenance_margin_usd": 2511559381417.215,
    "total_margin_balance_usd": 12798550648250.61,
    "total_delta_total_usd": 6157454218.3753195
  }
}