Cryptocurrency Options
Use the exchange.SetContractType() function to set the options contract. The format of options contract codes varies across different exchanges. The cryptocurrency options exchanges supported by the FMZ Quant Trading Platform are as follows:
-
Futures_Deribit
For theDeribitexchange, you only need to call theexchange.SetContractType()function to set the contract to an options contract. After setting the options contract, when you call market data interfaces such asGetTicker(), the data obtained will be the market data of that options contract.
Use theexchange.Sell()andexchange.Buy()functions to place orders. Pay attention to the trade direction when placing orders; you can use theexchange.SetDirection()function to set the trade direction.
Use theexchange.CancelOrder()function to cancel orders, and theexchange.GetPositions()function to query positions.Reference strategy code: Deribit Options Test Strategy
Examples of options contract codes:BTC-13SEP24-60000-C,XRP_USDC-27SEP24-1-C,BTC-CS-6SEP24-57000_57500,BTC-PCAL-20SEP24_13SEP24-55000, etc. -
Futures_OKX
Setting contracts, placing orders, canceling orders, querying orders, obtaining market data, and other operations are the same as withDeribit. The contract code format isBTC-USD-200626-4500-C.
You can query contract-related information via thehttps://www.okx.com/api/v5/public/instrumentsinterface.For example, to query the information of BTC options contracts:
javascriptfunction main() { Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD")) }pythonimport 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)rustfn main() { let body: String = HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD", None); Log!(body); }c++void main() { Log(HttpQuery("https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly=BTC-USD")); } -
Futures_HuobiDM
Example of a Huobi options contract code:BTC-USDT-201225-P-13000, where the underlying asset isBTC, the exercise date is December 25, 2020, the option type is a put option (PUT), and the strike price is 13,000 USD.
Call options: the premium paid by the buyer is in USDT, using the USDT in the account assets; the seller's margin is in coin, using the coin in the account assets as collateral.
Put options: the premium paid by the buyer is in USDT, using the USDT in the account assets; the seller's margin is in USDT, using the USDT in the account assets as collateral. -
Futures_Bybit
Supports USDC options on the Bybit exchange. Set the trading pair toETH_USDCand call theexchange.SetContractType()function to set the contract to an options contract.
Example of an options contract code:ETH-25NOV22-1375-P. -
Futures_Aevo
Supports USDC options on the Aevo exchange. Example of an options contract code:ETH-30JUN23-1600-C. -
Futures_GateIO
Supports USDT options on the GATE.IO exchange. Example of an options contract code:BTC_USDT-20211130-65000-C