> ## 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/change_margin_model

> Changes the margin model for the authenticated account or a specified subaccount. Margin models determine how margin requirements are calculated (e.g., Standard Margin vs. Portfolio Margin).

Changing the margin model may affect margin requirements, available funds, and trading capabilities. Use the `dry_run` parameter to preview the impact of the change before applying it.

**📖 Related Article:** [Margin types and usage](https://support.deribit.com/hc/en-us/articles/25944811317149-Margin-types-and-usage)

**Scope:** `rat#trade` or `wallet:user:update`

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





## OpenAPI

````yaml /api-reference/coinbase-deribit-app-api/adv-starbase-openapi.json get /private/change_margin_model
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/change_margin_model:
    get:
      tags:
        - Account Management
        - Private
      description: >+
        Changes the margin model for the authenticated account or a specified
        subaccount. Margin models determine how margin requirements are
        calculated (e.g., Standard Margin vs. Portfolio Margin).


        Changing the margin model may affect margin requirements, available
        funds, and trading capabilities. Use the `dry_run` parameter to preview
        the impact of the change before applying it.


        **📖 Related Article:** [Margin types and
        usage](https://support.deribit.com/hc/en-us/articles/25944811317149-Margin-types-and-usage)


        **Scope:** `rat#trade` or `wallet:user:update`


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

      parameters:
        - description: Id of a (sub)account - by default current user id is used
          in: query
          name: user_id
          required: false
          schema:
            example: 1
            type: integer
        - description: Margin model
          in: query
          name: margin_model
          required: true
          schema:
            enum:
              - cross_pm
              - cross_sm
              - segregated_pm
              - segregated_sm
            type: string
        - description: >-
            If `true` request returns the result without switching the margining
            model. Default: `false`
          in: query
          name: dry_run
          required: false
          schema:
            example: true
            type: boolean
      requestBody:
        content:
          application/json:
            examples:
              request:
                description: JSON-RPC Request Example
                value:
                  id: 1
                  jsonrpc: '2.0'
                  method: private/change_margin_model
                  params:
                    margin_model: cross_pm
                    user_id: 3
        description: JSON-RPC request body
      responses:
        '200':
          $ref: '#/components/responses/PrivateChangeMarginModelResponse'
components:
  responses:
    PrivateChangeMarginModelResponse:
      content:
        application/json:
          examples:
            response:
              description: Response example
              value:
                id: 1
                jsonrpc: '2.0'
                result:
                  - currency: eth
                    new_state:
                      available_balance: 0
                      initial_margin_rate: 0
                      maintenance_margin_rate: 0
                    old_state:
                      available_balance: 0
                      initial_margin_rate: 0
                      maintenance_margin_rate: 0
                  - currency: btc
                    new_state:
                      available_balance: 0.98106428
                      initial_margin_rate: 0.03252245
                      maintenance_margin_rate: 0.02710204
                    old_state:
                      available_balance: 0.553590509
                      initial_margin_rate: 0.45407615
                      maintenance_margin_rate: 0.02862727
          schema:
            $ref: '#/components/schemas/PrivateChangeMarginModelResponse'
      description: Success response
  schemas:
    PrivateChangeMarginModelResponse:
      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:
          items:
            properties:
              currency:
                $ref: '#/components/schemas/currency'
              new_state:
                description: Represents portfolio state after change
                properties:
                  available_balance:
                    description: Available balance after change
                    type: number
                  initial_margin_rate:
                    description: Initial margin rate after change
                    type: number
                  maintenance_margin_rate:
                    description: Maintenance margin rate after change
                    type: number
                required:
                  - maintenance_margin_rate
                  - initial_margin_rate
                  - available_balance
                type: object
              old_state:
                description: Represents portfolio state before change
                properties:
                  available_balance:
                    description: Available balance before change
                    type: number
                  initial_margin_rate:
                    description: Initial margin rate before change
                    type: number
                  maintenance_margin_rate:
                    description: Maintenance margin rate before change
                    type: number
                required:
                  - maintenance_margin_rate
                  - initial_margin_rate
                  - available_balance
                type: object
            required:
              - old_state
              - new_state
              - currency
            type: object
          type: array
      required:
        - jsonrpc
        - result
      type: object
    currency:
      description: Currency, i.e `"BTC"`, `"ETH"`, `"USDC"`
      enum:
        - BTC
        - ETH
        - USDC
        - USDT
        - EURR
      type: string

````