curl --request GET \
--url https://test.deribit.com/api/v2/private/enable_cancel_on_disconnect \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 7859,
"method": "private/enable_cancel_on_disconnect",
"params": {
"scope": "account"
}
}
'{
"jsonrpc": "2.0",
"id": 7859,
"result": "ok"
}private/enable_cancel_on_disconnect
Enable Cancel On Disconnect for the connection. After enabling, all orders created via this connection will be automatically cancelled when the connection is closed.
Cancel is triggered in the following cases: when the TCP connection is properly terminated, when the connection is closed due to 10 minutes of inactivity, or when a heartbeat detects a disconnection. To reduce the inactivity timeout, consider using public/set_heartbeat.
Note: If the connection is gracefully closed using private/logout, cancel-on-disconnect will not be triggered.
Notice: Cancel-on-Disconnect does not affect orders created by other connections - they will remain active! When change is applied on the account scope, then every newly opened connection will start with active Cancel on Disconnect.
Scope & transport:
scope=connection(the default) applies to the current WebSocket connection only and is available over WebSocket only. Over REST/HTTP it fails with10030(must_be_websocket_request), so HTTP clients must passscope=account.scope=accountchanges the account setting, works over both WebSocket and REST/HTTP, and requires theaccount:read_writescope. Connection scope only requires an authenticated connection.
Restrictions: Not available for retail broker main accounts or their subaccounts: error 14021 (not_allowed_for_retail_brokers) is returned for both scopes.
Scope: account:read_write (only for scope=account)
curl --request GET \
--url https://test.deribit.com/api/v2/private/enable_cancel_on_disconnect \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 7859,
"method": "private/enable_cancel_on_disconnect",
"params": {
"scope": "account"
}
}
'{
"jsonrpc": "2.0",
"id": 7859,
"result": "ok"
}Query Parameters
Specifies if Cancel On Disconnect change should be applied/checked for the current connection or the account (default - connection)
NOTICE: Scope connection can be used only when working via Websocket.
connection, account Was this page helpful?