Global Derivatives Clients
Clients for Global Derivatives on the Deribit-powered gateway. Both use JSON-RPC 2.0 and the same CDP API keys as the rest of the SDK.
DeribitRetailClient (REST)
- class coinbase.deribit.DeribitRetailClient(api_key: str | None = None, api_secret: str | None = None, key_file: Any | None = None, environment: str = 'production', base_url: str | None = None, api_prefix: str = '/api/v2', timeout: int | None = 30, verbose: bool = False)[source]
Synchronous REST client for the Deribit Retail gateway (drb.coinbase.com).
A convenience surface over HTTP;
DeribitRetailWSClientis the primary transport. Every Deribit RPC method is a typed method on this class (mixed in from the generated layer); each forwards to_rpc(), which handles the JSON-RPC envelope, bearer auth for private methods, and error mapping.Authenticates with the same CDP keys as the spot RESTClient (Ed25519 or ECDSA), exchanging a CDP JWT at public/auth for a short-lived access_token that is refreshed automatically.
- call(method: str, params: dict | None = None)[source]
Escape hatch: invoke any Deribit method by name with a raw params dict.
Returns the raw response dict. Use the typed methods for the documented surface; this covers anything not yet wrapped.
- private_buy(instrument_name, *, amount=None, contracts=None, type=None, label=None, price=None, time_in_force=None, display_amount=None, post_only=None, reject_post_only=None, reduce_only=None, trigger_price=None, trigger_offset=None, trigger=None, advanced=None, mmp=None, valid_until=None, linked_order_type=None, trigger_fill_condition=None, otoco_config=None, isolated=None, allocated_margin=None)
private/buy
- private_cancel(order_id, *, isolated=None)
private/cancel
- private_cancel_all(*, detailed=None, freeze_quotes=None, include_isolated=None)
private/cancel_all
- private_cancel_all_by_currency(currency, *, kind=None, type=None, detailed=None, freeze_quotes=None, include_isolated=None)
private/cancel_all_by_currency
- private_cancel_all_by_currency_pair(currency_pair, *, kind=None, type=None, detailed=None, freeze_quotes=None)
private/cancel_all_by_currency_pair
- private_cancel_all_by_instrument(instrument_name, *, type=None, detailed=None, include_combos=None, freeze_quotes=None, include_isolated=None)
private/cancel_all_by_instrument
- private_cancel_all_by_kind_or_type(currency, *, kind=None, type=None, detailed=None, freeze_quotes=None)
private/cancel_all_by_kind_or_type
- private_cancel_by_label(label, *, currency=None, include_isolated=None)
private/cancel_by_label
- private_change_margin_model(margin_model, *, user_id=None, dry_run=None)
private/change_margin_model
- private_close_position(instrument_name, type, *, price=None, isolated=None)
private/close_position
- private_create_combo(trades)
private/create_combo
- private_edit(order_id, *, amount=None, contracts=None, price=None, post_only=None, reduce_only=None, reject_post_only=None, advanced=None, trigger_price=None, trigger_offset=None, mmp=None, valid_until=None, display_amount=None, isolated=None, allocated_margin=None)
private/edit
- private_edit_by_label(instrument_name, *, label=None, amount=None, contracts=None, price=None, post_only=None, reduce_only=None, reject_post_only=None, advanced=None, trigger_price=None, mmp=None, valid_until=None, isolated=None, allocated_margin=None)
private/edit_by_label
- private_get_account_summaries(*, subaccount_id=None, extended=None, include_isolated=None)
private/get_account_summaries
- private_get_account_summary(currency, *, subaccount_id=None, extended=None)
private/get_account_summary
- private_get_broker_trade_requests()
private/get_broker_trade_requests
- private_get_broker_trades(*, currency=None, count=None, start_id=None, end_id=None)
private/get_broker_trades
- private_get_leg_prices(legs, price)
private/get_leg_prices
- private_get_leverage(*, instrument_name=None, subaccount_id=None, isolated=None)
private/get_leverage
- private_get_margins(instrument_name, amount, price, *, isolated=None)
private/get_margins
- private_get_max_order_size(instrument_name, *, subaccount_id=None, isolated=None, leverage=None, taker_fee_rate=None, price=None)
private/get_max_order_size
- private_get_open_orders(*, kind=None, type=None, include_isolated=None, subaccount_id=None)
private/get_open_orders
- private_get_open_orders_by_currency(currency, *, kind=None, type=None)
private/get_open_orders_by_currency
- private_get_open_orders_by_instrument(instrument_name, *, type=None)
private/get_open_orders_by_instrument
- private_get_open_orders_by_label(currency, label)
private/get_open_orders_by_label
- private_get_order_history_by_currency(currency, *, kind=None, count=None, offset=None, include_old=None, include_unfilled=None, with_continuation=None, continuation=None, historical=None, subaccount_id=None)
private/get_order_history_by_currency
- private_get_order_history_by_instrument(instrument_name, *, count=None, offset=None, include_old=None, include_unfilled=None, with_continuation=None, continuation=None, historical=None)
private/get_order_history_by_instrument
- private_get_order_margin_by_ids(ids, *, isolated=None)
private/get_order_margin_by_ids
- private_get_order_state(order_id, *, isolated=None)
private/get_order_state
- private_get_order_state_by_label(currency, label, *, include_isolated=None)
private/get_order_state_by_label
- private_get_pme_params(currency)
private/get_pme_params
- private_get_position(instrument_name, *, include_isolated=None)
private/get_position
- private_get_positions(*, currency=None, kind=None, subaccount_id=None, include_isolated=None)
private/get_positions
- private_get_risk_profile()
private/get_risk_profile
- private_get_settlement_history_by_currency(currency, *, type=None, count=None, continuation=None, search_start_timestamp=None, subaccount_id=None)
private/get_settlement_history_by_currency
- private_get_settlement_history_by_instrument(instrument_name, *, type=None, count=None, continuation=None, search_start_timestamp=None)
private/get_settlement_history_by_instrument
- private_get_subaccounts(*, with_portfolio=None, include_isolated=None)
private/get_subaccounts
- private_get_subaccounts_details(currency, *, with_open_orders=None, include_isolated=None)
private/get_subaccounts_details
- private_get_trading_limits(currency)
private/get_trading_limits
- private_get_transaction_log(currency, start_timestamp, end_timestamp, *, query=None, count=None, subaccount_id=None, continuation=None)
private/get_transaction_log
- private_get_trigger_order_history(currency, *, instrument_name=None, count=None, continuation=None)
private/get_trigger_order_history
- private_get_user_locks()
private/get_user_locks
- private_get_user_trades_by_currency(currency, *, kind=None, start_id=None, end_id=None, count=None, start_timestamp=None, end_timestamp=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_currency
- private_get_user_trades_by_currency_and_time(currency, start_timestamp, end_timestamp, *, kind=None, count=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_currency_and_time
- private_get_user_trades_by_instrument(instrument_name, *, start_seq=None, end_seq=None, count=None, start_timestamp=None, end_timestamp=None, historical=None, sorting=None, subaccount_id=None)
private/get_user_trades_by_instrument
- private_get_user_trades_by_instrument_and_time(instrument_name, start_timestamp, end_timestamp, *, count=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_instrument_and_time
- private_get_user_trades_by_order(order_id, *, sorting=None, historical=None, subaccount_id=None, isolated=None)
private/get_user_trades_by_order
- private_pme_simulate(currency, *, add_positions=None, simulated_positions=None)
private/pme/simulate
- private_sell(instrument_name, *, amount=None, contracts=None, type=None, label=None, price=None, time_in_force=None, display_amount=None, post_only=None, reject_post_only=None, reduce_only=None, trigger_price=None, trigger_offset=None, trigger=None, advanced=None, mmp=None, valid_until=None, linked_order_type=None, trigger_fill_condition=None, otoco_config=None, isolated=None, allocated_margin=None)
private/sell
- private_set_leverage(instrument_name, leverage, *, subaccount_id=None, isolated=None)
private/set_leverage
- private_simulate_portfolio(currency, *, add_positions=None, simulated_positions=None)
private/simulate_portfolio
- private_submit_transfer_between_subaccounts(currency, amount, destination, *, source=None, nonce=None)
private/submit_transfer_between_subaccounts
- public_auth(grant_type, token)
public/auth
- public_get_announcements(*, start_timestamp=None, count=None)
public/get_announcements
- public_get_book_summary_by_currency(currency, *, kind=None)
public/get_book_summary_by_currency
- public_get_book_summary_by_instrument(instrument_name)
public/get_book_summary_by_instrument
- public_get_combo_details(combo_id)
public/get_combo_details
- public_get_combo_ids(currency, *, state=None)
public/get_combo_ids
- public_get_combos(currency)
public/get_combos
- public_get_contract_size(instrument_name)
public/get_contract_size
- public_get_currencies()
public/get_currencies
- public_get_delivery_prices(index_name, *, offset=None, count=None)
public/get_delivery_prices
- public_get_expirations(currency, kind, *, currency_pair=None)
public/get_expirations
- public_get_funding_chart_data(instrument_name, length)
public/get_funding_chart_data
- public_get_funding_rate_history(instrument_name, start_timestamp, end_timestamp)
public/get_funding_rate_history
- public_get_funding_rate_value(instrument_name, start_timestamp, end_timestamp)
public/get_funding_rate_value
- public_get_historical_volatility(currency)
public/get_historical_volatility
- public_get_index_chart_data(index_name, range)
public/get_index_chart_data
- public_get_index_price(index_name)
public/get_index_price
- public_get_index_price_names(*, extended=None)
public/get_index_price_names
- public_get_instrument(instrument_name)
public/get_instrument
- public_get_instruments(currency, *, kind=None, expired=None)
public/get_instruments
- public_get_last_settlements_by_currency(currency, *, type=None, count=None, continuation=None, search_start_timestamp=None)
public/get_last_settlements_by_currency
- public_get_last_settlements_by_instrument(instrument_name, *, type=None, count=None, continuation=None, search_start_timestamp=None)
public/get_last_settlements_by_instrument
- public_get_last_trades_by_currency(currency, *, kind=None, start_id=None, end_id=None, start_timestamp=None, end_timestamp=None, count=None, sorting=None)
public/get_last_trades_by_currency
- public_get_last_trades_by_currency_and_time(currency, start_timestamp, end_timestamp, *, kind=None, count=None, sorting=None)
public/get_last_trades_by_currency_and_time
- public_get_last_trades_by_instrument(instrument_name, *, start_seq=None, end_seq=None, start_timestamp=None, end_timestamp=None, count=None, sorting=None)
public/get_last_trades_by_instrument
- public_get_last_trades_by_instrument_and_time(instrument_name, start_timestamp, end_timestamp, *, count=None, sorting=None)
public/get_last_trades_by_instrument_and_time
- public_get_mark_price_history(instrument_name, start_timestamp, end_timestamp)
public/get_mark_price_history
- public_get_order_book(instrument_name, *, depth=None)
public/get_order_book
- public_get_order_book_by_instrument_id(instrument_id, *, depth=None)
public/get_order_book_by_instrument_id
- public_get_supported_index_names(*, type=None)
public/get_supported_index_names
- public_get_time()
public/get_time
- public_get_trade_volumes(*, extended=None)
public/get_trade_volumes
- public_get_volatility_index_data(currency, start_timestamp, end_timestamp, resolution)
public/get_volatility_index_data
- public_status()
public/status
- public_test(*, expected_result=None)
public/test
- public_ticker(instrument_name)
public/ticker
- public_tickers_by_currency(currency, *, kind=None, depth=None)
public/tickers_by_currency
DeribitRetailWSClient (WebSocket)
Without keys, the client connects to the market data host. With keys, it connects to the trading host for user.* channels and RPC.
- class coinbase.deribit.DeribitRetailWSClient(api_key: str | None = None, api_secret: str | None = None, key_file: Any | None = None, environment: str = 'production', url: str | None = None, timeout: int | None = 30, verbose: bool = False)[source]
Synchronous, thread-backed WebSocket client for the Deribit Retail gateway.
This is the primary transport. Every Deribit RPC method is available as a typed method (mixed in from the generated layer) and runs over the socket; subscription channels deliver to per-channel callbacks.
Concurrency model: a single background reader thread reads frames and demuxes them by JSON-RPC
idonto the matchingFuture;call()blocks on that future. Notifications (noid) go to the subscription dispatcher, which also answers heartbeattest_requestmessages.Write safety: an in-flight call is never auto-resent across a reconnect. On disconnect every pending future fails with
DeribitConnectionErrorand the caller decides whether to retry (reconcile bylabelfirst). Each connection has a generation number, so a call registered before a disconnect is never sent on the replacement socket.Subscription callbacks run on the reader thread. They must not call
call()or any RPC method (the reply could never be read); hand that work to another thread. Doing so raisesRuntimeErrorimmediately.- open() DeribitRetailWSClient[source]
Connect, authenticate (if keys were provided), and start the reader.
If connecting or authenticating fails, the socket is closed and the error propagates; calling
open()again retries from scratch.
- private_logout(invalidate_token=None)[source]
Log out and tear down the session.
The gateway forwards the logout to Deribit and closes the socket (1000 “logout”) with no JSON-RPC reply, so this can’t go through
call()(which would block for a reply that never arrives and then surface the close as aDeribitConnectionError). We stop the reader from reconnecting, send the frame fire-and-forget so the backend still tears down COD-safely, wait briefly for the server to close, then close the socket locally either way.Raises
DeribitConnectionErrorif the logout frame could not be sent (the local session is still torn down).
- call(method: str, params: dict | None = None, timeout: int | None = None) dict[source]
Send one JSON-RPC call and block for the reply.
Returns the full response envelope dict (
id/jsonrpc/result). Raises aDeribitRPCErrorsubclass on a JSON-RPC error,DeribitConnectionErrorif the request was not sent or the socket drops while waiting, andTimeoutErrorif no reply arrives intimeoutseconds. Must not be called from a subscription callback.
- subscribe(channels: List[str], callback: Callable[[Any, str], None] | None = None) dict[source]
Subscribe to channels and (optionally) register a callback for them.
callback(data, channel)runs on the reader thread for each notification. Channels are remembered and re-subscribed automatically after a reconnect.An authenticated client serves
user.*channels; market-data channels (ticker, book, trades, …) need an unauthenticated client, which connects to the streams host. RaisesDeribitSubscriptionErrorlisting any channel the gateway did not subscribe; the others stay subscribed.
- unsubscribe(channels: List[str]) dict[source]
Unsubscribe from channels and drop every callback registered for them.
Callbacks are dropped only after the gateway confirms, so a failed call leaves the local registry matching the server.
- unsubscribe_all() dict[source]
Unsubscribe from every channel and drop every registered callback.
Callbacks are dropped only after the gateway confirms.
- private_buy(instrument_name, *, amount=None, contracts=None, type=None, label=None, price=None, time_in_force=None, display_amount=None, post_only=None, reject_post_only=None, reduce_only=None, trigger_price=None, trigger_offset=None, trigger=None, advanced=None, mmp=None, valid_until=None, linked_order_type=None, trigger_fill_condition=None, otoco_config=None, isolated=None, allocated_margin=None)
private/buy
- private_cancel(order_id, *, isolated=None)
private/cancel
- private_cancel_all(*, detailed=None, freeze_quotes=None, include_isolated=None)
private/cancel_all
- private_cancel_all_by_currency(currency, *, kind=None, type=None, detailed=None, freeze_quotes=None, include_isolated=None)
private/cancel_all_by_currency
- private_cancel_all_by_currency_pair(currency_pair, *, kind=None, type=None, detailed=None, freeze_quotes=None)
private/cancel_all_by_currency_pair
- private_cancel_all_by_instrument(instrument_name, *, type=None, detailed=None, include_combos=None, freeze_quotes=None, include_isolated=None)
private/cancel_all_by_instrument
- private_cancel_all_by_kind_or_type(currency, *, kind=None, type=None, detailed=None, freeze_quotes=None)
private/cancel_all_by_kind_or_type
- private_cancel_by_label(label, *, currency=None, include_isolated=None)
private/cancel_by_label
- private_change_margin_model(margin_model, *, user_id=None, dry_run=None)
private/change_margin_model
- private_close_position(instrument_name, type, *, price=None, isolated=None)
private/close_position
- private_create_combo(trades)
private/create_combo
- private_disable_cancel_on_disconnect(*, scope=None)
private/disable_cancel_on_disconnect
- private_edit(order_id, *, amount=None, contracts=None, price=None, post_only=None, reduce_only=None, reject_post_only=None, advanced=None, trigger_price=None, trigger_offset=None, mmp=None, valid_until=None, display_amount=None, isolated=None, allocated_margin=None)
private/edit
- private_edit_by_label(instrument_name, *, label=None, amount=None, contracts=None, price=None, post_only=None, reduce_only=None, reject_post_only=None, advanced=None, trigger_price=None, mmp=None, valid_until=None, isolated=None, allocated_margin=None)
private/edit_by_label
- private_enable_cancel_on_disconnect(*, scope=None)
private/enable_cancel_on_disconnect
- private_get_access_log(*, offset=None, count=None)
private/get_access_log
- private_get_account_summaries(*, subaccount_id=None, extended=None, include_isolated=None)
private/get_account_summaries
- private_get_account_summary(currency, *, subaccount_id=None, extended=None)
private/get_account_summary
- private_get_broker_trade_requests()
private/get_broker_trade_requests
- private_get_broker_trades(*, currency=None, count=None, start_id=None, end_id=None)
private/get_broker_trades
- private_get_cancel_on_disconnect(*, scope=None)
private/get_cancel_on_disconnect
- private_get_leg_prices(legs, price)
private/get_leg_prices
- private_get_leverage(*, instrument_name=None, subaccount_id=None, isolated=None)
private/get_leverage
- private_get_margins(instrument_name, amount, price, *, isolated=None)
private/get_margins
- private_get_max_order_size(instrument_name, *, subaccount_id=None, isolated=None, leverage=None, taker_fee_rate=None, price=None)
private/get_max_order_size
- private_get_open_orders(*, kind=None, type=None, include_isolated=None, subaccount_id=None)
private/get_open_orders
- private_get_open_orders_by_currency(currency, *, kind=None, type=None)
private/get_open_orders_by_currency
- private_get_open_orders_by_instrument(instrument_name, *, type=None)
private/get_open_orders_by_instrument
- private_get_open_orders_by_label(currency, label)
private/get_open_orders_by_label
- private_get_order_history_by_currency(currency, *, kind=None, count=None, offset=None, include_old=None, include_unfilled=None, with_continuation=None, continuation=None, historical=None, subaccount_id=None)
private/get_order_history_by_currency
- private_get_order_history_by_instrument(instrument_name, *, count=None, offset=None, include_old=None, include_unfilled=None, with_continuation=None, continuation=None, historical=None)
private/get_order_history_by_instrument
- private_get_order_margin_by_ids(ids, *, isolated=None)
private/get_order_margin_by_ids
- private_get_order_state(order_id, *, isolated=None)
private/get_order_state
- private_get_order_state_by_label(currency, label, *, include_isolated=None)
private/get_order_state_by_label
- private_get_pme_params(currency)
private/get_pme_params
- private_get_position(instrument_name, *, include_isolated=None)
private/get_position
- private_get_positions(*, currency=None, kind=None, subaccount_id=None, include_isolated=None)
private/get_positions
- private_get_risk_profile()
private/get_risk_profile
- private_get_settlement_history_by_currency(currency, *, type=None, count=None, continuation=None, search_start_timestamp=None, subaccount_id=None)
private/get_settlement_history_by_currency
- private_get_settlement_history_by_instrument(instrument_name, *, type=None, count=None, continuation=None, search_start_timestamp=None)
private/get_settlement_history_by_instrument
- private_get_subaccounts(*, with_portfolio=None, include_isolated=None)
private/get_subaccounts
- private_get_subaccounts_details(currency, *, with_open_orders=None, include_isolated=None)
private/get_subaccounts_details
- private_get_trading_limits(currency)
private/get_trading_limits
- private_get_transaction_log(currency, start_timestamp, end_timestamp, *, query=None, count=None, subaccount_id=None, continuation=None)
private/get_transaction_log
- private_get_trigger_order_history(currency, *, instrument_name=None, count=None, continuation=None)
private/get_trigger_order_history
- private_get_user_locks()
private/get_user_locks
- private_get_user_trades_by_currency(currency, *, kind=None, start_id=None, end_id=None, count=None, start_timestamp=None, end_timestamp=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_currency
- private_get_user_trades_by_currency_and_time(currency, start_timestamp, end_timestamp, *, kind=None, count=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_currency_and_time
- private_get_user_trades_by_instrument(instrument_name, *, start_seq=None, end_seq=None, count=None, start_timestamp=None, end_timestamp=None, historical=None, sorting=None, subaccount_id=None)
private/get_user_trades_by_instrument
- private_get_user_trades_by_instrument_and_time(instrument_name, start_timestamp, end_timestamp, *, count=None, sorting=None, historical=None, subaccount_id=None)
private/get_user_trades_by_instrument_and_time
- private_get_user_trades_by_order(order_id, *, sorting=None, historical=None, subaccount_id=None, isolated=None)
private/get_user_trades_by_order
- private_pme_simulate(currency, *, add_positions=None, simulated_positions=None)
private/pme/simulate
- private_sell(instrument_name, *, amount=None, contracts=None, type=None, label=None, price=None, time_in_force=None, display_amount=None, post_only=None, reject_post_only=None, reduce_only=None, trigger_price=None, trigger_offset=None, trigger=None, advanced=None, mmp=None, valid_until=None, linked_order_type=None, trigger_fill_condition=None, otoco_config=None, isolated=None, allocated_margin=None)
private/sell
- private_set_leverage(instrument_name, leverage, *, subaccount_id=None, isolated=None)
private/set_leverage
- private_simulate_portfolio(currency, *, add_positions=None, simulated_positions=None)
private/simulate_portfolio
- private_submit_transfer_between_subaccounts(currency, amount, destination, *, source=None, nonce=None)
private/submit_transfer_between_subaccounts
- public_auth(grant_type, token)
public/auth
- public_disable_heartbeat()
public/disable_heartbeat
- public_get_announcements(*, start_timestamp=None, count=None)
public/get_announcements
- public_get_book_summary_by_currency(currency, *, kind=None)
public/get_book_summary_by_currency
- public_get_book_summary_by_instrument(instrument_name)
public/get_book_summary_by_instrument
- public_get_combo_details(combo_id)
public/get_combo_details
- public_get_combo_ids(currency, *, state=None)
public/get_combo_ids
- public_get_combos(currency)
public/get_combos
- public_get_contract_size(instrument_name)
public/get_contract_size
- public_get_currencies()
public/get_currencies
- public_get_delivery_prices(index_name, *, offset=None, count=None)
public/get_delivery_prices
- public_get_expirations(currency, kind, *, currency_pair=None)
public/get_expirations
- public_get_funding_chart_data(instrument_name, length)
public/get_funding_chart_data
- public_get_funding_rate_history(instrument_name, start_timestamp, end_timestamp)
public/get_funding_rate_history
- public_get_funding_rate_value(instrument_name, start_timestamp, end_timestamp)
public/get_funding_rate_value
- public_get_historical_volatility(currency)
public/get_historical_volatility
- public_get_index_chart_data(index_name, range)
public/get_index_chart_data
- public_get_index_price(index_name)
public/get_index_price
- public_get_index_price_names(*, extended=None)
public/get_index_price_names
- public_get_instrument(instrument_name)
public/get_instrument
- public_get_instruments(currency, *, kind=None, expired=None)
public/get_instruments
- public_get_last_settlements_by_currency(currency, *, type=None, count=None, continuation=None, search_start_timestamp=None)
public/get_last_settlements_by_currency
- public_get_last_settlements_by_instrument(instrument_name, *, type=None, count=None, continuation=None, search_start_timestamp=None)
public/get_last_settlements_by_instrument
- public_get_last_trades_by_currency(currency, *, kind=None, start_id=None, end_id=None, start_timestamp=None, end_timestamp=None, count=None, sorting=None)
public/get_last_trades_by_currency
- public_get_last_trades_by_currency_and_time(currency, start_timestamp, end_timestamp, *, kind=None, count=None, sorting=None)
public/get_last_trades_by_currency_and_time
- public_get_last_trades_by_instrument(instrument_name, *, start_seq=None, end_seq=None, start_timestamp=None, end_timestamp=None, count=None, sorting=None)
public/get_last_trades_by_instrument
- public_get_last_trades_by_instrument_and_time(instrument_name, start_timestamp, end_timestamp, *, count=None, sorting=None)
public/get_last_trades_by_instrument_and_time
- public_get_mark_price_history(instrument_name, start_timestamp, end_timestamp)
public/get_mark_price_history
- public_get_order_book(instrument_name, *, depth=None)
public/get_order_book
- public_get_order_book_by_instrument_id(instrument_id, *, depth=None)
public/get_order_book_by_instrument_id
- public_get_supported_index_names(*, type=None)
public/get_supported_index_names
- public_get_time()
public/get_time
- public_get_trade_volumes(*, extended=None)
public/get_trade_volumes
- public_get_tradingview_chart_data(instrument_name, start_timestamp, end_timestamp, resolution)
public/get_tradingview_chart_data
- public_get_volatility_index_data(currency, start_timestamp, end_timestamp, resolution)
public/get_volatility_index_data
- public_hello(client_name, client_version)
public/hello
- public_set_heartbeat(interval)
public/set_heartbeat
- public_status()
public/status
- public_test(*, expected_result=None)
public/test
- public_ticker(instrument_name)
public/ticker
- public_tickers_by_currency(currency, *, kind=None, depth=None)
public/tickers_by_currency
Errors
- exception coinbase.deribit.DeribitRPCError(code: int, message: str, data: dict | None = None)[source]
A JSON-RPC
errorobject returned by the Deribit gateway.
- exception coinbase.deribit.DeribitRateLimitError(code: int, message: str, data: dict | None = None)[source]
Code 10028 — too many requests.
- exception coinbase.deribit.DeribitInsufficientFundsError(code: int, message: str, data: dict | None = None)[source]
Code 10009 (and variants) — not enough funds.
- exception coinbase.deribit.DeribitInvalidParamsError(code: int, message: str, data: dict | None = None)[source]
Code 11030 or JSON-RPC -32602 — invalid arguments.
- exception coinbase.deribit.DeribitMatchingQueueFullError(code: int, message: str, data: dict | None = None)[source]
Code 10047 — matching engine queue is full; safe to retry with backoff.
- exception coinbase.deribit.DeribitAuthError[source]
Auth pipeline failure (token exchange/refresh) — not a Deribit RPC error.
- exception coinbase.deribit.DeribitConnectionError[source]
WS disconnect while a call was pending. Writes are never auto-resent.
- exception coinbase.deribit.DeribitSubscriptionError(rejected, accepted, hint: str = '')[source]
The gateway did not subscribe some of the requested channels.
The gateway answers a subscribe with the channels it accepted and silently drops the rest. Market-data channels are only served on the streams host (an unauthenticated
DeribitRetailWSClient);user.*channels only on the trading host (an authenticated one). Accepted channels stay subscribed.rejected - channels that were not subscribed.
accepted - channels that were subscribed.