Options Trading
The FMZ Quant Trading Platform supports options trading on the cryptocurrency futures exchanges below. Options are used the same way as futures contracts: set the contract to an option code with exchange.SetContractType() (the option code is the exchange's native code, and the format differs between exchanges). After that, market data functions such as GetTicker() and GetDepth() and trading functions such as Buy(), Sell() (set the trade direction with exchange.SetDirection() before placing orders), CancelOrder() and GetPositions() all work on that option contract. You can also place orders with the full instrument code in the form pair.optionCode, for example BTC_USDT.BTC-260925-145000-C.
Option order books are usually thin: when there is no bid or ask, Buy and Sell in the Ticker are 0, and Last may be 0 for a contract that has never traded; see each exchange below. Whether exchange.GetMarkets() lists option contracts depends on the exchange; where it does not, get the option codes from the exchange's API or website.
Futures_Deribit
After setting an option contract you can get market data, place and cancel orders and query positions. Option code examples: BTC-13SEP24-60000-C, XRP_USDC-27SEP24-1-C; combination examples: BTC-CS-6SEP24-57000_57500, BTC-PCAL-20SEP24_13SEP24-55000. The result of exchange.GetMarkets() includes option contracts.
Reference strategy: Deribit options test strategy
Futures_OKX
Used the same way as Deribit. Set the trading pair to BTC_USD or similar; option codes look like BTC-USD-200626-4500-C. For an option that has never traded, Last in GetTicker() is the mark price. exchange.GetMarkets() does not list option contracts; the option contract list is available from OKX's /api/v5/public/instruments endpoint, for example BTC options:
javascript
function main() {
Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD"))
}
python
import json
import urllib.request
def main():
ret = json.loads(urllib.request.urlopen("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD").read().decode('utf-8'))
Log(ret)
rust
fn main() {
let body: String = HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD", None);
Log!(body);
}
Futures_Binance
Binance European options (USDT-settled) are supported. Set the trading pair to BTC_USDT or similar; option codes look like BTC-260925-145000-C (underlying-expiry YYMMDD-strike-C/P). Options trading must be enabled on the account. Limitations:
- Only limit orders are supported; market orders, conditional orders and order amendment (
exchange.ModifyOrder()) are not. - Leverage and margin mode settings such as
exchange.SetMarginLevel()are not supported. - Unified (portfolio margin) accounts do not support options.
exchange.GetMarkets()does not list option contracts.
Futures_Bybit
Options with two settlement currencies are supported:
- USDC-settled: set the trading pair to
ETH_USDCor similar; option codes look likeETH-25NOV22-1375-P. - USDT-settled: set the trading pair to
ETH_USDTor similar; the option code has an extra settlement-currency suffix compared with USDC-settled ones, likeETH-25JUN27-2800-C-USDT.
The result of exchange.GetMarkets() includes options of both settlement currencies. Bybit has no kline endpoint for options, so GetRecords() is built from trades.
Futures_Aevo
USDC options on Aevo are supported. Set the trading pair to ETH_USDC or similar; option codes look like ETH-30JUN23-1600-C. Last in GetTicker() is the mark price. Aevo has no kline endpoint, so GetRecords() is built from trades and is empty while the contract has no trades. The result of exchange.GetMarkets() includes option contracts.
Futures_GateIO
USDT options on Gate are supported. Set the trading pair to BTC_USDT or similar; option codes look like BTC_USDT-20211130-65000-C. The result of exchange.GetMarkets() includes option contracts. If options are not enabled on the account, order and position queries return the exchange's error.
Futures_Kraken
Options on Kraken Futures are supported. Set the trading pair to ETH_USD or similar; option codes look like OF_ETHUSD_261225_4000_C (OF_, underlying and quote currency, expiry YYMMDD, strike, C/P). The underlying and quote currency in the code must match the trading pair, and BTC is written as XBT in the code (e.g. OF_XBTUSD_...).
- Kraken has no option listing endpoint, so
exchange.GetMarkets()does not include option contracts; get the option codes from the Kraken website. LastinGetTicker()is the mark price, andBuy,Sell,HighandLoware 0; the raw data inInfocarries the implied volatility, the greeks and other fields.- Market data, klines, orders, positions and order history queries work; option orders go through the same order endpoint as futures contracts and have not been verified in live trading yet.
- Options have no funding rate, and
exchange.SetMarginLevel()is not supported.
See Also