{ "opencollection": "1.0.0", "info": { "name": "Deribit Account Management Matching Engine API", "version": "2.1.1" }, "items": [ { "info": { "name": "Matching Engine", "type": "folder" }, "items": [ { "info": { "name": "GET /private/simulate_block_trade", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/simulate_block_trade", "params": [ { "name": "role", "value": "", "type": "query", "description": "Describes if user wants to be maker or taker of trades" }, { "name": "trades", "value": "", "type": "query", "description": "List of trades for block trade" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Checks if a block trade can be executed without actually executing it. Use this method to verify that a block trade will succeed before proceeding with the actual execution.\n\n**πŸ“– Related Article:** [Block Trading](https://docs.deribit.com/articles/block-trading-api)\n\n**Scope:** `block_trade:read`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fsimulate_block_trade)\n\n" }, { "info": { "name": "GET /private/verify_block_trade", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/verify_block_trade", "params": [ { "name": "timestamp", "value": "", "type": "query", "description": "Timestamp, shared with other party (milliseconds since the UNIX epoch)" }, { "name": "nonce", "value": "", "type": "query", "description": "Nonce, shared with other party" }, { "name": "role", "value": "", "type": "query", "description": "Describes if user wants to be maker or taker of trades" }, { "name": "trades", "value": "", "type": "query", "description": "List of trades for block trade" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Verifies and creates a block trade signature. This is the first step in the block trade workflow - the first party calls this method to generate a signature that must be shared with the second party.\n\n**Note:** In the API, the `direction` field is always expressed from the maker's perspective. This means that when you accept a block trade as a taker, the direction shown in the API represents the opposite side of your trade. For example, if you are buying puts as a taker, the API will show the op" }, { "info": { "name": "GET /private/execute_block_trade", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/execute_block_trade", "params": [ { "name": "timestamp", "value": "", "type": "query", "description": "Timestamp, shared with other party (milliseconds since the UNIX epoch)" }, { "name": "nonce", "value": "", "type": "query", "description": "Nonce, shared with other party" }, { "name": "role", "value": "", "type": "query", "description": "Describes if user wants to be maker or taker of trades" }, { "name": "trades", "value": "", "type": "query", "description": "List of trades for block trade" }, { "name": "counterparty_signature", "value": "", "type": "query", "description": "Signature of block trade generated by `private/verify_block_trade_method`" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Executes a block trade. This is the second step in the block trade workflow - the second party calls this method with the signature received from the first party to execute the trade.\n\nThe whole request must be exactly the same as in [private/verify_block_trade](https://docs.deribit.com/api-reference/block-trade/private-verify_block_trade), only the `role` field should be set appropriately - this means that both sides have to agree on the same `timestamp`, `nonce`, and `trades` fields, and the s" }, { "info": { "name": "GET /private/create_combo", "type": "http" }, "http": { "method": "GET", "url": "https://test.deribit.com/api/v2/private/create_combo", "params": [ { "name": "trades", "value": "", "type": "query", "description": "List of trades used to create a combo" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Verifies and creates a combo book or returns an existing combo matching the given trades. Combos allow trading on multiple instruments (futures and options) simultaneously as a single strategy.\n\nIf a combo matching the provided trades already exists, this method returns the existing combo. Otherwise, it creates a new combo book with the specified leg structure.\n\n**Scope:** `trade:read_write`\n\n[Try in API console](https://test.deribit.com/api_console?method=%2Fprivate%2Fcreate_combo)\n\n" }, { "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_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" } ] } ], "bundled": true }