pub fn parse_instrument_kind_currency(
instrument_id: &InstrumentId,
) -> (String, String)Expand description
Parses a Deribit instrument ID into kind and currency for WebSocket channel subscription.
Deribit instrument naming conventions (per Deribit docs):
- Future:
{CURRENCY}-{DMMMYY}(e.g., “BTC-25MAR23”, “BTC-5AUG23”) - Perpetual:
{CURRENCY}-PERPETUAL(e.g., “BTC-PERPETUAL”) - Option:
{CURRENCY}-{DMMMYY}-{STRIKE}-{C|P}(e.g., “BTC-25MAR23-420-C”, “BTC-5AUG23-580-P”) - Linear Option:
{BASE}_{QUOTE}-{DMMMYY}-{STRIKE}-{C|P}(e.g., “XRP_USDC-30JUN23-0d625-C”)- Note:
dis used as decimal point for decimal strikes (0d625 = 0.625)
- Note:
- Spot:
{BASE}_{QUOTE}(e.g., “BTC_USDC”)
Returns (kind, currency) tuple for instrument.state.{kind}.{currency} channel.
Valid kinds: future, option, spot, future_combo, option_combo, any
Valid currencies: BTC, ETH, USDC, USDT, EURR, any