{ "opencollection": "1.0.0", "info": { "name": "Deribit Account Management Trading API", "version": "2.1.1" }, "items": [ { "info": { "name": "Trading", "type": "folder" }, "items": [ { "info": { "name": "GET /private/get_settlement_history_by_currency", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_settlement_history_by_currency", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "type", "value": "", "type": "query", "description": "Settlement type" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `20`, maximum - `1000`" }, { "name": "continuation", "value": "", "type": "query", "description": "Continuation token for pagination" }, { "name": "search_start_timestamp", "value": "", "type": "query", "description": "The latest timestamp to return result from (milliseconds since the UNIX epoch)" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\n**S" }, { "info": { "name": "GET /private/get_settlement_history_by_instrument", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_settlement_history_by_instrument", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "type", "value": "", "type": "query", "description": "Settlement type" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `20`, maximum - `1000`" }, { "name": "continuation", "value": "", "type": "query", "description": "Continuation token for pagination" }, { "name": "search_start_timestamp", "value": "", "type": "query", "description": "The latest timestamp to return result from (milliseconds since the UNIX epoch)" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://" }, { "info": { "name": "GET /private/get_order_history_by_instrument", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_order_history_by_instrument", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `20`, maximum - `1000`" }, { "name": "offset", "value": "", "type": "query", "description": "The offset for pagination, default - `0`" }, { "name": "include_old", "value": "", "type": "query", "description": "Include in result orders older than 2 days, default - `false`" }, { "name": "include_unfilled", "value": "", "type": "query", "description": "Include in result fully unfilled closed orders, default - `false`" }, { "name": "with_continuation", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Continuation token for pagination" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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).\n\nResults 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.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https:" }, { "info": { "name": "GET /private/get_order_history_by_currency", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_order_history_by_currency", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `20`, maximum - `1000`" }, { "name": "offset", "value": "", "type": "query", "description": "The offset for pagination, default - `0`" }, { "name": "include_old", "value": "", "type": "query", "description": "Include in result orders older than 2 days, default - `false`" }, { "name": "include_unfilled", "value": "", "type": "query", "description": "Include in result fully unfilled closed orders, default - `false`" }, { "name": "with_continuation", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Continuation token for pagination" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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).\n\nResults 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.\n\n**πŸ“– Related Article:** [Accessing Historical Trade" }, { "info": { "name": "GET /private/get_order_state", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_order_state", "params": [ { "name": "order_id", "value": "", "type": "query", "description": "The order id" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\n**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.\n\n**Scope:** `trade:read`\n\n[Try in API consol" }, { "info": { "name": "GET /private/get_order_state_by_label", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_order_state_by_label", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_state_by_label)" }, { "info": { "name": "GET /private/get_open_orders", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_open_orders", "params": [ { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, if not provided instruments of all kinds are considered" }, { "name": "type", "value": "", "type": "query", "description": "Order type, default - `all`" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults can be filtered by instrument kind and order type. This method provides a comprehensive view of all active orders.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders)\n\n" }, { "info": { "name": "GET /private/get_open_orders_by_instrument", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_open_orders_by_instrument", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "type", "value": "", "type": "query", "description": "Order type, default - `all`" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults can be filtered by order type. This method is useful for checking active orders for a particular instrument.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_instrument)\n\n" }, { "info": { "name": "GET /private/get_open_orders_by_currency", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_open_orders_by_currency", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, if not provided instruments of all kinds are considered" }, { "name": "type", "value": "", "type": "query", "description": "Order type, default - `all`" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults can be filtered by instrument kind and order type. This method provides a view of all active orders within a currency.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_currency)\n\n" }, { "info": { "name": "GET /private/get_open_orders_by_label", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_open_orders_by_label", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nOpen orders are orders that have been placed but not yet filled or cancelled. The label helps organize and identify related orders.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_open_orders_by_label)\n\n" }, { "info": { "name": "GET /private/get_order_margin_by_ids", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_order_margin_by_ids", "params": [ { "name": "ids", "value": "", "type": "query", "description": "Ids of orders" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nThis method is useful for calculating margin requirements before placing orders, helping to ensure sufficient funds are available.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_order_margin_by_ids)\n\n" }, { "info": { "name": "GET /private/get_trigger_order_history", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_trigger_order_history", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `20`, maximum - `1000`" }, { "name": "continuation", "value": "", "type": "query", "description": "Continuation token for pagination" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\n**Scope:** `trade:read`\n\n[Try in API console](h" }, { "info": { "name": "GET /private/get_user_trades_by_instrument", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_user_trades_by_instrument", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "start_seq", "value": "", "type": "query", "description": "The sequence number of the first trade to be returned" }, { "name": "end_seq", "value": "", "type": "query", "description": "The sequence number of the last trade to be returned" }, { "name": "count", "value": "", "type": "query", "description": "Number of requested items, default - `10`, maximum - `1000`" }, { "name": "start_timestamp", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" }, { "name": "sorting", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Id of a subaccount" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\nMain accounts may use the `subaccount_id` parameter to retrieve t" }, { "info": { "name": "GET /private/get_user_trades_by_instrument_and_time", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_user_trades_by_instrument_and_time", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "start_timestamp", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Number of requested items, default - `10`, maximum - `1000`" }, { "name": "sorting", "value": "", "type": "query", "description": "Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database)" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" }, { "name": "subaccount_id", "value": "", "type": "query", "description": "Id of a subaccount" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nUse 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.\n\nMain accounts may use t" }, { "info": { "name": "GET /private/get_user_trades_by_currency", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_user_trades_by_currency", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "start_id", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Number of requested items, default - `10`, maximum - `1000`" }, { "name": "start_timestamp", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database)" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" }, { "name": "subaccount_id", "value": "", "type": "query", "description": "The user id for the subaccount" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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" }, { "info": { "name": "GET /private/get_user_trades_by_currency_and_time", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_user_trades_by_currency_and_time", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "start_timestamp", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Number of requested items, default - `10`, maximum - `1000`" }, { "name": "sorting", "value": "", "type": "query", "description": "Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database)" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" }, { "name": "subaccount_id", "value": "", "type": "query", "description": "Id of a subaccount" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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 activi" }, { "info": { "name": "GET /private/get_user_trades_by_order", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_user_trades_by_order", "params": [ { "name": "order_id", "value": "", "type": "query", "description": "The order id" }, { "name": "sorting", "value": "", "type": "query", "description": "Direction of results sorting (`default` value means no sorting, results will be returned in order in which they left the database)" }, { "name": "historical", "value": "", "type": "query", "description": "Determines whether historical trade and order records should be retrieved.\n\n- `false` (default): Returns recent records: orders for 30 min, trades for 24h.\n- `true`: Fetches historical records, available after a short delay due to indexing. Recent data is not included.\n\n**πŸ“– Related Article:** [Accessing Historical Trades and Orders Using API](https://docs.deribit.com/articles/accessing-historical-trades-orders)\n" }, { "name": "subaccount_id", "value": "", "type": "query", "description": "Id of a subaccount" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nResults 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.\n\nMain accounts may use the `subaccount_id` parameter to retrieve trade data for a specific " }, { "info": { "name": "GET /private/cancel_all", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_all", "params": [ { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "freeze_quotes", "value": "", "type": "query", "description": "Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nUse 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.\n\n**Note:** This operation cannot be undone. All open orders will be permanently cancelled.\n\n**Scope:** `trade:read_write`\n\n[Try in API con" }, { "info": { "name": "GET /private/cancel_all_by_instrument", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_all_by_instrument", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "type", "value": "", "type": "query", "description": "Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all`" }, { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "include_combos", "value": "", "type": "query", "description": "When set to `true` orders in combo instruments affecting a given position will also be cancelled. Default: `false`" }, { "name": "freeze_quotes", "value": "", "type": "query", "description": "Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Cancels all open orders for a specific instrument. This is useful for quickly clearing all orders for a single instrument.\n\nOrders 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_instrument)\n\n" }, { "info": { "name": "GET /private/cancel_all_by_currency", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_all_by_currency", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "type", "value": "", "type": "query", "description": "Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all`" }, { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "freeze_quotes", "value": "", "type": "query", "description": "Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Cancels all open orders for a specific currency. This is useful for quickly clearing all orders across multiple instruments in a currency.\n\nOrders 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_currency)\n\n" }, { "info": { "name": "GET /private/cancel_all_by_currency_pair", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_all_by_currency_pair", "params": [ { "name": "currency_pair", "value": "", "type": "query", "description": "The currency pair symbol" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "type", "value": "", "type": "query", "description": "Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all`" }, { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "freeze_quotes", "value": "", "type": "query", "description": "Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Cancels all open orders for a specific currency pair. This is useful for quickly clearing all orders across instruments in a currency pair.\n\nOrders 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel_all_by_currency_pair)\n\n" }, { "info": { "name": "GET /private/cancel_all_by_kind_or_type", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_all_by_kind_or_type", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol, list of currency symbols or `\"any\"` for all" }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "type", "value": "", "type": "query", "description": "Order type - `limit`, `stop`, `take`, `trigger_all` or `all`, default - `all`" }, { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "freeze_quotes", "value": "", "type": "query", "description": "Whether or not to reject incoming quotes for 1 second after cancelling (`false` by default). Related to `private/mass_quote` request." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nSpecify 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivat" }, { "info": { "name": "GET /private/cancel_by_label", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_by_label", "params": [ { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" }, { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nOrders can be cancelled across all currencies or filtered to a specific currency. When cancelling by currency, the currency queue is used for processing.\n\n**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" }, { "info": { "name": "GET /private/cancel_quotes", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel_quotes", "params": [ { "name": "detailed", "value": "", "type": "query", "description": "When `detailed` is set to `true`, the output format is changed to include a list of all cancelled orders.\n\n**πŸ“– Related Article:** [Detailed Response for Cancel Methods](https://docs.deribit.com/articles/json-rpc-overview#detailed-response-for-cancel-methods)\n\nDefault: `false`\n" }, { "name": "freeze_quotes", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Type of cancel criteria." }, { "name": "min_delta", "value": "", "type": "query", "description": "Min delta to cancel by delta (for `cancel_type`: `delta`)." }, { "name": "max_delta", "value": "", "type": "query", "description": "Max delta to cancel by delta (for `cancel_type`: `delta`)." }, { "name": "quote_set_id", "value": "", "type": "query", "description": "Unique identifier for the Quote set." }, { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name." }, { "name": "kind", "value": "", "type": "query", "description": "Instrument kind, `\"combo\"` for any combo or `\"any\"` for all. If not provided instruments of all kinds are considered" }, { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "currency_pair", "value": "", "type": "query", "description": "The currency pair symbol" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Cancels quotes (mass quote orders) based on various criteria. This method provides flexible options for cancelling quotes:\n\n- `delta`: Cancels quotes within a delta range defined by `min_delta` and `max_delta`\n- `quote_set_id`: Cancels quotes by a specific Quote Set identifier\n- `instrument`: Cancels all quotes associated with a particular instrument\n- `kind`: Cancels all quotes for a certain instrument kind\n- `currency`: Cancels all quotes in a specified currency\n- `currency_pair`: Cancels all " }, { "info": { "name": "GET /private/cancel", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/cancel", "params": [ { "name": "order_id", "value": "", "type": "query", "description": "The order id" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Cancels a specific order identified by its order ID. The order must be open (not yet filled or cancelled) to be cancelled successfully.\n\nOnce cancelled, the order is removed from the order book and cannot be restored. Any unfilled portion of the order will be cancelled.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcancel)\n\n" }, { "info": { "name": "GET /private/buy", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/buy", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "amount", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "The order type, default: `\"limit\"`" }, { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" }, { "name": "price", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "

Specifies how long the order remains in effect. Default `\"good_til_cancelled\"`

" }, { "name": "display_amount", "value": "", "type": "query", "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." }, { "name": "post_only", "value": "", "type": "query", "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.

Only valid in combination with time_in_force=`\"good_til_cancelled\"`

" }, { "name": "reject_post_only", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "If `true`, the order is considered reduce-only which is intended to only reduce a current position" }, { "name": "trigger_price", "value": "", "type": "query", "description": "Trigger price, required for trigger orders only (Stop-loss or Take-profit orders)" }, { "name": "trigger_offset", "value": "", "type": "query", "description": "The maximum deviation from the price peak beyond which the order will be triggered" }, { "name": "trigger", "value": "", "type": "query", "description": "Defines the trigger type. Required for `\"Stop-Loss\"`, `\"Take-Profit\"` and `\"Trailing\"` trigger orders" }, { "name": "advanced", "value": "", "type": "query", "description": "Advanced option order type. (Only for options. Advanced USD orders are not supported for linear options.)" }, { "name": "mmp", "value": "", "type": "query", "description": "Order MMP flag, only for order_type 'limit'" }, { "name": "valid_until", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "

The type of the linked order.

" }, { "name": "trigger_fill_condition", "value": "", "type": "query", "description": "

The fill condition of the linked order (Only for linked order types), default: `first_hit`.

" }, { "name": "otoco_config", "value": "", "type": "query", "description": "List of orders to create or cancel when this order is filled." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Places a buy order for an instrument. Supports various order types including limit, market, stop, and advanced order types (stop-limit, take-profit, take-profit-limit, trailing-stop, etc.).\n\nYou can specify order parameters such as price, quantity, time-in-force, post-only, reduce-only, and trigger conditions. Orders can be labeled for easier management and tracking.\n\n**πŸ“– Related Article:** [Order Management Best Practices](https://docs.deribit.com/articles/order-management-best-practices)\n\n**S" }, { "info": { "name": "GET /private/sell", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/sell", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "amount", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "The order type, default: `\"limit\"`" }, { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" }, { "name": "price", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "

Specifies how long the order remains in effect. Default `\"good_til_cancelled\"`

" }, { "name": "display_amount", "value": "", "type": "query", "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." }, { "name": "post_only", "value": "", "type": "query", "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 above the spread.

Only valid in combination with time_in_force=`\"good_til_cancelled\"`

" }, { "name": "reject_post_only", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "If `true`, the order is considered reduce-only which is intended to only reduce a current position" }, { "name": "trigger_price", "value": "", "type": "query", "description": "Trigger price, required for trigger orders only (Stop-loss or Take-profit orders)" }, { "name": "trigger_offset", "value": "", "type": "query", "description": "The maximum deviation from the price peak beyond which the order will be triggered" }, { "name": "trigger", "value": "", "type": "query", "description": "Defines the trigger type. Required for `\"Stop-Loss\"`, `\"Take-Profit\"` and `\"Trailing\"` trigger orders" }, { "name": "advanced", "value": "", "type": "query", "description": "Advanced option order type. (Only for options. Advanced USD orders are not supported for linear options.)" }, { "name": "mmp", "value": "", "type": "query", "description": "Order MMP flag, only for order_type 'limit'" }, { "name": "valid_until", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "

The type of the linked order.

" }, { "name": "trigger_fill_condition", "value": "", "type": "query", "description": "

The fill condition of the linked order (Only for linked order types), default: `first_hit`.

" }, { "name": "otoco_config", "value": "", "type": "query", "description": "List of orders to create or cancel when this order is filled." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Places a sell order for an instrument. Supports various order types including limit, market, stop, and advanced order types (stop-limit, take-profit, take-profit-limit, trailing-stop, etc.).\n\nYou can specify order parameters such as price, quantity, time-in-force, post-only, reduce-only, and trigger conditions. Orders can be labeled for easier management and tracking. Market Maker Protection (MMP) can be enabled to prevent excessive quoting.\n\n**πŸ“– Related Article:** [Order Management Best Practi" }, { "info": { "name": "GET /private/edit", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/edit", "params": [ { "name": "order_id", "value": "", "type": "query", "description": "The order id" }, { "name": "amount", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "If `true`, the order is considered reduce-only which is intended to only reduce a current position" }, { "name": "reject_post_only", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Trigger price, required for trigger orders only (Stop-loss or Take-profit orders)" }, { "name": "trigger_offset", "value": "", "type": "query", "description": "The maximum deviation from the price peak beyond which the order will be triggered" }, { "name": "mmp", "value": "", "type": "query", "description": "Order MMP flag, only for order_type 'limit'" }, { "name": "valid_until", "value": "", "type": "query", "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", "value": "", "type": "query", "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." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nThe 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.\n\n**πŸ“– Related Article:** [Order Management Best Practices](https://docs.deribit.com/articles/order-management-best-practices)\n\n**Scope:** `trad" }, { "info": { "name": "GET /private/edit_by_label", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/edit_by_label", "params": [ { "name": "label", "value": "", "type": "query", "description": "user defined label for the order (maximum 64 characters)" }, { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "amount", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "If `true`, the order is considered reduce-only which is intended to only reduce a current position" }, { "name": "reject_post_only", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Trigger price, required for trigger orders only (Stop-loss or Take-profit orders)" }, { "name": "mmp", "value": "", "type": "query", "description": "Order MMP flag, only for order_type 'limit'" }, { "name": "valid_until", "value": "", "type": "query", "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." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Modifies an order identified by its label. This method works only when there is exactly one open order with the specified label.\n\nYou 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fedit_by_label)\n\n" }, { "info": { "name": "GET /private/close_position", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/close_position", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "type", "value": "", "type": "query", "description": "The order type" }, { "name": "price", "value": "", "type": "query", "description": "Optional price for limit order." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nYou 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.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fclose_position)\n\n" }, { "info": { "name": "GET /private/get_margins", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_margins", "params": [ { "name": "instrument_name", "value": "", "type": "query", "description": "Instrument name" }, { "name": "amount", "value": "", "type": "query", "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." }, { "name": "price", "value": "", "type": "query", "description": "Price" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Calculates margin requirements for a hypothetical order on a given instrument. Returns initial margin and maintenance margin for the specified instrument, quantity, and price.\n\nThis 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.\n\n**Scope:** `trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fget_margins)\n\n" }, { "info": { "name": "GET /private/get_mmp_config", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_mmp_config", "params": [ { "name": "index_name", "value": "", "type": "query", "description": "Index identifier of derivative instrument on the platform; skipping this parameter will return all configurations" }, { "name": "mmp_group", "value": "", "type": "query", "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.\n\n**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.\n\n**πŸ“– Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications)\n" }, { "name": "block_rfq", "value": "", "type": "query", "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.\n" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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`.\n\nIf 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.\n\nFor Mass Quotes, specify the `mmp_group` " }, { "info": { "name": "GET /private/get_mmp_status", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/get_mmp_status", "params": [ { "name": "index_name", "value": "", "type": "query", "description": "Index identifier of derivative instrument on the platform; skipping this parameter will return all configurations" }, { "name": "mmp_group", "value": "", "type": "query", "description": "Specifies the MMP group for which the status is being retrieved. The `index_name` must be specified before using this parameter.\n\n**πŸ“– Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications)\n" }, { "name": "block_rfq", "value": "", "type": "query", "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.\n" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nIf 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.\n\nFor Mass Quotes, specify the `mmp_group` paramet" }, { "info": { "name": "GET /private/set_mmp_config", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/set_mmp_config", "params": [ { "name": "index_name", "value": "", "type": "query", "description": "Index identifier of derivative instrument on the platform" }, { "name": "interval", "value": "", "type": "query", "description": "The duration of the monitoring window in seconds. For example, an `interval` of `3` implies a 3-second window.\n\nThe `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.\n\nThis mechanism allows the platform to track activity in short, rolling windows to identify potentially risky trading behavior.\n\nIf set to `0`, MMP is removed.\n\nMaximum value: `3600` seconds (1 hour).\n" }, { "name": "frozen_time", "value": "", "type": "query", "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.\n\nIf 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.\n\nManual reset is also possible during the frozen time period.\n\nMaximum value: `3600` seconds (1 hour).\n" }, { "name": "mmp_group", "value": "", "type": "query", "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.\n\n**πŸ“– Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications)\n" }, { "name": "quantity_limit", "value": "", "type": "query", "description": "The total traded quantity, measured in units of the base currency (e.g., BTC in `BTC-PERPETUAL`), within the `interval`.\n\nThis count is direction-agnosticβ€”a buy followed by a sell counts double.\n\nExample: Buy `10` BTC and sell `10` BTC = `20` total quantity.\n\nApplicable to both options and futures.\n\nPositive value with maximum 4 decimal places.\n" }, { "name": "delta_limit", "value": "", "type": "query", "description": "The maximum allowable net transaction delta change during the `interval`.\n\nExpressed in units of base currency.\n\nThe `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`.\n\nDirection matters: buying `+5` delta and selling `βˆ’5` delta cancels out if within the same `interval`.\n\n**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.\n\nPositive value with maximum 4 decimal places.\n" }, { "name": "vega_limit", "value": "", "type": "query", "description": "The maximum change in vega exposure allowed within a given `interval`, measured in absolute terms.\n\nExpressed in USD, representing the change in sensitivity to implied volatility across executed trades.\n\nThis parameter is primarily relevant for options traders managing risk in volatile markets.\n\nSimilar 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.\n\n**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.\n\nPositive value with maximum 4 decimal places.\n" }, { "name": "max_quote_quantity", "value": "", "type": "query", "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", "value": "", "type": "query", "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.\n" }, { "name": "trade_count_limit", "value": "", "type": "query", "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`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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).\n\nAt 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).\n\nThe `interval` parameter defines the monitoring window duration in seconds" }, { "info": { "name": "GET /private/reset_mmp", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/reset_mmp", "params": [ { "name": "index_name", "value": "", "type": "query", "description": "Currency pair for which to reset MMP limits.\n\n**For regular MMP (`block_rfq = false`):** Must be a specific currency pair (e.g., \"btc_usd\", \"eth_usd\"). The value `\"all\"` is not allowed.\n\n**For Block RFQ MMP (`block_rfq = true`):** Can be either a specific currency pair or `\"all\"` to reset MMP limits across all currency pairs.\n" }, { "name": "mmp_group", "value": "", "type": "query", "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.\n\n**πŸ“– Related Article:** [Mass Quotes Specifications](https://docs.deribit.com/articles/mass-quotes-specifications)\n" }, { "name": "block_rfq", "value": "", "type": "query", "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.\n" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\nIf 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.\n\nFor re" }, { "info": { "name": "GET /private/mass_quote", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/mass_quote", "params": [ { "name": "wait_for_response", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "Identifier of a mass quote message. Can be used to match trades to requests. We recommend using an incrementing counter." }, { "name": "mmp_group", "value": "", "type": "query", "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", "value": "", "type": "query", "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", "value": "", "type": "query", "description": "List of quotes." } ], "body": { "type": "json", "data": "{}" } }, "docs": "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.\n\n**Requirements:**\n- 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.\n- This endpoint can only be used after approval from the administrators.\n\nEach " }, { "info": { "name": "GET /private/move_positions", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/move_positions", "params": [ { "name": "currency", "value": "", "type": "query", "description": "The currency symbol" }, { "name": "source_uid", "value": "", "type": "query", "description": "Id of source subaccount. Can be found in `My Account >> Subaccounts` tab" }, { "name": "target_uid", "value": "", "type": "query", "description": "Id of target subaccount. Can be found in `My Account >> Subaccounts` tab" }, { "name": "trades", "value": "", "type": "query", "description": "List of trades for position move" } ], "body": { "type": "json", "data": "{}" } }, "docs": "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\nF" }, { "info": { "name": "Get Open Orders", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/api/v2/private/get_open_orders" }, "docs": "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.\n\nThe 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.\n\nThis endpoint is rate-limited per portfolio. E" } ] } ], "bundled": true }