> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# private/pme/simulate

> Calculates the Extended Risk Matrix (ERM) and detailed margin information for Portfolio Margin accounts. The ERM provides a comprehensive view of portfolio risk across different scenarios and market conditions.

You can calculate the ERM for a specific currency or for the entire Cross-Collateral portfolio. The response includes margin requirements, risk metrics, and scenario analysis that helps assess portfolio risk under various market conditions.

Use this method to understand margin requirements and risk exposure before making trading decisions in a Portfolio Margin account.

**📖 Related Article:** [Portfolio Margin](https://support.deribit.com/hc/en-us/articles/25944756247837-Portfolio-Margin)

**Scope:** `rat#view` or `wallet:accounts:read`

[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fpme%2Fsimulate)





## OpenAPI

````yaml /api-reference/coinbase-deribit-app-api/adv-starbase-openapi.json get /private/pme/simulate
openapi: 3.0.0
info:
  description: Coinbase Retail Advanced Trade API for derivatives trading.
  title: Coinbase Retail Advanced Trade (Deribit) API
  version: 2.1.1
servers:
  - url: https://drb.coinbase.com/api/v2
security: []
tags:
  - description: Can only be used over websockets.
    name: WebSocket Only
  - description: Public methods can be used without authentication.
    name: Public
  - description: >-
      <p>Private methods require authentication. All requests must include a
      valid OAuth2 token.</p>

      <p>A token can be requested using the <a
      href="#public-auth">/public/auth</a> method.</p>

      <p>When using the websockets protocol, the token must be included as a
      parameter <code>access_token</code> in the message. When using REST (HTTP
      GET), the token may also be passed in the <code>Authorization</code>
      header.</p>
    name: Private
  - name: Authentication
  - name: Session Management
  - description: >-
      Subscription works as [notifications](#notifications), so users will
      automatically (after subscribing) receive messages from the server.
      Overview for each channel response format is described in
      [subscriptions](#subscriptions) section.
    name: Subscription Management
  - name: Account Management
  - name: Trading
  - name: Market Data
paths:
  /private/pme/simulate:
    get:
      tags:
        - Account Management
        - Private
      description: >+
        Calculates the Extended Risk Matrix (ERM) and detailed margin
        information for Portfolio Margin accounts. The ERM provides a
        comprehensive view of portfolio risk across different scenarios and
        market conditions.


        You can calculate the ERM for a specific currency or for the entire
        Cross-Collateral portfolio. The response includes margin requirements,
        risk metrics, and scenario analysis that helps assess portfolio risk
        under various market conditions.


        Use this method to understand margin requirements and risk exposure
        before making trading decisions in a Portfolio Margin account.


        **📖 Related Article:** [Portfolio
        Margin](https://support.deribit.com/hc/en-us/articles/25944756247837-Portfolio-Margin)


        **Scope:** `rat#view` or `wallet:accounts:read`


        [Try in API
        console](https://test.deribit.com/api_console?method=%2Fprivate%2Fpme%2Fsimulate)

      parameters:
        - description: >-
            The currency for which the Extended Risk Matrix will be calculated.
            Use `CROSS` for Cross Collateral simulation.
          in: query
          name: currency
          required: true
          schema:
            $ref: '#/components/schemas/pme_currency'
            example: BTC
        - description: >-
            If `true`, adds simulated positions to current positions, otherwise
            uses only simulated positions. By default `true`
          in: query
          name: add_positions
          required: false
          schema:
            type: boolean
        - description: >-
            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.
          in: query
          name: simulated_positions
          required: false
          schema:
            description: 'JSON string containing: object data'
            type: string
      requestBody:
        content:
          application/json:
            examples:
              request:
                description: JSON-RPC Request Example
                value:
                  id: 2255
                  jsonrpc: '2.0'
                  method: private/pme/simulate
                  params:
                    currency: BTC
        description: JSON-RPC request body
      responses:
        '200':
          $ref: '#/components/responses/PrivatePmeSimulateResponse'
components:
  schemas:
    pme_currency:
      description: >-
        The currency for which the Extended Risk Matrix will be calculated. Use
        `CROSS` for Cross Collateral simulation.
      enum:
        - BTC
        - ETH
        - USDC
        - USDT
        - CROSS
      type: string
    PrivatePmeSimulateResponse:
      properties:
        id:
          description: The id that was sent in the request
          type: integer
        jsonrpc:
          description: The JSON-RPC version (2.0)
          enum:
            - '2.0'
          type: string
        result:
          description: Simulation details
          type: object
      required:
        - jsonrpc
        - result
      type: object
  responses:
    PrivatePmeSimulateResponse:
      content:
        application/json:
          examples:
            response:
              description: Response example
              value:
                id: 2255
                jsonrpc: '2.0'
                result:
                  aggregated_risk_vectors:
                    btc_btc:
                      extended:
                        - 0
                        - 0
                        - 0
                        - 0
                        - 0
                        - 0
                        - 0
                        - 0
                      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
                  index_price:
                    btc_usd: 65666.19
                  initial_risk_vectors:
                    BTC-28JUN24:
                      extended:
                        - 0.0002261969523809524
                        - 0.0002261969523809524
                        - -0.0001637977931034483
                        - -0.0001637977931034483
                        - -0.0001637977931034483
                        - -0.0001637977931034483
                        - -0.0001637977931034483
                        - -0.0001637977931034483
                      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
                    BTC-PERPETUAL:
                      extended:
                        - -0.05991206933333334
                        - -0.05991206933333334
                        - 0.04338460193103449
                        - 0.04338460193103449
                        - 0.04338460193103449
                        - 0.04338460193103449
                        - 0.04338460193103449
                        - 0.04338460193103449
                      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
                  margins:
                    btc:
                      initial_margin: 0.122861343
                      initial_margin_details:
                        mmp_margin: 0.06
                        open_orders_margin: 0.000018212
                        risk_matrix_margin: 0.06284313098
                        risk_matrix_margin_details:
                          correlation_contingency: 0
                          delta_shock: 0
                          roll_shock: 0.00315725898
                          worst_case: 0.05968587238095239
                          worst_case_bucket:
                            bucket: 1
                            index: 1
                            side: left
                            source: standard
                        spot_margin: 0
                      maintenance_margin: 0.050274504784
                  model_params:
                    currency:
                      btc:
                        annualised_move_risk: 0.075
                        correlation_set: false
                        equity_side_impact: both
                        extended_dampener: 100000
                        haircut: 0
                        max_offsetable_pnl: 0
                        min_annualised_move: 0.01
                        pnl_offset: 0
                      usd:
                        annualised_move_risk: 0.1
                        correlation_set: false
                        equity_side_impact: none
                        extended_dampener: 25000
                        haircut: 0
                        max_offsetable_pnl: 0
                        min_annualised_move: 0.01
                        pnl_offset: 0
                    currency_pair:
                      btc_usd:
                        delta_total_liq_shock_threshold: 20000000
                        extended_table_factor: 1
                        long_term_vega_power: 0.13
                        m_inc: 0.00005
                        max_delta_shock: 0.1
                        min_volatility_for_shock_up: 0.5
                        price_range: 0.16
                        short_term_vega_power: 0.3
                        volatility_range_down: 0.25
                        volatility_range_up: 0.5
                    general:
                      buckets_count: 4
                      mm_factor: 0.8
                      timestamp: 1718619740501
                      vol_scenarios_count: 3
                  portfolio:
                    currency: {}
                    position:
                      BTC-28JUN24: -0.001187534
                      BTC-PERPETUAL: 0.314538364
                  ticker:
                    BTC-28JUN24:
                      index_price: 65666.19
                      mark_price: 67371.75
                    BTC-PERPETUAL:
                      index_price: 65666.19
                      mark_price: 65910.57
          schema:
            $ref: '#/components/schemas/PrivatePmeSimulateResponse'
      description: Success response

````