Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
AscendEx
Backpack
BigONE
Binance
Bitfinex
bitFlyer
Bitget
Bithumb
Bitstamp
Bybit
Coincheck
Coinone
CoinW
Crypto.com
DeepCoin
Deribit
DigiFinex
Gate
Gemini
HashKey
HitBTC
HTX
Korbit
Kraken
KuCoin
LBank
MEXC
OKX
Poloniex
Upbit
WEEX
WOO X
Zaif
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Coin-margined (inverse) perpetual and delivery contracts, USDC linear perpetual and delivery contracts, spread combination contracts (future_combo), plus options and option combinations.

Names and Configuration

exchange.GetName(): Futures_Deribit (Futures).

FieldRequired
Access KeyYes
Secret KeyYes

Trading Pairs and Contract Codes

Pair examples: BTC_USD, ETH_USD, BTC_USDC, XRP_USDC

The quote currency selects the contract family: BTC_USD and ETH_USD are coin-margined (inverse) contracts, with native codes like BTC-PERPETUAL; BTC_USDC, XRP_USDC and so on are USDC linear contracts, with native codes like BTC_USDC-PERPETUAL (Deribit's linear contract codes contain the underscore themselves).

Contract codeDescription
swapPerpetual contract.
todayThe nearest-expiring daily delivery contract (Deribit daily futures).
tomorrowThe second-nearest daily delivery contract.
this_weekThe nearest-expiring weekly contract.
next_weekThe second-nearest weekly contract.
monthThe nearest-expiring monthly contract (quarterly months included).
quarterThe nearest monthly contract expiring in March, June, September or December, skipping the one month already points to.
next_quarterThe second contract in the same quarterly sequence.
third_quarterThe third contract in the same quarterly sequence.
fourth_quarterThe fourth contract in the same quarterly sequence.

Delivery contract codes are not computed locally from dates; they are picked from Deribit's instrument list by settlement period (day, week, month) and expiry time (the list is cached for 10 minutes). An error is returned when that period has no contract at the requested position.

Spread combination contracts (future_combo) are written as two codes "far,near" separated by a comma, for example "quarter,swap", "next_week,swap", "next_quarter,this_week", "month,next_week"; the far leg must be a delivery code, the near leg a delivery code or swap, mapping to Deribit combinations such as BTC-FS-25DEC26_PERP. Combination contracts are for coin-margined pairs (BTC_USD, ETH_USD) only; a combination code on a USDC or other linear pair fails.

Native contract code examples: BTC-30JUL26, BTC_USDC-30JUL26, BTC-FS-25DEC26_PERP

Any delivery or combination contract can be given by its Deribit native code (the date is abbreviated day-month-year); use this for far contracts beyond the codes above, for example pair BTC_USD with contract code BTC-30JUL26. Contracts in query results that do not map back to the codes above are also returned with their native codes.

Function Support

Not supported (the call fails with an error and returns null): exchange.SetMarginLevel.

Served through a fallback:

  • exchange.GetRecords: Native periods are 1m, 3m, 5m, 10m, 15m, 30m, 1h, 2h, 3h, 6h, 12h, 1d; other periods are synthesized by the docker.

Margin, Account and Simulation

Margin mode: Deribit computes margin per currency account; there is no per-contract margin mode or leverage setting: exchange.SetMarginLevel() is not supported and exchange.IO("cross", ...) fails. MarginLevel in exchange.GetPositions() is the leverage reported by Deribit for the position (0 for option positions); Margin is initial margin plus maintenance margin.

Position mode: Each contract has a single net position (one-way mode); exchange.IO("dual", ...) fails.

Account: exchange.GetAssets() returns balances per currency (BTC, ETH, USDC, USDT and so on), each in its own unit, without converting or summing them.

Simulation: There is no simulation option in the configuration. To use the Deribit testnet, fill in testnet API keys and call exchange.IO("base", "https://test.deribit.com") at the start of the strategy to switch the API address.

Options

After setting an option contract you can get market data, place and cancel orders and query positions; order amounts for BTC and ETH options are in coins.

  • exchange.GetMarkets() without arguments lists all options and option combinations; with an option symbol it queries options only.
  • exchange.GetTickers() returns futures only (perpetual and delivery), not options or combinations; get option quotes one by one with exchange.GetTicker().
  • Options do not support exchange.GetFundings().
  • The range USD.option covers BTC and ETH options and USDC.option covers USDC-settled options, both including option combinations.

Option code examples: BTC-25DEC26-100000-C, SOL_USDC-25DEC26-148-C, XRP_USDC-27NOV26-2d3-P, BTC_USDC-CS-11OCT26-82500_83000

Option codes are Deribit native codes: underlying-expiry (day-month-year abbreviation)-strike-C/P, C for a call and P for a put; a decimal point in the strike is written as d (2d3 is 2.3). BTC and ETH options settle in the coin; set the trading pair to BTC_USD or ETH_USD, and the full symbol looks like BTC_USD.BTC-25DEC26-100000-C. USDC-settled option codes contain _USDC themselves; set the matching _USDC pair, for example SOL_USDC.SOL_USDC-25DEC26-148-C. Option combinations (such as BTC-CS-6SEP24-57000_57500, BTC-PCAL-20SEP24_13SEP24-55000) are also given by their native codes.

Notes
  • Order amount units: coin-margined (inverse) contracts are in USD (BTC-PERPETUAL minimum 10, in multiples of 10); USDC linear contracts and options are in coins. CtVal in exchange.GetMarkets() is always 1; use MinQty and AmountPrecision for the minimum amount and precision.
  • exchange.GetFundings() with a specific perpetual symbol (such as BTC_USD.swap) returns that contract's single current entry; without arguments it queries every perpetual of the current contract's quote currency (USD.swap is the BTC and ETH coin-margined perpetuals, USDC.swap all USDC linear perpetuals), and such a range can also be passed directly. The rate is Deribit's current_interest normalized to 8 hours. Deribit has no batch funding endpoint, so a range query sends one request per perpetual; USDC.swap covers over a hundred perpetuals and takes over ten seconds, so pass a specific symbol when calling it often. Delivery contracts, options and combinations have no funding rate and fail.
  • Conditional orders support take-profit and stop-loss only, not OCO; exchange.ModifyConditionOrder() is supported. Triggers use the last trade price by default; pass trigger (mark_price, index_price) in the extra parameters to use the mark or index price.
  • exchange.GetHistoryOrders() and exchange.GetHistoryConditionOrders() query by symbol and do not support the since argument (passing it fails); they return the most recent records.
  • In range queries such as USD.swap and USD.futures, USD covers the BTC and ETH coin-margined contracts; the range for spread combination contracts is USD.futures_combo. When the current contract is a combination, calls without arguments default to USD.futures_combo (including far combinations returned with native codes); USD.futures does not include combinations.