curl --request GET \
--url https://test.deribit.com/api/v2/private/simulate_portfolio \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 22222,
"method": "private/simulate_portfolio",
"params": {
"currency": "BTC",
"add_positions": true,
"simulated_positions": {
"BTC-PERPETUAL": 1
}
}
}
'{
"jsonrpc": "2.0",
"id": 2,
"result": {
"projected_initial_margin": 37662472.03416069,
"initial_margin": 37662472.03416069,
"total_pl": 40419.10179263,
"additional_reserve": 0,
"available_withdrawal_funds": 115871741.76065847,
"options_pl": 921.55562578,
"delta_total_map": {
"btc_usd": 68024.519462366
},
"available_subaccount_transfer_funds": 0,
"projected_delta_total": 69080.932029,
"projected_maintenance_margin": 30129215.84817124,
"total_equity_usd": 13075634611389.318,
"options_gamma": -0.03907,
"currency": "BTC",
"options_theta": 142583.29246,
"spot_reserve": 0,
"total_initial_margin_usd": 3139528603778.822,
"options_vega": -39322.23046,
"margin_balance": 153534213.79481918,
"futures_session_rpl": 1.309136,
"options_gamma_map": {
"btc_usd": -0.03907
},
"available_funds": 115871741.76065847,
"futures_pl": 39497.54616685,
"cross_collateral_enabled": true,
"delta_total": 69080.932029,
"options_session_rpl": 0,
"total_margin_balance_usd": 12798550648250.61,
"options_value": -1056.41256672,
"options_session_upl": -174.67960675,
"maintenance_margin": 30129215.84817124,
"total_maintenance_margin_usd": 2511559381417.215,
"options_vega_map": {
"btc_usd": -39322.23046
},
"session_rpl": 1.309136,
"locked_balance": 0,
"session_upl": -339.16214185,
"margin_model": "cross_pm",
"portfolio_margining_enabled": true,
"equity": 150075253.91354558,
"balance": 150076473.4995114,
"total_delta_total_usd": 6157454218.3753195,
"fee_balance": 0,
"options_delta": 2883.38481,
"options_theta_map": {
"btc_usd": 142583.29246
},
"futures_session_upl": -164.48253509
},
"usIn": 1742210019774525,
"usOut": 1742210019788175,
"usDiff": 13650,
"testnet": true
}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
curl --request GET \
--url https://test.deribit.com/api/v2/private/simulate_portfolio \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 22222,
"method": "private/simulate_portfolio",
"params": {
"currency": "BTC",
"add_positions": true,
"simulated_positions": {
"BTC-PERPETUAL": 1
}
}
}
'{
"jsonrpc": "2.0",
"id": 2,
"result": {
"projected_initial_margin": 37662472.03416069,
"initial_margin": 37662472.03416069,
"total_pl": 40419.10179263,
"additional_reserve": 0,
"available_withdrawal_funds": 115871741.76065847,
"options_pl": 921.55562578,
"delta_total_map": {
"btc_usd": 68024.519462366
},
"available_subaccount_transfer_funds": 0,
"projected_delta_total": 69080.932029,
"projected_maintenance_margin": 30129215.84817124,
"total_equity_usd": 13075634611389.318,
"options_gamma": -0.03907,
"currency": "BTC",
"options_theta": 142583.29246,
"spot_reserve": 0,
"total_initial_margin_usd": 3139528603778.822,
"options_vega": -39322.23046,
"margin_balance": 153534213.79481918,
"futures_session_rpl": 1.309136,
"options_gamma_map": {
"btc_usd": -0.03907
},
"available_funds": 115871741.76065847,
"futures_pl": 39497.54616685,
"cross_collateral_enabled": true,
"delta_total": 69080.932029,
"options_session_rpl": 0,
"total_margin_balance_usd": 12798550648250.61,
"options_value": -1056.41256672,
"options_session_upl": -174.67960675,
"maintenance_margin": 30129215.84817124,
"total_maintenance_margin_usd": 2511559381417.215,
"options_vega_map": {
"btc_usd": -39322.23046
},
"session_rpl": 1.309136,
"locked_balance": 0,
"session_upl": -339.16214185,
"margin_model": "cross_pm",
"portfolio_margining_enabled": true,
"equity": 150075253.91354558,
"balance": 150076473.4995114,
"total_delta_total_usd": 6157454218.3753195,
"fee_balance": 0,
"options_delta": 2883.38481,
"options_theta_map": {
"btc_usd": 142583.29246
},
"futures_session_upl": -164.48253509
},
"usIn": 1742210019774525,
"usOut": 1742210019788175,
"usDiff": 13650,
"testnet": true
}The currency symbol
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, USDC, USDT, EURR "BTC"
If true, adds simulated positions to current positions, otherwise uses only simulated positions. By default true
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.
JSON string containing: object data
Success response
The JSON-RPC version (2.0)
2.0 Portfolio margin simulation result
Hide child attributes
Currency of the simulation
"BTC"
The account's current equity
150075253.91354558
The account's balance
150076473.4995114
The account's margin balance. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
153534213.79481918
The account's initial margin. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
37662472.03416069
The maintenance margin. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
30129215.84817124
Projected initial margin. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
1
Projected maintenance margin. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
1
The account's available funds. When cross collateral is enabled, this aggregated value is calculated by converting the sum of each cross collateral currency's value to the given currency, using each cross collateral currency's index.
115871741.76065847
The account's available to withdrawal funds
115871741.76065847
The account's available funds for subaccount transfers
0
Profit and loss
40419.10179263
Session realized profit and loss
0.1
Session unrealized profit and loss
0.846863
Futures profit and loss
39497.54616685
Futures session realized profit and loss
1.309136
Futures session unrealized profit and loss
-164.48253509
Options profit and loss
921.55562578
Options session realized profit and loss
0
Options session unrealized profit and loss
-174.67960675
Options value
-1056.41256672
Options summary delta
2883.38481
Options summary gamma
-0.03907
Options summary theta
142583.29246
Options summary vega
-39322.23046
Map of options' gammas per index
Map of options' thetas per index
Map of options' vegas per index
The sum of position deltas.
DeltaTotal = Net Transaction Delta of options + BTC Position of Futures
The DeltaTotal uses the Net Transaction Delta (or price adjusted Delta) of the options, where Net Transaction Delta = Black Scholes Delta - Mark Price of Options.
This is because, from a risk perspective, we are interested in the change in Bitcoin price as the underlying changes.
You should actually treat your delta as Equity + Delta Total if you want to have less risk for your USD PnL.
โ ๏ธ During the 30 minute settlement period we decay your Delta. See Delta decay during settlement for more details.
0.1334
Map of total deltas per index
The sum of position deltas without positions that will expire during closest expiration
0.1334
The account's balance reserved in other orders
0.3
The account's balance reserved in active spot orders
0
The account's fee balance (it can be used to pay for fees)
The account's locked balance
0
Name of user's currently enabled margin model
"cross_pm"
true when portfolio margining is enabled for user
true
When true cross collateral is enabled for user
true
Optional (only for users using cross margin). The account's total equity in all cross collateral currencies, expressed in USD
13075634611389.318
Optional (only for users using cross margin). The account's total initial margin in all cross collateral currencies, expressed in USD
3139528603778.822
Optional (only for users using cross margin). The account's total maintenance margin in all cross collateral currencies, expressed in USD
2511559381417.215
Optional (only for users using cross margin). The account's total margin balance in all cross collateral currencies, expressed in USD
12798550648250.61
Optional (only for users using cross margin). The account's total delta total in all cross collateral currencies, expressed in USD
6157454218.3753195
The id that was sent in the request
Was this page helpful?