Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/pme/simulate \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 2255,
  "method": "private/pme/simulate",
  "params": {
    "currency": "BTC"
  }
}
'
import requests

url = "https://test.deribit.com/api/v2/private/pme/simulate"

payload = {
"jsonrpc": "2.0",
"id": 2255,
"method": "private/pme/simulate",
"params": { "currency": "BTC" }
}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 2255,
method: 'private/pme/simulate',
params: {currency: 'BTC'}
})
};

fetch('https://test.deribit.com/api/v2/private/pme/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://test.deribit.com/api/v2/private/pme/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 2255,
'method' => 'private/pme/simulate',
'params' => [
'currency' => 'BTC'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://test.deribit.com/api/v2/private/pme/simulate"

payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 2255,\n \"method\": \"private/pme/simulate\",\n \"params\": {\n \"currency\": \"BTC\"\n }\n}")

req, _ := http.NewRequest("GET", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://test.deribit.com/api/v2/private/pme/simulate")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 2255,\n \"method\": \"private/pme/simulate\",\n \"params\": {\n \"currency\": \"BTC\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://test.deribit.com/api/v2/private/pme/simulate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 2255,\n \"method\": \"private/pme/simulate\",\n \"params\": {\n \"currency\": \"BTC\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "id": 2255,
  "result": {
    "model_params": {
      "currency_pair": {
        "btc_usd": {
          "extended_table_factor": 1,
          "m_inc": 0.00005,
          "min_volatility_for_shock_up": 0.5,
          "max_delta_shock": 0.1,
          "delta_total_liq_shock_threshold": 20000000,
          "volatility_range_down": 0.25,
          "volatility_range_up": 0.5,
          "long_term_vega_power": 0.13,
          "short_term_vega_power": 0.3,
          "price_range": 0.16
        }
      },
      "currency": {
        "usd": {
          "max_offsetable_pnl": 0,
          "annualised_move_risk": 0.1,
          "extended_dampener": 25000,
          "min_annualised_move": 0.01,
          "haircut": 0,
          "equity_side_impact": "none",
          "pnl_offset": 0,
          "correlation_set": false
        },
        "btc": {
          "max_offsetable_pnl": 0,
          "annualised_move_risk": 0.075,
          "extended_dampener": 100000,
          "min_annualised_move": 0.01,
          "haircut": 0,
          "equity_side_impact": "both",
          "pnl_offset": 0,
          "correlation_set": false
        }
      },
      "general": {
        "mm_factor": 0.8,
        "buckets_count": 4,
        "vol_scenarios_count": 3,
        "timestamp": 1718619740501
      }
    },
    "aggregated_risk_vectors": {
      "btc_btc": {
        "standard": [
          -0.05968587238095239,
          -0.05968587238095239,
          -0.05968587238095239,
          -0.04272965863636364,
          -0.04272965863636364,
          -0.04272965863636364,
          -0.02724789826086957,
          -0.02724789826086957,
          -0.02724789826086957,
          -0.013056284583333334,
          -0.013056284583333334,
          -0.013056284583333334,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "extended": [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ]
      }
    },
    "initial_risk_vectors": {
      "BTC-PERPETUAL": {
        "standard": [
          -0.05991206933333334,
          -0.05991206933333334,
          -0.05991206933333334,
          -0.04289159509090909,
          -0.04289159509090909,
          -0.04289159509090909,
          -0.027351162086956524,
          -0.027351162086956524,
          -0.027351162086956524,
          -0.013105765166666668,
          -0.013105765166666668,
          -0.013105765166666668,
          0,
          0,
          0,
          0.012097629384615385,
          0.012097629384615385,
          0.012097629384615385,
          0.023299138074074074,
          0.023299138074074074,
          0.023299138074074074,
          0.033700538999999995,
          0.033700538999999995,
          0.033700538999999995,
          0.043384601931034494,
          0.043384601931034494,
          0.043384601931034494
        ],
        "extended": [
          -0.05991206933333334,
          -0.05991206933333334,
          0.04338460193103449,
          0.04338460193103449,
          0.04338460193103449,
          0.04338460193103449,
          0.04338460193103449,
          0.04338460193103449
        ]
      },
      "BTC-28JUN24": {
        "standard": [
          0.0002261969523809524,
          0.0002261969523809524,
          0.0002261969523809524,
          0.00016193645454545456,
          0.00016193645454545456,
          0.00016193645454545456,
          0.00010326382608695652,
          0.00010326382608695652,
          0.00010326382608695652,
          0.00004948058333333334,
          0.00004948058333333334,
          0.00004948058333333334,
          0,
          0,
          0,
          -0.00004567438461538462,
          -0.00004567438461538462,
          -0.00004567438461538462,
          -0.00008796548148148148,
          -0.00008796548148148148,
          -0.00008796548148148148,
          -0.0001272357857142857,
          -0.0001272357857142857,
          -0.0001272357857142857,
          -0.00016379779310344832,
          -0.00016379779310344832,
          -0.00016379779310344832
        ],
        "extended": [
          0.0002261969523809524,
          0.0002261969523809524,
          -0.0001637977931034483,
          -0.0001637977931034483,
          -0.0001637977931034483,
          -0.0001637977931034483,
          -0.0001637977931034483,
          -0.0001637977931034483
        ]
      }
    },
    "margins": {
      "btc": {
        "initial_margin_details": {
          "risk_matrix_margin_details": {
            "delta_shock": 0,
            "roll_shock": 0.00315725898,
            "worst_case_bucket": {
              "bucket": 1,
              "side": "left",
              "source": "standard",
              "index": 1
            },
            "worst_case": 0.05968587238095239,
            "correlation_contingency": 0
          },
          "risk_matrix_margin": 0.06284313098,
          "spot_margin": 0,
          "mmp_margin": 0.06,
          "open_orders_margin": 0.000018212
        },
        "initial_margin": 0.122861343,
        "maintenance_margin": 0.050274504784
      }
    },
    "portfolio": {
      "currency": {},
      "position": {
        "BTC-PERPETUAL": 0.314538364,
        "BTC-28JUN24": -0.001187534
      }
    },
    "index_price": {
      "btc_usd": 65666.19
    },
    "ticker": {
      "BTC-PERPETUAL": {
        "mark_price": 65910.57,
        "index_price": 65666.19
      },
      "BTC-28JUN24": {
        "mark_price": 67371.75,
        "index_price": 65666.19
      }
    }
  }
}

Query Parameters

currency
enum<string>
required

The currency for which the Extended Risk Matrix will be calculated. Use CROSS for Cross Collateral simulation.

Available options:
BTC,
ETH,
USDC,
USDT,
CROSS
Example:

"BTC"

add_positions
boolean

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

simulated_positions
string

Object with positions in following form: {InstrumentName1: Position1, InstrumentName2: Position2...}, for example {"BTC-PERPETUAL": -1.0} (or corresponding URI-encoding for GET). Size in base currency. JSON string containing: object data

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object
required

Simulation details

id
integer

The id that was sent in the request