openapi: 3.0.0
info:
title: Deribit Account Management API
version: 2.1.1
servers:
- url: https://test.deribit.com/api/v2
tags:
- name: Account Management
paths:
/private/get_positions:
get:
tags:
- Account Management
parameters:
- name: currency
in: query
schema:
$ref: '#/components/schemas/currency_with_any'
example: BTC
required: false
- name: kind
in: query
schema:
$ref: '#/components/schemas/kind_without_spot'
example: future
description: Kind filter on positions
required: false
- name: subaccount_id
in: query
schema:
type: integer
required: false
description: The user id for the subaccount
responses:
'200':
$ref: '#/components/responses/PrivateGetPositionsResponse'
'400':
$ref: '#/components/responses/ErrorMessageResponse'
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 2236
method: private/get_positions
params:
currency: BTC
kind: future
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves all open positions for the authenticated account. Returns position details including size, average entry price, mark price, unrealized P&L, initial margin, maintenance margin, and other position-related information.
Results can be filtered by currency and instrument kind (future, option, etc.). To retrieve positions for a specific subaccount, use the `subaccount_id` parameter.
**Scope:** `trade:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_positions)
'
x-mint:
metadata:
title: private/get_positions
og:title: private/get_positions
keywords:
- private/get_positions
- currency
- kind
- subaccount_id
- instrument_name
- average_price
- direction
- mark_price
- delta
- gamma
- vega
- theta
- index_price
- initial_margin
- maintenance_margin
- settlement_price
- total_profit_loss
- floating_profit_loss
- realized_profit_loss
- size
- size_currency
- average_price_usd
- floating_profit_loss_usd
- leverage
- realized_funding
- interest_value
- estimated_liquidation_price
- open_orders_margin
href: /api-reference/account-management/private-get_positions
/private/get_position:
get:
tags:
- Account Management
parameters:
- name: instrument_name
required: true
in: query
schema:
$ref: '#/components/schemas/instrument_name'
description: Instrument name
responses:
'200':
$ref: '#/components/responses/PrivateGetPositionResponse'
'400':
$ref: '#/components/responses/ErrorMessageResponse'
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 404
method: private/get_position
params:
instrument_name: BTC-PERPETUAL
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves the open position for a specific instrument. Returns detailed position information including size, average entry price, mark price, unrealized P&L, initial margin, maintenance margin, and other position-related metrics.
If no position exists for the specified instrument, the response will indicate a zero position.
**Scope:** `trade:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_position)
'
x-mint:
metadata:
title: private/get_position
og:title: private/get_position
keywords:
- private/get_position
- instrument_name
- kind
- average_price
- direction
- mark_price
- delta
- gamma
- vega
- theta
- index_price
- initial_margin
- maintenance_margin
- settlement_price
- total_profit_loss
- floating_profit_loss
- realized_profit_loss
- size
- size_currency
- average_price_usd
- floating_profit_loss_usd
- leverage
- realized_funding
- interest_value
- estimated_liquidation_price
- open_orders_margin
href: /api-reference/account-management/private-get_position
/private/get_account_summary:
get:
parameters:
- name: currency
required: true
in: query
schema:
$ref: '#/components/schemas/wallet_currency'
description: The currency symbol
- name: subaccount_id
in: query
schema:
type: integer
required: false
description: The user id for the subaccount
- in: query
name: extended
required: false
schema:
example: true
type: boolean
description: Include additional fields
responses:
'200':
$ref: '#/components/responses/PrivateAccountResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 2515
method: private/get_account_summary
params:
currency: BTC
extended: true
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves the account summary for a specific currency. The summary includes balance, equity, available funds, initial margin, maintenance margin, and other margin-related information.
To retrieve the summary for a specific subaccount, use the `subaccount_id` parameter. When the `extended` parameter is set to `true`, additional account details such as account ID, username, email, and account type are included.
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_account_summary)
'
x-mint:
metadata:
title: private/get_account_summary
og:title: private/get_account_summary
keywords:
- private/get_account_summary
- currency
- subaccount_id
- extended
- total_pl
- session_rpl
- session_upl
- available_funds
- available_withdrawal_funds
- margin_balance
- balance
- spot_reserve
- additional_reserve
- fee_balance
- fee_group
- delta_total
- projected_delta_total
- deposit_address
- email
- equity
- futures_pl
- futures_session_rpl
- futures_session_upl
- initial_margin
- maintenance_margin
- estimated_liquidation_ratio
- system_name
- options_delta
- options_gamma
- options_pl
- options_session_rpl
- options_session_upl
- options_theta
- options_value
- options_vega
- options_gamma_map
- options_theta_map
- options_vega_map
- security_keys_enabled
- mmp_enabled
- projected_initial_margin
- projected_maintenance_margin
- username
- type
- login_enabled
- portfolio_margining_enabled
- cross_collateral_enabled
- margin_model
- total_equity_usd
- total_initial_margin_usd
- total_maintenance_margin_usd
- total_margin_balance_usd
- total_delta_total_usd
- interuser_transfers_enabled
- referrer_id
- limits
- creation_timestamp
- has_non_block_chain_equity
- self_trading_reject_mode
- self_trading_extended_to_subaccounts
- fees
- affiliate_promotion_fee
- trading_products_details
- receive_notifications
- is_direct_access_allowed
href: /api-reference/account-management/private-get_account_summary
/private/get_account_summaries:
get:
parameters:
- name: subaccount_id
in: query
schema:
type: integer
required: false
description: The user id for the subaccount
- in: query
name: extended
required: false
schema:
example: true
type: boolean
description: Include additional fields
responses:
'200':
$ref: '#/components/responses/PrivateAccountSummariesResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 2515
method: private/get_account_summaries
params:
extended: true
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves a per-currency list of account summaries for the authenticated user. Each summary includes balance, equity, available funds, and margin information for each currency.
To retrieve summaries for a specific subaccount, use the `subaccount_id` parameter. When the `extended` parameter is set to `true`, additional account details such as account ID, username, email, and account type are included.
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_account_summaries)
'
x-mint:
metadata:
title: private/get_account_summaries
og:title: private/get_account_summaries
keywords:
- private/get_account_summaries
- subaccount_id
- extended
- system_name
- username
- type
- login_enabled
- email
- security_keys_enabled
- mmp_enabled
- interuser_transfers_enabled
- referrer_id
- creation_timestamp
- self_trading_reject_mode
- self_trading_extended_to_subaccounts
- block_rfq_self_match_prevention
- affiliate_promotion_fee
- trading_products_details
- receive_notifications
- summaries
- total_pl
- session_rpl
- session_upl
- available_funds
- available_withdrawal_funds
- margin_balance
- balance
- spot_reserve
- additional_reserve
- fee_balance
- fee_group
- currency
- delta_total
- projected_delta_total
- deposit_address
- equity
- futures_pl
- futures_session_rpl
- futures_session_upl
- initial_margin
- maintenance_margin
- estimated_liquidation_ratio
- options_delta
- options_gamma
- options_pl
- options_session_rpl
- options_session_upl
- options_theta
- options_value
- options_vega
- options_gamma_map
- options_theta_map
- options_vega_map
- projected_initial_margin
- projected_maintenance_margin
- portfolio_margining_enabled
- cross_collateral_enabled
- margin_model
- total_equity_usd
- total_initial_margin_usd
- total_maintenance_margin_usd
- total_margin_balance_usd
- total_delta_total_usd
- limits
- has_non_block_chain_equity
- fees
href: /api-reference/account-management/private-get_account_summaries
/private/pme/simulate:
get:
parameters:
- name: currency
required: true
in: query
schema:
$ref: '#/components/schemas/pme_currency'
example: BTC
description: The currency for which the Extended Risk Matrix will be calculated. Use `CROSS` for Cross Collateral simulation.
- name: add_positions
required: false
in: query
schema:
type: boolean
description: If `true`, adds simulated positions to current positions, otherwise uses only simulated positions. By default `true`
- name: simulated_positions
required: false
in: query
schema:
type: string
description: 'JSON string containing: object data'
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.'
responses:
'200':
$ref: '#/components/responses/PrivatePmeSimulateResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 2255
method: private/pme/simulate
params:
currency: BTC
description: JSON-RPC Request Example
description: JSON-RPC request body
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:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fpme%2Fsimulate)
'
x-mint:
metadata:
title: private/pme/simulate
og:title: private/pme/simulate
keywords:
- private/pme/simulate
- currency
- add_positions
- simulated_positions
href: /api-reference/account-management/private-simulate
/private/simulate_portfolio:
get:
parameters:
- name: currency
required: true
in: query
schema:
$ref: '#/components/schemas/currency'
example: BTC
description: The currency symbol
- name: add_positions
required: false
in: query
schema:
type: boolean
description: If `true`, adds simulated positions to current positions, otherwise uses only simulated positions. By default `true`
- name: simulated_positions
required: false
in: query
schema:
type: string
description: 'JSON string containing: object data'
description: '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.'
responses:
'200':
$ref: '#/components/responses/PrivateSimulatePortfolioResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 22222
method: private/simulate_portfolio
params:
currency: BTC
add_positions: true
simulated_positions:
BTC-PERPETUAL: 1
description: JSON-RPC Request Example
description: JSON-RPC request body
description: '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](https://support.deribit.com/hc/en-us/articles/25944756247837-Portfolio-Margin)
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fsimulate_portfolio)
'
x-mint:
metadata:
title: private/simulate_portfolio
og:title: private/simulate_portfolio
keywords:
- private/simulate_portfolio
- currency
- add_positions
- simulated_positions
- equity
- balance
- margin_balance
- initial_margin
- maintenance_margin
- projected_initial_margin
- projected_maintenance_margin
- available_funds
- available_withdrawal_funds
- available_subaccount_transfer_funds
- total_pl
- session_rpl
- session_upl
- futures_pl
- futures_session_rpl
- futures_session_upl
- options_pl
- options_session_rpl
- options_session_upl
- options_value
- options_delta
- options_gamma
- options_theta
- options_vega
- options_gamma_map
- options_theta_map
- options_vega_map
- delta_total
- delta_total_map
- projected_delta_total
- additional_reserve
- spot_reserve
- fee_balance
- locked_balance
- margin_model
- portfolio_margining_enabled
- cross_collateral_enabled
- total_equity_usd
- total_initial_margin_usd
- total_maintenance_margin_usd
- total_margin_balance_usd
- total_delta_total_usd
href: /api-reference/account-management/private-simulate_portfolio
/private/get_access_log:
get:
parameters:
- name: offset
in: query
required: false
schema:
example: 10
type: integer
description: The offset for pagination, default - `0`
- name: count
required: false
in: query
schema:
type: integer
maximum: 1000
minimum: 1
description: Number of requested items, default - `10`, maximum - `1000`
responses:
'200':
$ref: '#/components/responses/PrivateGetAccessLogResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 1
method: private/get_access_log
params:
offset: 0
count: 3
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves a log of API access attempts and authentication events for the authenticated account. The log includes information such as IP addresses, timestamps, API methods called, and authentication status.
Use this method to monitor account security, review API usage patterns, and identify unauthorized access attempts. Results can be paginated using the `offset` and `count` parameters.
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_access_log)
'
x-mint:
metadata:
title: private/get_access_log
og:title: private/get_access_log
keywords:
- private/get_access_log
- offset
- count
- ip
- timestamp
- country
- city
- log
- data
href: /api-reference/account-management/private-get_access_log
/private/get_affiliate_program_info:
get:
parameters: []
responses:
'200':
$ref: '#/components/responses/PrivateGetAffiliateProgramInfoResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 2
method: private/get_affiliate_program_info
params: {}
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves information about the affiliate program status for the authenticated account. The response includes the number of referred affiliates, total payouts earned, pending payouts, and the unique affiliate referral link.
Use this method to track your affiliate program performance and earnings.
**π Related Support Article:** [Affiliate Program](https://support.deribit.com/hc/en-us/articles/25944777728797-Affiliate-Program)
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_affiliate_program_info)
'
x-mint:
metadata:
title: private/get_affiliate_program_info
og:title: private/get_affiliate_program_info
keywords:
- private/get_affiliate_program_info
- is_enabled
- number_of_affiliates
- link
- received
- eth
- btc
href: /api-reference/account-management/private-get_affiliate_program_info
/private/enable_affiliate_program:
get:
parameters: []
responses:
'200':
$ref: '#/components/responses/OkResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 24
method: private/enable_affiliate_program
params: {}
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Enables the affiliate program for the authenticated account. Once enabled, you can earn commissions by referring new users to Deribit.
After enabling, you will receive a unique affiliate link that can be shared with potential users. Commissions are paid based on the trading activity of referred users.
**π Related Support Article:** [Affiliate Program](https://support.deribit.com/hc/en-us/articles/25944777728797-Affiliate-Program)
**Scope:** `account:read_write`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fenable_affiliate_program)
'
x-mint:
metadata:
title: private/enable_affiliate_program
og:title: private/enable_affiliate_program
keywords:
- private/enable_affiliate_program
href: /api-reference/account-management/private-enable_affiliate_program
/private/change_margin_model:
get:
parameters:
- name: user_id
in: query
schema:
type: integer
example: 1
required: false
description: Id of a (sub)account - by default current user id is used
- name: margin_model
in: query
schema:
type: string
enum:
- cross_pm
- cross_sm
- segregated_pm
- segregated_sm
required: true
description: Margin model
- name: dry_run
in: query
schema:
type: boolean
example: true
required: false
description: 'If `true` request returns the result without switching the margining model. Default: `false`'
responses:
'200':
$ref: '#/components/responses/PrivateChangeMarginModelResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 1
method: private/change_margin_model
params:
user_id: 3
margin_model: cross_pm
description: JSON-RPC Request Example
description: JSON-RPC request body
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:** `account:read_write`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fchange_margin_model)
'
x-mint:
metadata:
title: private/change_margin_model
og:title: private/change_margin_model
keywords:
- private/change_margin_model
- user_id
- margin_model
- dry_run
- old_state
- new_state
- currency
- maintenance_margin_rate
- initial_margin_rate
- available_balance
href: /api-reference/account-management/private-change_margin_model
/private/get_user_locks:
get:
parameters: []
responses:
'200':
$ref: '#/components/responses/PrivateGetUserLocksResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 74
method: private/get_user_locks
params: {}
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Retrieves information about any account locks or restrictions currently active on the authenticated account. Account locks may be applied for security reasons, compliance requirements, or administrative purposes.
The response includes details about the type of lock, reason, and duration (if applicable). Some locks may prevent trading, withdrawals, or other account operations.
**π Related Support Article:** [Emergency locking an account](https://support.deribit.com/hc/en-us/articles/25944602715805-Emergency-locking-an-account)
**Scope:** `account:read`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_locks)
'
x-mint:
metadata:
title: private/get_user_locks
og:title: private/get_user_locks
keywords:
- private/get_user_locks
- currency
- enabled
- message
href: /api-reference/account-management/private-get_user_locks
/private/set_self_trading_config:
get:
parameters:
- name: mode
in: query
required: true
schema:
type: string
enum:
- reject_taker
- cancel_maker
description: 'Self trading prevention behavior: `reject_taker` (reject the incoming order), `cancel_maker` (cancel the matched order in the book)'
- name: extended_to_subaccounts
in: query
required: true
schema:
type: boolean
description: If value is `true` trading is prevented between subaccounts of given account, otherwise they are treated separately
- name: block_rfq_self_match_prevention
in: query
required: false
schema:
type: boolean
description: When Block RFQ Self Match Prevention is enabled, it ensures that RFQs cannot be executed between accounts that belong to the same legal entity. This setting is independent of the general self-match prevention settings and must be configured separately.
responses:
'200':
$ref: '#/components/responses/OkResponse'
tags:
- Account Management
requestBody:
content:
application/json:
examples:
request:
value:
jsonrpc: '2.0'
id: 1
method: private/set_self_trading_config
params:
mode: cancel_maker
extended_to_subaccounts: true
block_rfq_self_match_prevention: true
description: JSON-RPC Request Example
description: JSON-RPC request body
description: 'Configures self-trading prevention settings for the account. Self-trading occurs when orders from the same account (or related subaccounts) match against each other.
You can configure whether self-trading is allowed, blocked, or allowed only for specific scenarios. Settings can be extended to apply to subaccounts as well. For Block RFQ trading, separate self-match prevention settings are available.
**π Related Support Article:** [Account settings page](https://support.deribit.com/hc/en-us/articles/25944634289693-Account-settings-page#heading-4)
**Scope:** `account:read_write`
[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fset_self_trading_config)
'
x-mint:
metadata:
title: private/set_self_trading_config
og:title: private/set_self_trading_config
keywords:
- private/set_self_trading_config
- mode
- extended_to_subaccounts
- block_rfq_self_match_prevention
href: /api-reference/account-management/private-set_self_trading_config
/private/set_disabled_trading_products:
get:
parameters:
- name: user_id
in: query
schema:
type: integer
example: 1
required: true
description: Id of a (sub)account
- name: trading_products
in: query
required: true
schema:
type: array
items:
type: string
enum:
- perpetual
- futures
- options
- future_combos
- option_combos
- spots
description: 'List of available trading products. Available products: perpetual, futures, options, future_combos, option_combos, spots
'
style: form
explode: true
responses:
'200':
$ref: '#/components/responses/OkResponse'
tags:
- Account Management
description: 'Configures which trading products (instruments, currencies, or instrument types) are disabled for a subaccount. Disabled products cannot be traded by the subaccount, providing a way to restrict tra
# --- truncated at 32 KB (218 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/deribit/refs/heads/main/openapi/deribit-account-management-api-openapi.yml