Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/change_margin_model \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "private/change_margin_model",
  "params": {
    "user_id": 3,
    "margin_model": "cross_pm"
  }
}
'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "old_state": {
        "maintenance_margin_rate": 0,
        "initial_margin_rate": 0,
        "available_balance": 0
      },
      "new_state": {
        "maintenance_margin_rate": 0,
        "initial_margin_rate": 0,
        "available_balance": 0
      },
      "currency": "eth"
    },
    {
      "old_state": {
        "maintenance_margin_rate": 0.02862727,
        "initial_margin_rate": 0.45407615,
        "available_balance": 0.553590509
      },
      "new_state": {
        "maintenance_margin_rate": 0.02710204,
        "initial_margin_rate": 0.03252245,
        "available_balance": 0.98106428
      },
      "currency": "btc"
    }
  ]
}

Query Parameters

user_id
integer

Id of a (sub)account - by default current user id is used

Example:

1

margin_model
enum<string>
required

Margin model

Available options:
cross_pm,
cross_sm,
segregated_pm,
segregated_sm
dry_run
boolean

If true request returns the result without switching the margining model. Default: false

Example:

true

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object[]
required
id
integer

The id that was sent in the request