openapi: 3.0.0 info: title: Deribit Account Management Trading API version: 2.1.1 servers: - url: https://test.deribit.com/api/v2 tags: - name: Trading paths: /private/get_settlement_history_by_currency: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - in: query name: type required: false schema: $ref: '#/components/schemas/settlement_type' description: Settlement type - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `20`, maximum - `1000` - name: continuation in: query required: false schema: type: string example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT description: Continuation token for pagination - in: query name: search_start_timestamp required: false schema: $ref: '#/components/schemas/timestamp' description: The latest timestamp to return result from (milliseconds since the UNIX epoch) responses: '200': $ref: '#/components/responses/PrivateSettlementResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 8304 method: private/get_settlement_history_by_currency params: currency: BTC type: delivery count: 1 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves settlement, delivery, and bankruptcy events that have affected your account for a specific currency. Settlements occur when futures or options contracts expire and are settled at the delivery price. Results can be filtered by settlement type and timestamp. Use pagination parameters (`count` and `continuation`) to retrieve large settlement histories. This data is useful for tracking account-affecting settlement events and understanding how contract expirations impact your account. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_settlement_history_by_currency) ' x-mint: metadata: title: private/get_settlement_history_by_currency og:title: private/get_settlement_history_by_currency keywords: - private/get_settlement_history_by_currency - currency - type - count - continuation - search_start_timestamp - settlements - funding - funded - index_price - instrument_name - mark_price - position - profit_loss - session_bankruptcy - session_profit_loss - session_tax - session_tax_rate - socialized - timestamp href: /api-reference/trading/private-get_settlement_history_by_currency /private/get_settlement_history_by_instrument: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - in: query name: type required: false schema: $ref: '#/components/schemas/settlement_type' description: Settlement type - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `20`, maximum - `1000` - name: continuation in: query required: false schema: type: string example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT description: Continuation token for pagination - in: query name: search_start_timestamp required: false schema: $ref: '#/components/schemas/timestamp' description: The latest timestamp to return result from (milliseconds since the UNIX epoch) responses: '200': $ref: '#/components/responses/PrivateSettlementResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 2192 method: private/get_settlement_history_by_instrument params: instrument_name: ETH-22FEB19 type: settlement count: 1 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves settlement, delivery, and bankruptcy events for a specific instrument that have affected your account. Settlements occur when futures or options contracts expire and are settled at the delivery price. Results can be filtered by settlement type and timestamp. Use pagination parameters (`count` and `continuation`) to retrieve large settlement histories. This method is useful for tracking settlement events for a specific instrument. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_settlement_history_by_instrument) ' x-mint: metadata: title: private/get_settlement_history_by_instrument og:title: private/get_settlement_history_by_instrument keywords: - private/get_settlement_history_by_instrument - instrument_name - type - count - continuation - search_start_timestamp - settlements - funding - funded - index_price - mark_price - position - profit_loss - session_bankruptcy - session_profit_loss - session_tax - session_tax_rate - socialized - timestamp href: /api-reference/trading/private-get_settlement_history_by_instrument /private/get_order_history_by_instrument: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `20`, maximum - `1000` - name: offset in: query required: false schema: example: 10 type: integer description: The offset for pagination, default - `0` - name: include_old in: query required: false schema: example: false type: boolean description: Include in result orders older than 2 days, default - `false` - name: include_unfilled in: query required: false schema: example: false type: boolean description: Include in result fully unfilled closed orders, default - `false` - name: with_continuation in: query required: false schema: type: boolean description: When set to true, the API response format changes from a simple list of orders to an object containing the orders and a continuation token. - name: continuation in: query required: false schema: type: string example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT description: Continuation token for pagination - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' responses: '200': $ref: '#/components/responses/PrivateGetOrderHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 1032 method: private/get_order_history_by_instrument params: instrument_name: BTC-PERPETUAL count: 1 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the order history for a specific instrument. The history includes orders that have been partially or fully filled, as well as cancelled orders (if `include_unfilled_orders` is set to true). Results can be paginated using `offset` and `count` parameters, or using continuation tokens. Use `include_old_orders` to include orders from before a certain date, and `historical` to retrieve historical order data. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_history_by_instrument) ' x-mint: metadata: title: private/get_order_history_by_instrument og:title: private/get_order_history_by_instrument keywords: - private/get_order_history_by_instrument - instrument_name - count - offset - include_old - include_unfilled - with_continuation - continuation - historical - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_order_history_by_instrument /private/get_order_history_by_currency: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `20`, maximum - `1000` - name: offset in: query required: false schema: example: 10 type: integer description: The offset for pagination, default - `0` - name: include_old in: query required: false schema: example: false type: boolean description: Include in result orders older than 2 days, default - `false` - name: include_unfilled in: query required: false schema: example: false type: boolean description: Include in result fully unfilled closed orders, default - `false` - name: with_continuation in: query required: false schema: type: boolean description: When set to true, the API response format changes from a simple list of orders to an object containing the orders and a continuation token. - name: continuation in: query required: false schema: type: string example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT description: Continuation token for pagination - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' responses: '200': $ref: '#/components/responses/PrivateGetOrderHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 9305 method: private/get_order_history_by_currency params: currency: BTC kind: future count: 1 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the order history for a specific currency. The history includes orders that have been partially or fully filled, as well as cancelled orders (if `include_unfilled_orders` is set to true). Results can be filtered by instrument kind and paginated using `offset` and `count` parameters, or using continuation tokens. Use `include_old_orders` to include orders from before a certain date, and `historical` to retrieve historical order data. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_history_by_currency) ' x-mint: metadata: title: private/get_order_history_by_currency og:title: private/get_order_history_by_currency keywords: - private/get_order_history_by_currency - currency - kind - count - offset - include_old - include_unfilled - with_continuation - continuation - historical - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_order_history_by_currency /private/get_order_state: get: tags: - Trading parameters: - in: query name: order_id required: true schema: $ref: '#/components/schemas/order_id' description: The order id responses: '200': $ref: '#/components/responses/PrivateGetOrderStateResponse' '400': $ref: '#/components/responses/ErrorMessageResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 4316 method: private/get_order_state params: order_id: ETH-331562 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the current state of an order identified by its order ID. The response includes order details such as status (open, filled, cancelled), filled amount, remaining amount, price, and other order properties. **Important Note for Mass Quotes:** Quote orders are order-like structures that don''t fully translate to normal orders. When checking order state for quotes, the `amount` field represents the remaining amount, not the original order amount. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_state) ' x-mint: metadata: title: private/get_order_state og:title: private/get_order_state keywords: - private/get_order_state - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_order_state /private/get_order_state_by_label: get: tags: - Trading parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: label in: query schema: type: string required: false description: user defined label for the order (maximum 64 characters) responses: '200': $ref: '#/components/responses/PrivateGetOrderStateByLabelResponse' '400': $ref: '#/components/responses/ErrorMessageResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 4316 method: private/get_order_state_by_label params: currency: ETH label: fooBar description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the state of recent orders that have a specific label. This is useful for tracking orders that share the same label, which is helpful for managing related orders. Results are filtered by currency and label. The response includes order details such as status, filled amount, remaining amount, and other order properties for all orders with the specified label. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_state_by_label) ' x-mint: metadata: title: private/get_order_state_by_label og:title: private/get_order_state_by_label keywords: - private/get_order_state_by_label - currency - label - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_order_state_by_label /private/get_open_orders: get: parameters: - name: kind required: false in: query schema: $ref: '#/components/schemas/kind' description: Instrument kind, if not provided instruments of all kinds are considered - name: type required: false in: query schema: $ref: '#/components/schemas/order_type2' description: Order type, default - `all` responses: '200': $ref: '#/components/responses/PrivateGetOpenOrdersResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 1953 method: private/get_open_orders params: {} description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves a list of all open orders for the authenticated account across all currencies. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by instrument kind and order type. This method provides a comprehensive view of all active orders. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders) ' x-mint: metadata: title: private/get_open_orders og:title: private/get_open_orders keywords: - private/get_open_orders - kind - type - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_open_orders /private/get_open_orders_by_instrument: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: type required: false in: query schema: $ref: '#/components/schemas/order_type2' description: Order type, default - `all` responses: '200': $ref: '#/components/responses/PrivateGetOpenOrdersResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 8442 method: private/get_open_orders_by_instrument params: instrument_name: ETH-22FEB19-120-C description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves a list of all open orders for a specific instrument. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by order type. This method is useful for checking active orders for a particular instrument. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_instrument) ' x-mint: metadata: title: private/get_open_orders_by_instrument og:title: private/get_open_orders_by_instrument keywords: - private/get_open_orders_by_instrument - instrument_name - type - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_open_orders_by_instrument /private/get_open_orders_by_currency: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind' description: Instrument kind, if not provided instruments of all kinds are considered - name: type required: false in: query schema: $ref: '#/components/schemas/order_type2' description: Order type, default - `all` responses: '200': $ref: '#/components/responses/PrivateGetOpenOrdersResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 1953 method: private/get_open_orders_by_currency params: currency: BTC description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves a list of all open orders for a specific currency. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by instrument kind and order type. This method provides a view of all active orders within a currency. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_currency) ' x-mint: metadata: title: private/get_open_orders_by_currency og:title: private/get_open_orders_by_currency keywords: - private/get_open_orders_by_currency - currency - kind - type - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_open_orders_by_currency /private/get_open_orders_by_label: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: label in: query schema: type: string required: false description: user defined label for the order (maximum 64 characters) responses: '200': $ref: '#/components/responses/PrivateGetOpenOrdersResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 1953 method: private/get_open_orders_by_label params: currency: BTC label: fooBar description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves a list of all open orders that have a specific label within a given currency. This is useful for tracking and managing groups of related orders that share the same label. Open orders are orders that have been placed but not yet filled or cancelled. The label helps organize and identify related orders. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_label) ' x-mint: metadata: title: private/get_open_orders_by_label og:title: private/get_open_orders_by_label keywords: - private/get_open_orders_by_label - currency - label - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-get_open_orders_by_label /private/get_order_margin_by_ids: get: parameters: - name: ids in: query required: true schema: type: array items: type: string example: '123456' example: - ETH-349280 - ETH-349279 - ETH-349278 description: Ids of orders style: form explode: true responses: '200': $ref: '#/components/responses/PrivateGetOrderMarginByIdsResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 5625 method: private/get_order_margin_by_ids params: ids: - ETH-349280 - ETH-349279 - ETH-349278 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the initial margin requirements for one or more orders identified by their order IDs. Initial margin is the amount of funds required to open a position with these orders. This method is useful for calculating margin requirements before placing orders, helping to ensure sufficient funds are available. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_margin_by_ids) ' x-mint: metadata: title: private/get_order_margin_by_ids og:title: private/get_order_margin_by_ids keywords: - private/get_order_margin_by_ids - ids - order_id - initial_margin - initial_margin_currency href: /api-reference/trading/private-get_order_margin_by_ids /private/get_trigger_order_history: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: instrument_name required: false in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `20`, maximum - `1000` - name: continuation in: query required: false schema: type: string example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT description: Continuation token for pagination responses: '200': $ref: '#/components/responses/PrivateGetTriggerOrderHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 2552 method: private/get_trigger_order_history params: currency: ETH count: 10 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves a detailed log of all trigger orders (stop orders, take-profit orders, etc.) for the authenticated account. The log includes trigger order creation, activation, execution, and cancellation events. Results can be filtered by currency and instrument name. Use pagination parameters (`count` and `continuation`) to retrieve large trigger order histories. This is useful for tracking trigger order activity and debugging trigger order behavior. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_trigger_order_history) ' x-mint: metadata: title: private/get_trigger_order_history og:title: private/get_trigger_order_history keywords: - private/get_trigger_order_history - currency - instrument_name - count - continuation - entries - timestamp - trigger - trigger_price - trigger_offset - trigger_order_id - order_id - order_state - request - direction - price - amount - last_update_timestamp - reduce_only - post_only - order_type - label - is_secondary_oto - oco_ref - source href: /api-reference/trading/private-get_trigger_order_history /private/get_user_trades_by_instrument: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: start_seq required: false in: query schema: type: integer description: The sequence number of the first trade to be returned - name: end_seq required: false in: query schema: type: integer description: The sequence number of the last trade to be returned - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `10`, maximum - `1000` - name: start_timestamp required: false in: query schema: $ref: '#/components/schemas/timestamp' description: The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest - name: end_timestamp required: false in: query schema: $ref: '#/components/schemas/timestamp' description: 'The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required' - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' - name: sorting required: false in: query schema: $ref: '#/components/schemas/sorting' description: Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database) - name: subaccount_id in: query required: false schema: type: integer example: 9 description: Id of a subaccount responses: '200': $ref: '#/components/responses/PrivateGetUserTradesHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 5728 method: private/get_user_trades_by_instrument params: instrument_name: ETH-PERPETUAL start_seq: 1966042 count: 2 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the latest user trades that have occurred for a specific instrument. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID. Results can be filtered by sequence number range or timestamp range. Use the `count` parameter to limit the number of trades returned, and `sorting` to control the order (ascending or descending by trade ID). Use `historical` to retrieve historical trade data. Main accounts may use the `subaccount_id` parameter to retrieve trade data for a specific subaccount (requires `mainaccount` scope). **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_trades_by_instrument) ' x-mint: metadata: title: private/get_user_trades_by_instrument og:title: private/get_user_trades_by_instrument keywords: - private/get_user_trades_by_instrument - instrument_name - start_seq - end_seq - count - start_timestamp - end_timestamp - historical - sorting - subaccount_id - trades - has_more - trade_id - trade_seq - timestamp - order_type - advanced - order_id - matching_id - direction - tick_direction - index_price - price - amount - contracts - iv - underlying_price - liquidation - liquidity - fee - fee_currency - label - state - block_trade_id - block_rfq_id - block_rfq_quote_id - reduce_only - post_only - mmp - risk_reducing - api - profit_loss - mark_price - legs - combo_id - combo_trade_id - quote_set_id - quote_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-get_user_trades_by_instrument /private/get_user_trades_by_instrument_and_time: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: start_timestamp required: true in: query schema: $ref: '#/components/schemas/timestamp' description: The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest - name: end_timestamp required: true in: query schema: $ref: '#/components/schemas/timestamp' description: 'The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required' - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `10`, maximum - `1000` - name: sorting required: false in: query schema: $ref: '#/components/schemas/sorting' description: Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database) - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' - name: subaccount_id in: query required: false schema: type: integer example: 9 description: Id of a subaccount responses: '200': $ref: '#/components/responses/PrivateGetUserTradesHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 276 method: private/get_user_trades_by_instrument_and_time params: instrument_name: BTC-PERPETUAL start_timestamp: 1590470872894 end_timestamp: 1590480872894 count: 2 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the latest user trades that have occurred for a specific instrument within a specified time range. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID. Use the `count` parameter to limit the number of trades returned, and `sorting` to control the order (ascending or descending by trade ID). Use `historical` to retrieve historical trade data. This method is useful for analyzing trading activity over specific time periods. Main accounts may use the `subaccount_id` parameter to retrieve trade data for a specific subaccount (requires `mainaccount` scope). **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_trades_by_instrument_and_time) ' x-mint: metadata: title: private/get_user_trades_by_instrument_and_time og:title: private/get_user_trades_by_instrument_and_time keywords: - private/get_user_trades_by_instrument_and_time - instrument_name - start_timestamp - end_timestamp - count - sorting - historical - subaccount_id - trades - has_more - trade_id - trade_seq - timestamp - order_type - advanced - order_id - matching_id - direction - tick_direction - index_price - price - amount - contracts - iv - underlying_price - liquidation - liquidity - fee - fee_currency - label - state - block_trade_id - block_rfq_id - block_rfq_quote_id - reduce_only - post_only - mmp - risk_reducing - api - profit_loss - mark_price - legs - combo_id - combo_trade_id - quote_set_id - quote_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-get_user_trades_by_instrument_and_time /private/get_user_trades_by_currency: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: start_id required: false in: query schema: $ref: '#/components/schemas/trade_id' description: 'The ID of the first trade to be returned. Number for BTC trades, or hyphen name in ex. `"ETH-15"` # `"ETH_USDC-16"`' - name: end_id required: false in: query schema: $ref: '#/components/schemas/trade_id' description: 'The ID of the last trade to be returned. Number for BTC trades, or hyphen name in ex. `"ETH-15"` # `"ETH_USDC-16"`' - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `10`, maximum - `1000` - name: start_timestamp required: false in: query schema: $ref: '#/components/schemas/timestamp' description: The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest - name: end_timestamp required: false in: query schema: $ref: '#/components/schemas/timestamp' description: 'The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required' - name: sorting required: false in: query schema: $ref: '#/components/schemas/sorting' description: Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database) - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' - name: subaccount_id in: query schema: type: integer required: false description: The user id for the subaccount responses: '200': $ref: '#/components/responses/PrivateGetUserTradesHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 9367 method: private/get_user_trades_by_currency params: currency: ETH start_id: ETH-34066 count: 2 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the latest user trades that have occurred for instruments in a specific currency. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID for all instruments in the currency. Results can be filtered by instrument kind, trade ID range, or timestamp range. Use the `count` parameter to limit the number of trades returned, and `sorting` to control the order. To retrieve trades for a specific subaccount, use the `subaccount_id` parameter. Use `historical` to retrieve historical trade data. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_trades_by_currency) ' x-mint: metadata: title: private/get_user_trades_by_currency og:title: private/get_user_trades_by_currency keywords: - private/get_user_trades_by_currency - currency - kind - start_id - end_id - count - start_timestamp - end_timestamp - sorting - historical - subaccount_id - trades - has_more - trade_id - trade_seq - instrument_name - timestamp - order_type - advanced - order_id - matching_id - direction - tick_direction - index_price - price - amount - contracts - iv - underlying_price - liquidation - liquidity - fee - fee_currency - label - state - block_trade_id - block_rfq_id - block_rfq_quote_id - reduce_only - post_only - mmp - risk_reducing - api - profit_loss - mark_price - legs - combo_id - combo_trade_id - quote_set_id - quote_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-get_user_trades_by_currency /private/get_user_trades_by_currency_and_time: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: start_timestamp required: true in: query schema: $ref: '#/components/schemas/timestamp' description: The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest - name: end_timestamp required: true in: query schema: $ref: '#/components/schemas/timestamp' description: 'The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required' - name: count required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: Number of requested items, default - `10`, maximum - `1000` - name: sorting required: false in: query schema: $ref: '#/components/schemas/sorting' description: Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database) - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' - name: subaccount_id in: query required: false schema: type: integer example: 9 description: Id of a subaccount responses: '200': $ref: '#/components/responses/PrivateGetUserTradesHistoryResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 9292 method: private/get_user_trades_by_currency_and_time params: currency: BTC start_timestamp: 1590480630731 end_timestamp: 1510480630731 count: 2 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves the latest user trades that have occurred for instruments in a specific currency within a specified time range. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID for all instruments in the currency. Results can be filtered by instrument kind. Use the `count` parameter to limit the number of trades returned, and `sorting` to control the order. Use `historical` to retrieve historical trade data. This method is useful for analyzing trading activity across a currency over specific time periods. Main accounts may use the `subaccount_id` parameter to retrieve trade data for a specific subaccount (requires `mainaccount` scope). **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_trades_by_currency_and_time) ' x-mint: metadata: title: private/get_user_trades_by_currency_and_time og:title: private/get_user_trades_by_currency_and_time keywords: - private/get_user_trades_by_currency_and_time - currency - kind - start_timestamp - end_timestamp - count - sorting - historical - subaccount_id - trades - has_more - trade_id - trade_seq - instrument_name - timestamp - order_type - advanced - order_id - matching_id - direction - tick_direction - index_price - price - amount - contracts - iv - underlying_price - liquidation - liquidity - fee - fee_currency - label - state - block_trade_id - block_rfq_id - block_rfq_quote_id - reduce_only - post_only - mmp - risk_reducing - api - profit_loss - mark_price - legs - combo_id - combo_trade_id - quote_set_id - quote_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-get_user_trades_by_currency_and_time /private/get_user_trades_by_order: get: parameters: - in: query name: order_id required: true schema: $ref: '#/components/schemas/order_id' description: The order id - name: sorting required: false in: query schema: $ref: '#/components/schemas/sorting' description: Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database) - name: historical in: query required: false schema: type: boolean description: 'Determines whether historical trade and order records should be retrieved. - `false` (default): Returns recent records: orders for 30 min, trades for 24h. - `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included. **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) ' - name: subaccount_id in: query required: false schema: type: integer example: 9 description: Id of a subaccount tags: - Trading responses: '200': $ref: '#/components/responses/PrivateGetUserTradesByOrderResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 3466 method: private/get_user_trades_by_order params: order_id: ETH-584830574 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves all trades that were executed from a specific order. When an order is filled, it may result in multiple trades (partial fills). This method returns all trades associated with a given order ID. Results can be sorted in ascending or descending order by trade ID. Use `historical` to retrieve historical trade data. This is useful for tracking how an order was filled and analyzing execution quality. Main accounts may use the `subaccount_id` parameter to retrieve trade data for a specific subaccount (requires `mainaccount` scope). **π Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders) **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_user_trades_by_order) ' x-mint: metadata: title: private/get_user_trades_by_order og:title: private/get_user_trades_by_order keywords: - private/get_user_trades_by_order - order_id - sorting - historical - subaccount_id href: /api-reference/trading/private-get_user_trades_by_order /private/cancel_all: get: parameters: - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 8748 method: private/cancel_all params: {} description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all open orders and trigger orders for the authenticated account across all currencies and instrument kinds. This is a bulk cancellation operation useful for quickly clearing all active orders. Use the `detailed` parameter to receive a list of all cancelled orders. The `freeze_quotes` parameter can be used to freeze quotes instead of cancelling them. **Note:** This operation cannot be undone. All open orders will be permanently cancelled. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all) ' x-mint: metadata: title: private/cancel_all og:title: private/cancel_all keywords: - private/cancel_all - detailed - freeze_quotes href: /api-reference/trading/private-cancel_all /private/cancel_all_by_instrument: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: type required: false in: query schema: $ref: '#/components/schemas/simple_order_type' description: Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all` - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: include_combos required: false in: query schema: type: boolean description: 'When set to `true` orders in combo instruments affecting a given position will also be cancelled. Default: `false`' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 4122 method: private/cancel_all_by_instrument params: instrument_name: ETH-22FEB19-120-P type: all description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all open orders for a specific instrument. This is useful for quickly clearing all orders for a single instrument. Orders can be optionally filtered by order type (limit, market, stop, etc.). Use the `detailed` parameter to receive a list of all cancelled orders. The `include_combos` parameter can be used to include combo orders in the cancellation. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_instrument) ' x-mint: metadata: title: private/cancel_all_by_instrument og:title: private/cancel_all_by_instrument keywords: - private/cancel_all_by_instrument - instrument_name - type - detailed - include_combos - freeze_quotes href: /api-reference/trading/private-cancel_all_by_instrument /private/cancel_all_by_currency: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: type required: false in: query schema: $ref: '#/components/schemas/simple_order_type' description: Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all` - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 5663 method: private/cancel_all_by_currency params: currency: BTC kind: option description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all open orders for a specific currency. This is useful for quickly clearing all orders across multiple instruments in a currency. Orders can be optionally filtered by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the `detailed` parameter to receive a list of all cancelled orders. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_currency) ' x-mint: metadata: title: private/cancel_all_by_currency og:title: private/cancel_all_by_currency keywords: - private/cancel_all_by_currency - currency - kind - type - detailed - freeze_quotes href: /api-reference/trading/private-cancel_all_by_currency /private/cancel_all_by_currency_pair: get: parameters: - name: currency_pair required: true in: query schema: $ref: '#/components/schemas/index_name' description: The currency pair symbol - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: type required: false in: query schema: $ref: '#/components/schemas/simple_order_type' description: Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all` - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 5663 method: private/cancel_all_by_currency_pair params: currency_pair: BTC_USD kind: option description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all open orders for a specific currency pair. This is useful for quickly clearing all orders across instruments in a currency pair. Orders can be optionally filtered by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the `detailed` parameter to receive a list of all cancelled orders. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_currency_pair) ' x-mint: metadata: title: private/cancel_all_by_currency_pair og:title: private/cancel_all_by_currency_pair keywords: - private/cancel_all_by_currency_pair - currency_pair - kind - type - detailed - freeze_quotes href: /api-reference/trading/private-cancel_all_by_currency_pair /private/cancel_all_by_kind_or_type: get: parameters: - name: currency required: true in: query schema: $ref: '#/components/schemas/currency_with_any_and_list' description: The currency symbol, list of currency symbols or `"any"` for all - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: type required: false in: query schema: $ref: '#/components/schemas/simple_order_type' description: Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all` - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 2 method: private/cancel_all_by_kind_or_type params: currency: - BTC - ETH kind: future description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all open orders in one or more currencies, optionally filtered by instrument kind and/or order type. This provides flexible bulk cancellation across multiple currencies. Specify one or more currencies, and optionally filter by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the `detailed` parameter to receive a list of all cancelled orders. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_kind_or_type) ' x-mint: metadata: title: private/cancel_all_by_kind_or_type og:title: private/cancel_all_by_kind_or_type keywords: - private/cancel_all_by_kind_or_type - currency - kind - type - detailed - freeze_quotes href: /api-reference/trading/private-cancel_all_by_kind_or_type /private/cancel_by_label: get: parameters: - name: label in: query schema: type: string required: true description: user defined label for the order (maximum 64 characters) - in: query name: currency required: false schema: $ref: '#/components/schemas/currency' description: The currency symbol responses: '200': $ref: '#/components/responses/PrivateCancelAllResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 47 method: private/cancel_by_label params: label: label description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels all orders (including trigger orders) that have a specific label. This is useful for managing groups of related orders that share the same label. Orders can be cancelled across all currencies or filtered to a specific currency. When cancelling by currency, the currency queue is used for processing. **Rate Limits:** When called without the `currency` parameter, this method is subject to `cancel_all` rate limits. Different rate limit values may apply for per-currency cancels versus calls without providing the currency parameter. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_by_label) ' x-mint: metadata: title: private/cancel_by_label og:title: private/cancel_by_label keywords: - private/cancel_by_label - label - currency href: /api-reference/trading/private-cancel_by_label /private/cancel_quotes: get: parameters: - name: detailed required: false in: query schema: type: boolean description: 'When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders. **π Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods) Default: `false` ' - name: freeze_quotes required: false in: query schema: type: boolean description: Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request. - name: cancel_type in: query schema: enum: - delta - quote_set_id - instrument - instrument_kind - currency - currency_pair - all type: string example: delta required: true description: Type of cancel criteria. - name: min_delta in: query schema: type: number example: 0.4 required: false description: 'Min delta to cancel by delta (for `cancel_type`: `delta`).' - name: max_delta in: query schema: type: number example: 0.6 required: false description: 'Max delta to cancel by delta (for `cancel_type`: `delta`).' - name: quote_set_id in: query schema: type: string required: false description: Unique identifier for the Quote set. - name: instrument_name in: query schema: type: string required: false description: Instrument name. - name: kind required: false in: query schema: $ref: '#/components/schemas/kind_with_combo_all' description: Instrument kind, `"combo"` for any combo or `"any"` for all. If not provided instruments of all kinds are considered - name: currency required: true in: query schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: currency_pair required: true in: query schema: $ref: '#/components/schemas/index_name' description: The currency pair symbol responses: '200': $ref: '#/components/responses/PrivateCancelQuotesResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 5663 method: private/cancel_quotes params: cancel_type: delta min_delta: 0.4 max_delta: 0.6 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels quotes (mass quote orders) based on various criteria. This method provides flexible options for cancelling quotes: - `delta`: Cancels quotes within a delta range defined by `min_delta` and `max_delta` - `quote_set_id`: Cancels quotes by a specific Quote Set identifier - `instrument`: Cancels all quotes associated with a particular instrument - `kind`: Cancels all quotes for a certain instrument kind - `currency`: Cancels all quotes in a specified currency - `currency_pair`: Cancels all quotes in a specified currency pair - `all`: Cancels all quotes Use the `detailed` parameter to receive a list of all cancelled quotes. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_quotes) ' x-mint: metadata: title: private/cancel_quotes og:title: private/cancel_quotes keywords: - private/cancel_quotes - detailed - freeze_quotes - cancel_type - min_delta - max_delta - quote_set_id - instrument_name - kind - currency - currency_pair href: /api-reference/trading/private-cancel_quotes /private/cancel: get: parameters: - in: query name: order_id required: true schema: $ref: '#/components/schemas/order_id' description: The order id responses: '200': $ref: '#/components/responses/PrivateCancelResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 4214 method: private/cancel params: order_id: ETH-SLIS-12 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Cancels a specific order identified by its order ID. The order must be open (not yet filled or cancelled) to be cancelled successfully. Once cancelled, the order is removed from the order book and cannot be restored. Any unfilled portion of the order will be cancelled. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel) ' x-mint: metadata: title: private/cancel og:title: private/cancel keywords: - private/cancel - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco href: /api-reference/trading/private-cancel /private/buy: get: tags: - Trading parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: amount in: query schema: type: number required: false description: It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. The `amount` is a mandatory parameter if `contracts` parameter is missing. If both `contracts` and `amount` parameter are passed they must match each other otherwise error is returned. - name: contracts in: query schema: type: number required: false description: It represents the requested order size in contract units and can be passed instead of `amount`. The `contracts` is a mandatory parameter if `amount` parameter is missing. If both `contracts` and `amount` parameter are passed they must match each other otherwise error is returned. - name: type in: query schema: type: string enum: - limit - stop_limit - take_limit - market - stop_market - take_market - market_limit - trailing_stop required: false description: 'The order type, default: `"limit"`' - name: label in: query schema: type: string required: false description: user defined label for the order (maximum 64 characters) - name: price in: query schema: type: number required: false description:
The order price in base currency (Only for limit and stop_limit orders)
When adding an order with advanced=usd, the field price should be the option price value in USD.
When adding an order with advanced=implv, the field price should be a value of implied volatility in percentages. For example, price=100, means implied volatility of 100%
- name: time_in_force in: query schema: type: string default: good_til_cancelled enum: - good_til_cancelled - good_til_day - fill_or_kill - immediate_or_cancel required: false description:Specifies how long the order remains in effect. Default `"good_til_cancelled"`
If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below the spread.
Only valid in combination with time_in_force=`"good_til_cancelled"`
- name: reject_post_only in: query schema: type: boolean default: false required: false description:If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected.
Only valid in combination with `"post_only"` set to true
- name: reduce_only in: query schema: type: boolean default: false required: false description: If `true`, the order is considered reduce-only which is intended to only reduce a current position - name: trigger_price in: query schema: type: number required: false description: Trigger price, required for trigger orders only (Stop-loss or Take-profit orders) - name: trigger_offset in: query schema: type: number required: false description: The maximum deviation from the price peak beyond which the order will be triggered - name: trigger in: query schema: $ref: '#/components/schemas/trigger' required: false description: Defines the trigger type. Required for `"Stop-Loss"`, `"Take-Profit"` and `"Trailing"` trigger orders - name: advanced in: query schema: $ref: '#/components/schemas/advanced' required: false description: Advanced option order type. (Only for options. Advanced USD orders are not supported for linear options.) - name: mmp in: query schema: type: boolean default: false required: false description: Order MMP flag, only for order_type 'limit' - name: valid_until in: query schema: type: integer required: false description: Timestamp, when provided server will start processing request in Matching Engine only before given timestamp, in other cases `timed_out` error will be responded. Remember that the given timestamp should be consistent with the server's time, use /public/time method to obtain current server time. - name: linked_order_type in: query schema: type: string enum: - one_triggers_other - one_cancels_other - one_triggers_one_cancels_other required: false description:The type of the linked order.
The fill condition of the linked order (Only for linked order types), default: `first_hit`.
The order price in base currency (Only for limit and stop_limit orders)
When adding an order with advanced=usd, the field price should be the option price value in USD.
When adding an order with advanced=implv, the field price should be a value of implied volatility in percentages. For example, price=100, means implied volatility of 100%
- name: time_in_force in: query schema: type: string default: good_til_cancelled enum: - good_til_cancelled - good_til_day - fill_or_kill - immediate_or_cancel required: false description:Specifies how long the order remains in effect. Default `"good_til_cancelled"`
If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just above the spread.
Only valid in combination with time_in_force=`"good_til_cancelled"`
- name: reject_post_only in: query schema: type: boolean default: false required: false description:If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected.
Only valid in combination with `"post_only"` set to true
- name: reduce_only in: query schema: type: boolean default: false required: false description: If `true`, the order is considered reduce-only which is intended to only reduce a current position - name: trigger_price in: query schema: type: number required: false description: Trigger price, required for trigger orders only (Stop-loss or Take-profit orders) - name: trigger_offset in: query schema: type: number required: false description: The maximum deviation from the price peak beyond which the order will be triggered - name: trigger in: query schema: $ref: '#/components/schemas/trigger' required: false description: Defines the trigger type. Required for `"Stop-Loss"`, `"Take-Profit"` and `"Trailing"` trigger orders - name: advanced in: query schema: $ref: '#/components/schemas/advanced' required: false description: Advanced option order type. (Only for options. Advanced USD orders are not supported for linear options.) - name: mmp in: query schema: type: boolean default: false required: false description: Order MMP flag, only for order_type 'limit' - name: valid_until in: query schema: type: integer required: false description: Timestamp, when provided server will start processing request in Matching Engine only before given timestamp, in other cases `timed_out` error will be responded. Remember that the given timestamp should be consistent with the server's time, use /public/time method to obtain current server time. - name: linked_order_type in: query schema: type: string enum: - one_triggers_other - one_cancels_other - one_triggers_one_cancels_other required: false description:The type of the linked order.
The fill condition of the linked order (Only for linked order types), default: `first_hit`.
The order price in base currency.
When editing an option order with advanced=usd, the field price should be the option price value in USD.
When editing an option order with advanced=implv, the field price should be a value of implied volatility in percentages. For example, price=100, means implied volatility of 100%
- name: post_only in: query schema: type: boolean default: true required: false description:If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below or above the spread (accordingly to the original order type).
Only valid in combination with time_in_force=`"good_til_cancelled"`
- name: reduce_only in: query schema: type: boolean default: false required: false description: If `true`, the order is considered reduce-only which is intended to only reduce a current position - name: reject_post_only in: query schema: type: boolean default: false required: false description:If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected.
Only valid in combination with `"post_only"` set to true
- name: advanced in: query schema: $ref: '#/components/schemas/advanced' required: false description: Advanced option order type. If you have posted an advanced option order, it is necessary to re-supply this parameter when editing it (Only for options) - name: trigger_price in: query schema: type: number required: false description: Trigger price, required for trigger orders only (Stop-loss or Take-profit orders) - name: trigger_offset in: query schema: type: number required: false description: The maximum deviation from the price peak beyond which the order will be triggered - name: mmp in: query schema: type: boolean default: false required: false description: Order MMP flag, only for order_type 'limit' - name: valid_until in: query schema: type: integer required: false description: Timestamp, when provided server will start processing request in Matching Engine only before given timestamp, in other cases `timed_out` error will be responded. Remember that the given timestamp should be consistent with the server's time, use /public/time method to obtain current server time. - name: display_amount in: query schema: type: number default: 1 required: false description: Initial display amount for iceberg order. Has to be at least 100 times minimum amount for instrument and ratio of hidden part vs visible part has to be less than 100 as well. responses: '200': $ref: '#/components/responses/PrivateEditResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 3725 method: private/edit params: order_id: '438994' amount: 4 price: 222 advanced: implv description: JSON-RPC Request Example description: JSON-RPC request body description: 'Modifies an existing order by changing its price, amount, and/or other properties such as time-in-force, post-only, reduce-only, trigger conditions, or advanced order type. The order is identified by its order ID. Only open orders can be edited. Changes take effect immediately and may result in the order being filled if the new price matches the market. **π Related Article:** [Order Management Best Practices](https://docs.deribit.com/articles/order-management-best-practices) **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fedit) ' x-mint: metadata: title: private/edit og:title: private/edit keywords: - private/edit - order_id - amount - contracts - price - post_only - reduce_only - reject_post_only - advanced - trigger_price - trigger_offset - mmp - valid_until - display_amount - order - trades - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - label - api - web - mobile - refresh_amount - filled_amount - average_price - implv - usd - triggered - trigger - trigger_reference_price - block_trade - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco - trade_id - trade_seq - timestamp - matching_id - tick_direction - index_price - iv - underlying_price - liquidation - liquidity - fee - fee_currency - state - block_trade_id - block_rfq_id - block_rfq_quote_id - profit_loss - mark_price - legs - combo_id - combo_trade_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-edit /private/edit_by_label: get: parameters: - name: label in: query schema: type: string required: false description: user defined label for the order (maximum 64 characters) - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: amount in: query schema: type: number required: false description: It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. The `amount` is a mandatory parameter if `contracts` parameter is missing. If both `contracts` and `amount` parameter are passed they must match each other otherwise error is returned. - name: contracts in: query schema: type: number required: false description: It represents the requested order size in contract units and can be passed instead of `amount`. The `contracts` is a mandatory parameter if `amount` parameter is missing. If both `contracts` and `amount` parameter are passed they must match each other otherwise error is returned. - name: price in: query schema: type: number required: false description:The order price in base currency.
When editing an option order with advanced=usd, the field price should be the option price value in USD.
When editing an option order with advanced=implv, the field price should be a value of implied volatility in percentages. For example, price=100, means implied volatility of 100%
- name: post_only in: query schema: type: boolean default: true required: false description:If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below or above the spread (accordingly to the original order type).
Only valid in combination with time_in_force=`"good_til_cancelled"`
- name: reduce_only in: query schema: type: boolean default: false required: false description: If `true`, the order is considered reduce-only which is intended to only reduce a current position - name: reject_post_only in: query schema: type: boolean default: false required: false description:If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected.
Only valid in combination with `"post_only"` set to true
- name: advanced in: query schema: $ref: '#/components/schemas/advanced' required: false description: Advanced option order type. If you have posted an advanced option order, it is necessary to re-supply this parameter when editing it (Only for options) - name: trigger_price in: query schema: type: number required: false description: Trigger price, required for trigger orders only (Stop-loss or Take-profit orders) - name: mmp in: query schema: type: boolean default: false required: false description: Order MMP flag, only for order_type 'limit' - name: valid_until in: query schema: type: integer required: false description: Timestamp, when provided server will start processing request in Matching Engine only before given timestamp, in other cases `timed_out` error will be responded. Remember that the given timestamp should be consistent with the server's time, use /public/time method to obtain current server time. responses: '200': $ref: '#/components/responses/PrivateEditResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 9 method: private/edit_by_label params: instrument_name: BTC-PERPETUAL label: i_love_deribit amount: 150 price: 50111 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Modifies an order identified by its label. This method works only when there is exactly one open order with the specified label. You can change the order''s price, amount, and/or other properties such as time-in-force, post-only, reduce-only, trigger conditions, or advanced order type. Changes take effect immediately. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fedit_by_label) ' x-mint: metadata: title: private/edit_by_label og:title: private/edit_by_label keywords: - private/edit_by_label - label - instrument_name - amount - contracts - price - post_only - reduce_only - reject_post_only - advanced - trigger_price - mmp - valid_until - order - trades - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - creation_timestamp - last_update_timestamp - direction - api - web - mobile - refresh_amount - display_amount - filled_amount - average_price - implv - usd - triggered - trigger - trigger_offset - trigger_reference_price - block_trade - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco - trade_id - trade_seq - timestamp - matching_id - tick_direction - index_price - iv - underlying_price - liquidation - liquidity - fee - fee_currency - state - block_trade_id - block_rfq_id - block_rfq_quote_id - profit_loss - mark_price - legs - combo_id - combo_trade_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-edit_by_label /private/close_position: get: tags: - Trading parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: type in: query schema: type: string enum: - limit - market required: true description: The order type - name: price in: query schema: type: number required: false description: Optional price for limit order. responses: '200': $ref: '#/components/responses/PrivateBuyAndSellResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 6130 method: private/close_position params: instrument_name: ETH-PERPETUAL type: limit price: 145.17 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Places a reduce-only order to close an existing position. Reduce-only orders can only reduce or close a position; they cannot open a new position or increase an existing one. You can specify whether to use a market or limit order. If using a limit order, provide the price. The order will automatically be set to reduce-only to ensure it only closes the position. **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fclose_position) ' x-mint: metadata: title: private/close_position og:title: private/close_position keywords: - private/close_position - instrument_name - type - price - order - trades - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - creation_timestamp - last_update_timestamp - direction - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - mmp_group - quote_set_id - quote_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco - trade_id - trade_seq - timestamp - matching_id - tick_direction - index_price - iv - underlying_price - liquidation - liquidity - fee - fee_currency - state - block_trade_id - block_rfq_id - block_rfq_quote_id - profit_loss - mark_price - legs - combo_id - combo_trade_id - trade_allocations - user_id - client_info - client_id - client_link_id - name href: /api-reference/trading/private-close_position /private/get_margins: get: parameters: - name: instrument_name required: true in: query schema: $ref: '#/components/schemas/instrument_name' description: Instrument name - name: amount in: query schema: type: number required: true description: It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. - in: query name: price required: true schema: type: number example: 3725 description: Price responses: '200': $ref: '#/components/responses/PrivateGetMarginsResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7 method: private/get_margins params: instrument_name: BTC-PERPETUAL amount: 10000 price: 3725 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Calculates margin requirements for a hypothetical order on a given instrument. Returns initial margin and maintenance margin for the specified instrument, quantity, and price. This method is useful for estimating margin requirements before placing an order, helping to ensure sufficient funds are available and understanding the margin impact of potential trades. **Scope:** `trade:read` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_margins) ' x-mint: metadata: title: private/get_margins og:title: private/get_margins keywords: - private/get_margins - instrument_name - amount - price - buy - sell - min_price - max_price href: /api-reference/trading/private-get_margins /private/get_mmp_config: get: tags: - Trading parameters: - name: index_name required: false in: query schema: $ref: '#/components/schemas/index_name_derivative' description: Index identifier of derivative instrument on the platform; skipping this parameter will return all configurations - name: mmp_group required: false in: query schema: type: string example: MassQuoteBot7 description: 'Specifies the MMP group for which the configuration is being retrieved. MMP groups are used for Mass Quotes. If MMP group is not provided, the method returns the configuration for the MMP settings for regular orders. The `index_name` must be specified before using this parameter. **Note:** Leaving `mmp_group` empty is explicitly allowed and is the correct way to retrieve configuration for the orders MMP group. It is not an error or an incomplete request β omitting this field intentionally targets the default orders MMP group rather than any named mass quote group. **π Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications) ' - name: block_rfq required: false in: query schema: type: boolean default: false description: 'If true, retrieves MMP configuration for Block RFQ. When set, requires `block_rfq` scope instead of `trade` scope. Block RFQ MMP settings are completely separate from normal order/quote MMP settings. ' responses: '200': $ref: '#/components/responses/PrivateGetMmpConfigResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7859 method: private/get_mmp_config params: index_name: btc_usd mmp_group: MassQuoteBot7 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves Market Maker Protection (MMP) configuration for an index. Returns all currently active MMP parameters for the selected index, including the interval, `frozen_time`, quantity/delta/vega limits, and `max_quote_quantity`. If the `index_name` parameter is not provided, a list of all MMP configurations is returned. An empty list means no MMP configuration exists. This method is useful for verifying your configuration or confirming applied updates. For Mass Quotes, specify the `mmp_group` parameter to retrieve configuration for a specific MMP group. If no group is provided, returns configuration for regular orders. Set `block_rfq` to `true` to retrieve MMP configuration for Block RFQ (requires `block_rfq:read` scope). Each entry in the response includes an `id` field (integer) that uniquely identifies the MMP group. This integer ID is the programmatic identifier for the group and can be used to reference it in contexts where the string `mmp_group` name is not accepted. Entries that have no `mmp_group` name in the response correspond to the orders MMP group (the default group). **π Related Article:** [Market Maker Protection API Configuration](https://docs.deribit.com/articles/market-maker-protection) **Scope:** `trade:read` or `block_rfq:read` (when `block_rfq` = `true`) [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_mmp_config) ' x-mint: metadata: title: private/get_mmp_config og:title: private/get_mmp_config keywords: - private/get_mmp_config - index_name - mmp_group - block_rfq - interval - frozen_time - quantity_limit - delta_limit - vega_limit - max_quote_quantity - trade_count_limit href: /api-reference/trading/private-get_mmp_config /private/get_mmp_status: get: tags: - Trading parameters: - name: index_name required: false in: query schema: $ref: '#/components/schemas/index_name_derivative' description: Index identifier of derivative instrument on the platform; skipping this parameter will return all configurations - name: mmp_group required: false in: query schema: type: string example: MassQuoteBot7 description: 'Specifies the MMP group for which the status is being retrieved. The `index_name` must be specified before using this parameter. **π Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications) ' - name: block_rfq required: false in: query schema: type: boolean default: false description: 'If true, retrieves MMP status for Block RFQ. When set, requires `block_rfq` scope instead of `trade` scope. Block RFQ MMP status is completely separate from normal order/quote MMP status. ' responses: '200': $ref: '#/components/responses/PrivateGetMmpStatusResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7851 method: private/get_mmp_status params: index_name: btc_usd mmp_group: MassQuoteBot7 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Retrieves Market Maker Protection (MMP) status for a triggered index or MMP group. Returns the live MMP state including whether MMP is enabled or triggered, remaining frozen time (if triggered), whether quoting is currently allowed, and any active freeze conditions. If the `index_name` parameter is not provided, a list of all triggered MMP statuses is returned. This method lets you track whether protection is active and when quoting will resume. For Mass Quotes, specify the `mmp_group` parameter to check status for a specific MMP group. Set `block_rfq` to `true` to retrieve MMP status for Block RFQ (requires `block_rfq:read` scope). **π Related Article:** [Market Maker Protection API Configuration](https://docs.deribit.com/articles/market-maker-protection) **Scope:** `trade:read` or `block_rfq:read` (when `block_rfq` = `true`) [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_mmp_status) ' x-mint: metadata: title: private/get_mmp_status og:title: private/get_mmp_status keywords: - private/get_mmp_status - index_name - mmp_group - block_rfq - frozen_until href: /api-reference/trading/private-get_mmp_status /private/set_mmp_config: get: tags: - Trading parameters: - name: index_name required: true in: query schema: $ref: '#/components/schemas/index_name_derivative' description: Index identifier of derivative instrument on the platform - name: interval required: true in: query schema: type: integer minimum: 0 maximum: 3600 example: 60 description: 'The duration of the monitoring window in seconds. For example, an `interval` of `3` implies a 3-second window. The `interval` begins after the first trade. If a new trade is executed after the `interval` has ended, a new `interval` is started, and counters reset. If a trade occurs during an already running `interval`, that `interval` continues unaffected. This mechanism allows the platform to track activity in short, rolling windows to identify potentially risky trading behavior. If set to `0`, MMP is removed. Maximum value: `3600` seconds (1 hour). ' - name: frozen_time required: true in: query schema: type: integer minimum: 0 maximum: 3600 example: 0 description: 'Time in seconds that MMP remains active after being triggered. Once this frozen period has passed, MMP will automatically reset, allowing new orders to be submitted. If you want to disable automatic reset, set `frozen_time` to `0`. In that case, a manual reset is required using the `private/reset_mmp` method. Manual reset is also possible during the frozen time period. Maximum value: `3600` seconds (1 hour). ' - name: mmp_group required: false in: query schema: type: string example: MassQuoteBot7 description: 'Designates the MMP group for which the configuration is being set. If the specified group is already associated with a different `index_name`, an error is returned. This parameter enables distinct configurations for each MMP group, linked to particular `index_name`. Maximum 64 characters. Case sensitive. Cannot be empty string. **π Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications) ' - name: quantity_limit required: false in: query schema: type: number example: 3 description: 'The total traded quantity, measured in units of the base currency (e.g., BTC in `BTC-PERPETUAL`), within the `interval`. This count is direction-agnosticβa buy followed by a sell counts double. Example: Buy `10` BTC and sell `10` BTC = `20` total quantity. Applicable to both options and futures. Positive value with maximum 4 decimal places. ' - name: delta_limit required: false in: query schema: type: number description: 'The maximum allowable net transaction delta change during the `interval`. Expressed in units of base currency. The `delta_limit` is treated as an absolute threshold: e.g., `delta_limit: 10` β MMP is triggered if net transaction delta exceeds `+10` or drops below `-10`. Direction matters: buying `+5` delta and selling `β5` delta cancels out if within the same `interval`. **Note:** Note that we use the net transaction delta instead of delta. Net Transaction Delta = `Delta - Mark Price`. In the rest of this document, "delta" actually refers to net transaction delta. Positive value with maximum 4 decimal places. ' - name: vega_limit required: false in: query schema: type: number description: 'The maximum change in vega exposure allowed within a given `interval`, measured in absolute terms. Expressed in USD, representing the change in sensitivity to implied volatility across executed trades. This parameter is primarily relevant for options traders managing risk in volatile markets. Similar to `delta_limit`, the `vega_limit` is direction-aware and evaluated on a net basis. If the exposure exceeds the set threshold (positively or negatively), MMP will be triggered. **Notice:** When evaluating Delta and Vega limits for MMP, Deribit uses the greeks at the moment of trade execution. The system does not re-evaluate Delta or Vega using live greeks at the time of MMP checking. Positive value with maximum 4 decimal places. ' - name: max_quote_quantity required: true in: query schema: type: number example: 2.5 description: Maximum Quote Quantity (MQQ) in base currency. MQQ is configured per index but enforced per side, per order book (instrument) β the total combined size of open MMP orders per side per instrument cannot exceed MQQ. **See response description for detailed information about MQQ behavior and limitations.** Maximum 4 decimal places. - name: block_rfq required: false in: query schema: type: boolean default: false description: 'If true, configures MMP for Block RFQ. When set, requires `block_rfq` scope instead of `trade` scope. Block RFQ MMP settings are completely separate from normal order/quote MMP settings. ' - name: trade_count_limit required: false in: query schema: type: integer maximum: 1000 minimum: 1 description: For Block RFQ only (`block_rfq` = `true`). Sets the maximum number of Block RFQ trades allowed in the lookback window. Each RFQ trade counts as `+1` towards the limit (not individual legs). Works across all currency pairs. When using this parameter, `index_name` must be set to `"all"`. Maximum - `1000`. responses: '200': $ref: '#/components/responses/PrivateSetMmpConfigResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7859 method: private/set_mmp_config params: index_name: btc_usd mmp_group: MassQuoteBot7 interval: 60 frozen_time: 0 quantity_limit: 3 max_quote_quantity: 2.5 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Configures Market Maker Protection (MMP) for a specific index. This method sets the monitoring window, freeze duration, and exposure limits (quantity, delta, vega, and Maximum Quote Quantity). At least one limit parameter must be set. Maximum Quote Quantity (MQQ) is a required parameter that limits the total combined size of open MMP orders. MQQ is configured per index but enforced per side, per order book (instrument). The `interval` parameter defines the monitoring window duration in seconds. The `frozen_time` parameter sets how long MMP remains active after being triggered. Set `frozen_time` to `0` to disable automatic reset (manual reset required). For Mass Quotes, use the `mmp_group` parameter to configure MMP for a specific group. Set `block_rfq` to `true` to configure MMP for Block RFQ (requires `block_rfq:read_write` scope). Set `interval` to `0` to remove MMP configuration. **π Related Article:** [Market Maker Protection API Configuration](https://docs.deribit.com/articles/market-maker-protection) **Scope:** `trade:read_write` or `block_rfq:read_write` (when `block_rfq` = `true`) [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fset_mmp_config) ' x-mint: metadata: title: private/set_mmp_config og:title: private/set_mmp_config keywords: - private/set_mmp_config - index_name - interval - frozen_time - mmp_group - quantity_limit - delta_limit - vega_limit - max_quote_quantity - block_rfq - trade_count_limit href: /api-reference/trading/private-set_mmp_config /private/reset_mmp: get: tags: - Trading parameters: - name: index_name required: true in: query schema: type: string example: btc_usd description: 'Currency pair for which to reset MMP limits. **For regular MMP (`block_rfq = false`):** Must be a specific currency pair (e.g., "btc_usd", "eth_usd"). The value `"all"` is not allowed. **For Block RFQ MMP (`block_rfq = true`):** Can be either a specific currency pair or `"all"` to reset MMP limits across all currency pairs. ' - name: mmp_group required: false in: query schema: type: string example: MassQuoteBot7 description: 'Specifies the MMP group for which limits are being reset. If this parameter is omitted, the method resets the traditional (no group) MMP limits. **π Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications) ' - name: block_rfq required: false in: query schema: type: boolean default: false description: 'If true, resets MMP for Block RFQ. When set, requires `block_rfq` scope instead of `trade` scope. Block RFQ MMP settings are completely separate from normal order/quote MMP settings. When `block_rfq = true`, the `index_name` parameter can be set to `"all"` to reset limits across all currency pairs. ' responses: '200': $ref: '#/components/responses/OkResponse' requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7859 method: private/reset_mmp params: index_name: btc_usd mmp_group: MassQuoteBot7 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Resets Market Maker Protection (MMP) limits for the specified currency pair or MMP group. If MMP protection has been triggered and quoting is frozen, this method allows you to manually resume quoting. If the configured `frozen_time` has expired, the system will automatically reset MMP. If `frozen_time` is set to `0` (automatic reset disabled), you must call this method to re-enable quoting. You can also perform a manual reset during the frozen period if you want to resume quoting early. For regular MMP (`block_rfq = false`), the `index_name` must be a specific currency pair (e.g., "btc_usd", "eth_usd"). For Block RFQ MMP (`block_rfq = true`), you can set `index_name` to `"all"` to reset limits across all currency pairs. Use the `mmp_group` parameter to reset limits for a specific MMP group. **π Related Article:** [Market Maker Protection API Configuration](https://docs.deribit.com/articles/market-maker-protection) **Scope:** `trade:read_write` or `block_rfq:read_write` (when `block_rfq` = `true`) [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Freset_mmp) ' x-mint: metadata: title: private/reset_mmp og:title: private/reset_mmp keywords: - private/reset_mmp - index_name - mmp_group - block_rfq href: /api-reference/trading/private-reset_mmp /private/mass_quote: get: parameters: - name: wait_for_response in: query schema: type: boolean required: false description: If false, the response is sent immediately after the risk check. If true, the response is sent after the orders all go through the matching engine. Default - `true`. - name: detailed in: query schema: type: boolean example: true required: false description: Flag to receive a list of all order changes and a list of errors, or to only receive a list of errors. Default - `false`. - name: quote_id in: query schema: type: string example: '1' required: true description: Identifier of a mass quote message. Can be used to match trades to requests. We recommend using an incrementing counter. - name: mmp_group in: query schema: type: string example: default required: true description: Name of the MMP group. An MMP group has to be used and only one quote can exist per instrument per side per MMP group. - name: valid_until in: query schema: type: integer required: false description: Timestamp, when provided server will start processing request in Matching Engine only before given timestamp, in other cases `timed_out` error will be responded. Remember that the given timestamp should be consistent with the server's time, use /public/time method to obtain current server time. - name: quotes in: query required: true schema: type: array items: type: object properties: instrument_name: type: string description: The name of the instrument. quote_set_id: type: string description: User-defined label that can be used for targeted cancels using private/cancel_quotes. ask: type: object properties: price: type: number description: The price of this side of the quote. If no price is supplied, only the amount is amended. amount: type: number description: The amount of this side of the quote. If no quantity is supplied, only the price is amended. post_only: type: boolean default: false description: If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below the spread. Default - `false` reject_post_only: type: boolean default: false description: If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected. Only valid in combination with "post_only" set to `true`. Default value - `false` description: Order details for the ask. If not provided, `bid` must be present. bid: type: object properties: price: type: number description: The price of this side of the quote. If no price is supplied, only the amount is amended. amount: type: number description: The amount of this side of the quote. If no quantity is supplied, only the price is amended. post_only: type: boolean default: false description: If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below the spread. Default - `false` reject_post_only: type: boolean default: false description: If an order is considered post-only and this field is set to true then the order is put to the order book unmodified or the request is rejected. Only valid in combination with "post_only" set to `true`. Default value - `false` description: Order details for the bid. If not provided, `ask` must be present. example: - instrument_name: BTC-PERPETUAL quote_set_id: futures ask: price: 43800 amount: 10 bid: price: 43700 amount: 10 - instrument_name: BTC-22DEC23-41600-C quote_set_id: options ask: price: 0.05 amount: 1 bid: price: 0.04 amount: 1 description: List of quotes. style: form explode: true responses: '200': $ref: '#/components/responses/PrivateMassQuoteResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 7859 method: private/mass_quote params: detailed: true quote_id: '1' mmp_group: default quotes: - instrument_name: BTC-PERPETUAL quote_set_id: futures ask: price: 43800 amount: 10 bid: price: 43700 amount: 10 - instrument_name: BTC-22DEC23-41600-C quote_set_id: options ask: price: 0.05 amount: 1 bid: price: 0.04 amount: 1 description: JSON-RPC Request Example description: JSON-RPC request body description: 'Places buy and/or sell orders (quotes) on one or more instruments simultaneously. This method is designed for market makers who need to quote on multiple instruments efficiently. **Requirements:** - Cancel-on-Disconnect must be enabled (see [private/enable_cancel_on_disconnect](https://docs.deribit.com/api-reference/session-management/private-enable_cancel_on_disconnect)), otherwise the request will return an error. - This endpoint can only be used after approval from the administrators. Each quote can include both bid and ask sides, or just one side. Quotes are identified by `quote_set_id` for targeted cancellation. Use the `wait_for_response` parameter to control whether to wait for all orders to be processed before returning. **π Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications) **Scope:** `trade:read_write` [Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fmass_quote) ' x-mint: metadata: title: private/mass_quote og:title: private/mass_quote keywords: - private/mass_quote - wait_for_response - detailed - quote_id - mmp_group - valid_until - quotes - orders - trades - errors_count - pending_requests_count - pending_requests - errors - order_id - order_state - order_type - original_order_type - time_in_force - is_rebalance - is_liquidation - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - reject_post_only - reduce_only - api - web - mobile - refresh_amount - display_amount - amount - contracts - filled_amount - average_price - advanced - implv - usd - triggered - trigger - trigger_price - trigger_offset - trigger_reference_price - block_trade - mmp - risk_reducing - replaced - auto_replaced - quote - quote_set_id - trigger_order_id - app_name - mmp_cancelled - cancel_reason - oto_order_ids - trigger_fill_condition - oco_ref - primary_order_id - is_secondary_oto - is_primary_otoco - trade_id - trade_seq - timestamp - matching_id - tick_direction - index_price - iv - underlying_price - liquidation - liquidity - fee - fee_currency - state - block_trade_id - block_rfq_id - block_rfq_quote_id - profit_loss - mark_price - legs - combo_id - combo_trade_id - trade_allocations - user_id - client_info - client_id - client_link_id - name - side - code - message href: /api-reference/trading/private-mass_quote /private/move_positions: get: parameters: - in: query name: currency required: false schema: $ref: '#/components/schemas/currency' description: The currency symbol - name: source_uid in: query schema: type: integer example: 1 required: true description: Id of source subaccount. Can be found in `My Account >> Subaccounts` tab - name: target_uid in: query schema: type: integer example: 1 required: true description: Id of target subaccount. Can be found in `My Account >> Subaccounts` tab - in: query name: trades required: true schema: type: array items: type: object properties: instrument_name: $ref: '#/components/schemas/instrument_name' description: Instrument name price: type: number description: Price for trade - if not provided average price of the position is used amount: type: number description: It represents the requested trade size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. Amount can't exceed position size. description: List of trades for position move style: form explode: true responses: '200': $ref: '#/components/responses/PrivatePositionMoveResponse' tags: - Trading requestBody: content: application/json: examples: request: value: jsonrpc: '2.0' id: 3 method: private/move_positions params: currency: BTC source_uid: 3 target_uid: 23 trades: - instrument_name: BTC-PERPETUAL price: '35800' amount: '110' - instrument_name: BTC-28JAN22-32500-C amount: '0.1' description: JSON-RPC Request Example description: JSON-RPC request body description: "Moves positions from a source subaccount to a target subaccount. This operation transfers open positions between subaccounts, which is useful for rebalancing or reorganizing trading activities.\n\nPositions can be filtered by currency. The operation creates trades to transfer positions, which may affect P&L and margin calculations.\n\n**Note - This method has distinct API rate limiting requirements:** \n- Sustained rate: 6 requests/minute\n- Weekly limit: 100 move_position uses per week (168 hours)\n\nFor more information, see [Rate Limits](https://support.deribit.com/hc/en-us/articles/25944617523357-Rate-Limits).\n\n**Important:** In rare cases, the request may return an `internal_server_error`. This does not necessarily mean the operation failed entirely. Part or all of the position transfer might have still been processed successfully. Check the positions in both accounts to verify the transfer status.\n\n**\U0001F4D6 Related Article:** [Moving Positions](https://docs.deribit.com/articles/moving-positions-api)\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fmove_positions)\n\n" x-mint: metadata: title: private/move_positions og:title: private/move_positions keywords: - private/move_positions - currency - source_uid - target_uid - trades - instrument_name - direction - price - amount href: /api-reference/trading/private-move_positions /api/v2/private/get_open_orders: get: operationId: get_open_orders summary: Get Open Orders description: 'Returns all currently-open orders belonging to the authenticated portfolio. Orders are returned regardless of instrument or order type; filtering by instrument kind and order type is not currently supported. The portfolio is resolved from the authenticated session β there is no parameter to query another portfolio''s orders. MMP-flagged orders are visible via this endpoint. Orders placed via Mass Quote (MassQuoteRequest) are not currently returned. This endpoint is rate-limited per portfolio. Exceeding the limit returns HTTP 429.' tags: - Trading security: - BearerAuth: [] responses: '200': description: List of open orders for the authenticated portfolio. May be empty. content: application/json: schema: $ref: '#/components/schemas/GetOpenOrdersResponse' example: jsonrpc: '2.0' id: 1 result: - order_id: 1cc1c718-49e0-4ea5-8902-f3f22968c350 instrument_name: TREE-USD side: sell price: 0.0717 amount: 83698 filled_amount: 0 average_price: 0 order_state: open order_type: limit creation_timestamp: 1778270370643 last_update_timestamp: 1778270370643 '401': description: Missing or invalid `Authorization` header. content: application/json: schema: $ref: '#/components/schemas/JsonRpcError' '429': description: Per-portfolio rate limit for this endpoint exceeded. Configured via `portfolio-rate-limit.get_open_orders`. content: application/json: schema: $ref: '#/components/schemas/JsonRpcError' '500': description: Internal server error while reading the active-order set. content: application/json: schema: $ref: '#/components/schemas/JsonRpcError' components: schemas: settlement_type: enum: - settlement - delivery - bankruptcy type: string description: The type of settlement. `settlement`, `delivery` or `bankruptcy`. order_state_in_user_trade: enum: - open - filled - rejected - cancelled - untriggered - archive type: string description: 'Order state: `"open"`, `"filled"`, `"rejected"`, `"cancelled"`, `"untriggered"` or `"archive"` (if order was archived)' trigger_offset: type: number description: The maximum deviation from the price peak beyond which the order will be triggered (Only for trailing trigger orders) continuation: example: xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT type: string description: Continuation token for pagination. api: type: boolean description: '`true` if created with API' order_id_initial_margin_pair: properties: order_id: $ref: '#/components/schemas/order_id' initial_margin: type: number description: Initial margin of order initial_margin_currency: type: string description: Currency of initial margin required: - order_id - initial_margin type: object trigger: enum: - index_price - mark_price - last_price type: string description: 'Trigger type (only for trigger orders). Allowed values: `"index_price"`, `"mark_price"`, `"last_price"`.' contracts: type: number description: It represents the order size in contract units. (Optional, may be absent in historical data). kind_with_combo_all: enum: - future - option - spot - future_combo - option_combo - combo - any type: string description: 'Instrument kind: `"future"`, `"option"`, `"spot"`, `"future_combo"`, `"option_combo"`, `"combo"` for any combo or `"any"` for all' PrivateGetUserTradesByOrderResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request required: - jsonrpc type: object PrivateGetOrderStateByLabelResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: $ref: '#/components/schemas/orders' required: - jsonrpc - result type: object order_type: enum: - market - limit - stop_market - stop_limit - take_market - take_limit - trailing_stop type: string description: 'Order type: `"limit"`, `"market"`, `"stop_limit"`, `"stop_market"`, `"take_limit"`, `"take_market"`, `"trailing_stop"`' reduce_only: type: boolean description: Optional (not added for spot). '`true` for reduce-only orders only' sorting: enum: - asc - desc - default type: string position_move: properties: trades: type: array items: $ref: '#/components/schemas/position_move_trade' required: - trades type: object PrivateGetMarginsResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: properties: buy: example: 0.01681367 type: number description: Margin when buying sell: example: 0.01680479 type: number description: Margin when selling min_price: $ref: '#/components/schemas/min_price' max_price: $ref: '#/components/schemas/max_price' required: - buy - sell - min_price - max_price type: object required: - jsonrpc - result type: object price: type: number description: Price in base currency PrivateGetOrderHistoryResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: array items: $ref: '#/components/schemas/order' required: - jsonrpc - result type: object trigger_reference_price: type: number description: The price of the given trigger at the time when the order was placed (Only for trailing trigger orders) display_amount: type: number description: The actual display amount of iceberg order. Absent for other types of orders. filled_amount: type: number description: Filled amount of the order. For perpetual and futures the filled_amount is in USD units, for options - in units or corresponding cryptocurrency contracts, e.g., BTC or ETH. orders: items: $ref: '#/components/schemas/order' type: array block_trade_id_in_result: example: '154' type: string description: Block trade id - when trade was part of a block trade PrivatePositionMoveResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: $ref: '#/components/schemas/position_move' required: - jsonrpc - result type: object PrivateBuyAndSellResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: object properties: order: $ref: '#/components/schemas/order' trades: type: array items: $ref: '#/components/schemas/user_trade' required: - order - trades required: - jsonrpc - result type: object is_secondary_oto: type: boolean description: '`true` if the order is an order that can be triggered by another order, otherwise not present.' PrivateCancelAllResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: number example: 7 description: Total number of successfully cancelled orders required: - jsonrpc - result type: object trade_id: type: string description: Unique (per currency) trade identifier cancel_reason: enum: - user_request - autoliquidation - cancel_on_disconnect - risk_mitigation - pme_risk_reduction - pme_account_locked - position_locked - mmp_trigger - mmp_config_curtailment - edit_post_only_reject - oco_other_closed - oto_primary_closed - settlement type: string description: Enumerated reason behind cancel `"user_request"`, `"autoliquidation"`, `"cancel_on_disconnect"`, `"risk_mitigation"`, `"pme_risk_reduction"` (portfolio margining risk reduction), `"pme_account_locked"` (portfolio margining account locked per currency), `"position_locked"`, `"mmp_trigger"` (market maker protection), `"mmp_config_curtailment"` (market maker configured quantity decreased), `"edit_post_only_reject"` (cancelled on edit because of `reject_post_only` setting), `"oco_other_closed"` (the oco order linked to this order was closed), `"oto_primary_closed"` (the oto primary order that was going to trigger this order was cancelled), `"settlement"` (closed because of a settlement) PrivateCancelQuotesResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: number example: 3 description: Total number of successfully cancelled quotes required: - jsonrpc - result type: object PrivateGetTriggerOrderHistoryResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: object properties: entries: type: array items: $ref: '#/components/schemas/trigger_order_history_record' continuation: $ref: '#/components/schemas/continuation' required: - jsonrpc - result type: object timestamp: example: 1536569522277 type: integer description: The timestamp (milliseconds since the Unix epoch) currency: enum: - BTC - ETH - USDC - USDT - EURR type: string description: Currency, i.e `"BTC"`, `"ETH"`, `"USDC"` order: properties: order_id: $ref: '#/components/schemas/order_id' order_state: $ref: '#/components/schemas/order_state' order_type: $ref: '#/components/schemas/order_type' original_order_type: $ref: '#/components/schemas/original_order_type' time_in_force: $ref: '#/components/schemas/time_in_force' is_rebalance: type: boolean description: Optional (only for spot). `true` if order was automatically created during cross-collateral balance restoration is_liquidation: type: boolean description: Optional (not added for spot). `true` if order was automatically created during liquidation instrument_name: $ref: '#/components/schemas/instrument_name' creation_timestamp: $ref: '#/components/schemas/timestamp' last_update_timestamp: $ref: '#/components/schemas/timestamp' direction: $ref: '#/components/schemas/direction' price: $ref: '#/components/schemas/open_order_price' label: $ref: '#/components/schemas/label' post_only: $ref: '#/components/schemas/post_only' reject_post_only: $ref: '#/components/schemas/reject_post_only' reduce_only: $ref: '#/components/schemas/reduce_only' api: $ref: '#/components/schemas/api' web: $ref: '#/components/schemas/web' mobile: $ref: '#/components/schemas/mobile' refresh_amount: $ref: '#/components/schemas/refresh_amount' display_amount: $ref: '#/components/schemas/display_amount' amount: $ref: '#/components/schemas/amount' contracts: $ref: '#/components/schemas/contracts' filled_amount: $ref: '#/components/schemas/filled_amount' average_price: $ref: '#/components/schemas/average_price' advanced: $ref: '#/components/schemas/advanced' implv: $ref: '#/components/schemas/implv' usd: $ref: '#/components/schemas/usd' triggered: $ref: '#/components/schemas/triggered' trigger: $ref: '#/components/schemas/trigger' trigger_price: $ref: '#/components/schemas/trigger_price' trigger_offset: $ref: '#/components/schemas/trigger_offset' trigger_reference_price: $ref: '#/components/schemas/trigger_reference_price' block_trade: $ref: '#/components/schemas/block_trade_order' mmp: type: boolean description: '`true` if the order is a MMP order, otherwise `false`.' risk_reducing: type: boolean description: '`true` if the order is marked by the platform as a risk reducing order (can apply only to orders placed by PM users), otherwise `false`.' replaced: type: boolean description: '`true` if the order was edited (by user or - in case of advanced options orders - by pricing engine), otherwise `false`.' auto_replaced: type: boolean description: Options, advanced orders only - `true` if last modification of the order was performed by the pricing engine, otherwise `false`. quote: type: boolean description: If order is a quote. Present only if true. mmp_group: type: string description: Name of the MMP group supplied in the `private/mass_quote` request. Only present for quote orders. quote_set_id: type: string description: Identifier of the QuoteSet supplied in the `private/mass_quote` request. Only present for quote orders. quote_id: type: string description: The same QuoteID as supplied in the `private/mass_quote` request. Only present for quote orders. trigger_order_id: type: string example: SLIB-370 description: Id of the trigger order that created the order (Only for orders that were created by triggered orders). app_name: type: string example: Example Application description: The name of the application that placed the order on behalf of the user (optional). mmp_cancelled: type: boolean example: true description: '`true` if order was cancelled by mmp trigger (optional)' cancel_reason: $ref: '#/components/schemas/cancel_reason' oto_order_ids: type: array items: $ref: '#/components/schemas/order_id' description: Order Id description: The Ids of the orders that will be triggered if the order is filled trigger_fill_condition: $ref: '#/components/schemas/trigger_fill_condition' oco_ref: $ref: '#/components/schemas/oco_ref' primary_order_id: $ref: '#/components/schemas/order_id' description: ID of the order that triggered this order. is_secondary_oto: $ref: '#/components/schemas/is_secondary_oto' is_primary_otoco: type: boolean description: '`true` if the order is an order that can trigger an OCO pair, otherwise not present.' required: - order_id - order_state - order_type - time_in_force - instrument_name - creation_timestamp - last_update_timestamp - direction - price - label - post_only - api type: object amount: type: number description: It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. settlement: properties: funding: example: -2.511e-06 type: number description: funding (in base currency ; settlement for perpetual product only) funded: example: 0 type: number description: funded amount (bankruptcy only) index_price: example: 11008.37 type: number description: underlying index price at time of event (in quote currency; settlement and delivery only) instrument_name: example: BTC-30MAR18 type: string description: instrument name (settlement and delivery only) mark_price: example: 11000 type: number description: mark price for at the settlement time (in quote currency; settlement and delivery only) position: example: 1000 type: number description: position size (in quote currency; settlement and delivery only) profit_loss: example: 0 type: number description: profit and loss (in base currency; settlement and delivery only) session_bankruptcy: example: 0.001160788 type: number description: value of session bankruptcy (in base currency; bankruptcy only) session_profit_loss: example: 0.001160788 type: number description: total value of session profit and losses (in base currency) session_tax: example: -0.001160788 type: number description: total amount of paid taxes/fees (in base currency; bankruptcy only) session_tax_rate: example: 0.000103333 type: number description: rate of paid taxes/fees (in base currency; bankruptcy only) socialized: example: -0.001160788 type: number description: the amount of the socialized losses (in base currency; bankruptcy only) timestamp: $ref: '#/components/schemas/timestamp' type: $ref: '#/components/schemas/settlement_type' required: - type - timestamp - session_profit_loss - position - instrument_name - index_price - funding type: object PrivateMassQuoteResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: object properties: orders: type: array items: $ref: '#/components/schemas/order' trades: type: array items: $ref: '#/components/schemas/user_trade' errors_count: type: integer description: 'Number of errors (present when `detailed` : `false`).' pending_requests_count: type: integer description: 'Number of pending quotes (present when `wait_for_response`: `false` and `detailed` : `false`).' pending_requests: type: array items: type: object properties: instrument_name: type: string description: Instrument name. side: type: string description: Quote side - `bid` or `ask`. description: 'List of pending quotes (present when `wait_for_response`: `false` and `detailed` : `true`).' errors: type: array items: type: object properties: instrument_name: type: string description: Instrument name. side: type: string description: Quote side - `bid` or `ask`. error: type: object description: Error data. code: type: integer description: Error code message: type: string description: Error message. description: 'List of errors (present when `detailed` : `true`).' required: - jsonrpc - result type: object index_name_derivative: enum: - btc_usd - eth_usd - btc_usdc - eth_usdc - ada_usdc - algo_usdc - avax_usdc - bch_usdc - bnb_usdc - doge_usdc - dot_usdc - link_usdc - ltc_usdc - near_usdc - paxg_usdc - shib_usdc - sol_usdc - ton_usdc - trx_usdc - trump_usdc - uni_usdc - xrp_usdc - usde_usdc - buidl_usdc - btcdvol_usdc - ethdvol_usdc - btc_usdt - eth_usdt - all type: string description: Index identifier of derivative instrument on the platform GetOpenOrdersResponse: type: object required: - jsonrpc - result properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: array description: Array of open orders for the authenticated portfolio. May be empty. items: $ref: '#/components/schemas/Order' direction: enum: - buy - sell type: string description: 'Direction: `buy`, or `sell`' PrivateGetOrderMarginByIdsResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: array items: $ref: '#/components/schemas/order_id_initial_margin_pair' required: - jsonrpc - result type: object PrivateCancelResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: $ref: '#/components/schemas/order' required: - jsonrpc - result type: object advanced: enum: - usd - implv type: string description: 'advanced type: `"usd"` or `"implv"` (Only for options; field is omitted if not applicable). ' web: type: boolean description: '`true` if created via Deribit frontend (optional)' PrivateGetMmpStatusResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: array items: type: object properties: index_name: $ref: '#/components/schemas/index_name' frozen_until: type: integer description: Timestamp (milliseconds since the UNIX epoch) until the user will be frozen - 0 means that the user is frozen until manual reset. mmp_group: type: string example: MassQuoteBot7 description: Triggered mmp group, this parameter is optional (appears only for Mass Quote orders trigger) block_rfq: type: boolean example: false description: If true, indicates that the MMP status is for Block RFQ. Block RFQ MMP status is completely separate from normal order/quote MMP status. required: - index_name - frozen_until - mmp_group required: - jsonrpc - result type: object position_move_trade: properties: source_uid: type: integer description: Trade source uid target_uid: type: integer description: Trade target uid instrument_name: $ref: '#/components/schemas/instrument_name' direction: $ref: '#/components/schemas/direction' description: Trade direction from source perspective price: $ref: '#/components/schemas/price' description: The price of the trade amount: type: number description: Trade amount. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. required: - instrument_name - direction - price - amount type: object PrivateGetOrderStateResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: $ref: '#/components/schemas/order' required: - jsonrpc - result type: object instrument_name: example: BTC-PERPETUAL type: string description: Unique instrument identifier block_trade_order: example: true type: boolean description: '`true` if order made from block_trade trade, added only in that case.' user_trade: properties: trade_id: $ref: '#/components/schemas/trade_id' trade_seq: $ref: '#/components/schemas/trade_seq' instrument_name: $ref: '#/components/schemas/instrument_name' timestamp: $ref: '#/components/schemas/trade_timestamp' order_type: type: string enum: - limit - market - liquidation description: 'Order type: `"limit`, `"market"`, or `"liquidation"`' advanced: type: string enum: - usd - implv description: 'Advanced type of user order: `"usd"` or `"implv"` (only for options; omitted if not applicable)' order_id: type: string description: Id of the user order (maker or taker), i.e. subscriber's order id that took part in the trade matching_id: type: string description: Always `null` direction: $ref: '#/components/schemas/direction' description: Trade direction of the taker tick_direction: $ref: '#/components/schemas/tick_direction' index_price: type: number description: Index Price at the moment of trade price: $ref: '#/components/schemas/price' description: The price of the trade amount: type: number description: Trade amount. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. contracts: type: number description: Trade size in contract units (optional, may be absent in historical trades) iv: type: number description: Option implied volatility for the price (Option only) underlying_price: type: number description: Underlying price for implied volatility calculations (Options only) liquidation: type: string enum: - M - T - MT description: 'Optional field (only for trades caused by liquidation): `"M"` when maker side of trade was under liquidation, `"T"` when taker side was under liquidation, `"MT"` when both sides of trade were under liquidation' liquidity: type: string enum: - M - T description: 'Describes what was role of users order: `"M"` when it was maker order, `"T"` when it was taker order' fee: type: number description: User's fee in units of the specified `fee_currency` fee_currency: $ref: '#/components/schemas/currency' label: $ref: '#/components/schemas/label_presentation' state: $ref: '#/components/schemas/order_state_in_user_trade' block_trade_id: $ref: '#/components/schemas/block_trade_id_in_result' block_rfq_id: type: integer description: ID of the Block RFQ - when trade was part of the Block RFQ block_rfq_quote_id: type: integer description: ID of the Block RFQ quote - when trade was part of the Block RFQ reduce_only: type: string description: '`true` if user order is reduce-only' post_only: type: string description: '`true` if user order is post-only' mmp: type: boolean description: '`true` if user order is MMP' risk_reducing: type: boolean description: '`true` if user order is marked by the platform as a risk reducing order (can apply only to orders placed by PM users)' api: type: boolean description: '`true` if user order was created with API' profit_loss: $ref: '#/components/schemas/profit_loss' mark_price: type: number description: Mark Price at the moment of trade legs: type: array description: Optional field containing leg trades if trade is a combo trade (present when querying for **only** combo trades and in `combo_trades` events) combo_id: type: string description: Optional field containing combo instrument name if the trade is a combo trade combo_trade_id: type: number description: Optional field containing combo trade identifier if the trade is a combo trade quote_set_id: type: string description: QuoteSet of the user order (optional, present only for orders placed with `private/mass_quote`) quote_id: type: string description: QuoteID of the user order (optional, present only for orders placed with `private/mass_quote`) trade_allocations: type: array items: type: object properties: user_id: type: integer description: User ID to which part of the trade is allocated. For brokers the User ID is obstructed. amount: type: number description: Amount allocated to this user. fee: type: number description: Fee for the allocated part of the trade. client_info: type: object properties: client_id: type: integer description: ID of a client; available to broker. Represents a group of users under a common name. client_link_id: type: integer description: ID assigned to a single user in a client; available to broker. name: type: string description: Name of the linked user within the client; available to broker. description: Optional client allocation info for brokers. required: - amount - fee description: List of allocations for Block RFQ pre-allocation. Each allocation specifies `user_id`, `amount`, and `fee` for the allocated part of the trade. For broker client allocations, a `client_info` object will be included. required: - trade_id - trade_seq - instrument_name - timestamp - order_id - matching_id - direction - tick_direction - index_price - price - amount - fee - fee_currency - state - mark_price type: object original_order_type: enum: - market - market_limit type: string description: Original order type. Optional field average_price: type: number description: Average fill price of the order usd: type: number description: Option price in USD (Only if `advanced="usd"`) simple_order_type: enum: - all - limit - trigger_all - stop - take - trailing_stop type: string description: 'Order type: `"all"`, `"limit"`, `"stop"`, `"take"`, `"trailing_stop"`, `"trailing_take"`' implv: type: number description: Implied volatility in percent. (Only if `advanced="implv"`) label_presentation: type: string description: User defined label (presented only when previously set for order by user) trigger_order_history_record: properties: timestamp: $ref: '#/components/schemas/timestamp' trigger: $ref: '#/components/schemas/trigger' trigger_price: $ref: '#/components/schemas/trigger_price' trigger_offset: $ref: '#/components/schemas/trigger_offset' trigger_order_id: type: string example: SLTB-187015 description: Id of the user order used for the trigger-order reference before triggering order_id: $ref: '#/components/schemas/order_id' order_state: $ref: '#/components/schemas/order_state_stop' instrument_name: $ref: '#/components/schemas/instrument_name' request: type: string example: trigger:order description: Type of last request performed on the trigger order by user or system. `"cancel"` - when order was cancelled, `"trigger:order"` - when trigger order spawned market or limit order after being triggered direction: $ref: '#/components/schemas/direction' price: $ref: '#/components/schemas/price' amount: $ref: '#/components/schemas/amount' last_update_timestamp: $ref: '#/components/schemas/timestamp' reduce_only: $ref: '#/components/schemas/reduce_only' post_only: $ref: '#/components/schemas/post_only' order_type: type: string enum: - limit - market description: 'Requested order type: `"limit` or `"market"`' label: $ref: '#/components/schemas/label_presentation' is_secondary_oto: $ref: '#/components/schemas/is_secondary_oto' oco_ref: $ref: '#/components/schemas/oco_ref' source: type: string example: api description: Source of the order that is linked to the trigger order. required: - trigger - timestamp - trigger_price - trigger_order_id - order_state - request - post_only - order_type - price - order_id - trigger_offset - instrument_name - amount - direction - reduce_only type: object tick_direction: enum: - 0 - 1 - 2 - 3 type: integer description: Direction of the "tick" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` = Minus Tick, `3` = Zero-Minus Tick). trigger_price: type: number description: Trigger price (Only for future trigger orders) profit_loss: type: number description: Profit and loss in base currency. reject_post_only: type: boolean description: '`true` if order has `reject_post_only` flag (field is present only when `post_only` is `true`)' oco_ref: type: string description: Unique reference that identifies a one_cancels_others (OCO) pair. trade_timestamp: example: 1517329113791 type: integer description: The timestamp of the trade (milliseconds since the UNIX epoch) PrivateGetOpenOrdersResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request result: type: array items: $ref: '#/components/schemas/order' required: - jsonrpc - result type: object order_type2: enum: - all - limit - trigger_all - stop_all - stop_limit - stop_market - take_all - take_limit - take_market - trailing_all - trailing_stop type: string description: 'Order type: `"all"`, `"limit"`, `"trigger_all"`, `"stop_all"`, `"stop_limit"`, `"stop_market"`, `"take_all"`, `"take_limit"`, `"take_market"`, `"trailing_all"`, `"trailing_stop"`' ErrorMessageResponse: properties: jsonrpc: type: string enum: - '2.0' description: The JSON-RPC version (2.0) id: type: integer description: The id that was sent in the request message: type: string error: type: integer required: - jsonrpc - message - error type: object mobile: type: boolean description: Optional field with value `true` added only when created with Mobile Application max_price: type: number description: The maximum price for the future. Any buy orders you submit higher than this price, will be clamped to this maximum. order_id: example: ETH-100234 type: string description: Unique order identifier trigger_fill_condition: enum: - first_hit - complete_fill - incremental type: string description: 'The fill condition of the linked order (Only for linked order types), default: `first_hit`.
interval of 3 implies a 3-second window. interval begins after the first trade. interval has ended, a new interval is started, and counters reset. interval, that interval continues unaffected. 0, MMP is disabled. 3600 seconds (1 hour).'
frozen_time:
type: integer
minimum: 0
maximum: 3600
description: 'Time in seconds that MMP remains active after being triggered. Once this frozen period has passed, MMP will automatically reset, allowing new orders to be submitted. frozen_time to 0. In that case, a manual reset is required using the private/reset_mmp method. 3600 seconds (1 hour).'
id:
type: integer
format: int64
description: Integer identifier for the MMP group (int64). This is the programmatic identifier for the group. Entries without an `mmp_group` name correspond to the orders MMP group (the default group).
mmp_group:
type: string
description: Name of the MMP group. Absent for the orders MMP group (the default group), which has no string name β its entry is identified by the `id` field alone.
quantity_limit:
type: number
description: 'The total traded quantity, measured in units of the base currency (e.g., BTC in BTC-PERPETUAL), within the interval. 10 BTC and sell 10 BTC = 20 total quantity. quantity_limit = quantity_limit * 0.03 interval. delta_limit is treated as an absolute threshold: e.g., delta_limit: 10 β MMP is triggered if net transaction delta exceeds +10 or drops below -10. +5 delta and selling β5 delta cancels out if within the same interval. Delta - Mark Price. In the rest of this document, "delta" actually refers to net transaction delta. interval, measured in absolute terms. delta_limit, the vega_limit is direction-aware and evaluated on a net basis. If the exposure exceeds the set threshold (positively or negatively), MMP will be triggered. interval of 3 implies a 3-second window. interval begins after the first trade. interval has ended, a new interval is started, and counters reset. interval, that interval continues unaffected. 0, MMP is disabled. 3600 seconds (1 hour).'
frozen_time:
type: integer
minimum: 0
maximum: 3600
description: 'Time in seconds that MMP remains active after being triggered. Once this frozen period has passed, MMP will automatically reset, allowing new orders to be submitted. frozen_time to 0. In that case, a manual reset is required using the private/reset_mmp method. 3600 seconds (1 hour).'
id:
type: integer
format: int64
description: Integer identifier for the MMP group (int64). This is the programmatic identifier for the group. Entries without an `mmp_group` name correspond to the orders MMP group (the default group).
mmp_group:
type: string
description: Name of the MMP group. Absent for the orders MMP group (the default group), which has no string name β its entry is identified by the `id` field alone.
quantity_limit:
type: number
description: 'The total traded quantity, measured in units of the base currency (e.g., BTC in BTC-PERPETUAL), within the interval. 10 BTC and sell 10 BTC = 20 total quantity. quantity_limit = quantity_limit * 0.03 interval. delta_limit is treated as an absolute threshold: e.g., delta_limit: 10 β MMP is triggered if net transaction delta exceeds +10 or drops below -10. +5 delta and selling β5 delta cancels out if within the same interval. Delta - Mark Price. In the rest of this document, "delta" actually refers to net transaction delta. interval, measured in absolute terms. delta_limit, the vega_limit is direction-aware and evaluated on a net basis. If the exposure exceeds the set threshold (positively or negatively), MMP will be triggered.