nautechsystems/nautilus_trader · error

Unsupported instrument type: {} (kind: {:?})

Error message

Unsupported instrument type: {} (kind: {:?})

What it means

request_instrument converts a Deribit instrument response into a nautilus instrument object by matching on the response's known instrument kind/shape. When the response matches none of the supported variants, the client cannot construct a nautilus instrument and bails with the instrument name and Deribit kind.

Source

Thrown at crates/adapters/deribit/src/http/client.rs:1116

        let ts_init = self.generate_ts_init();

        match parse_deribit_instrument_any(&response, ts_init, ts_event)? {
            Some(mut instrument) => {
                if Self::is_combo_kind(response.kind) {
                    let currency = DeribitCurrency::from_str(response.base_currency.as_str())
                        .unwrap_or(DeribitCurrency::ANY);
                    let combo_by_id = self
                        .combo_map_for_instruments(currency, std::slice::from_ref(&response))
                        .await;

                    if let Some(combo) = combo_by_id.get(&response.instrument_name) {
                        Self::attach_combo_leg_info(&mut instrument, combo);
                    }
                }

                Ok(instrument)
            }
            None => anyhow::bail!(
                "Unsupported instrument type: {} (kind: {:?})",
                response.instrument_name,
                response.kind
            ),
        }
    }

    async fn combo_map_for_instruments(
        &self,
        requested_currency: DeribitCurrency,
        raw_instruments: &[DeribitInstrument],
    ) -> AHashMap<Ustr, DeribitCombo> {
        if !raw_instruments
            .iter()
            .any(|instrument| Self::is_combo_kind(instrument.kind))
        {
            return AHashMap::new();
        }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check the logged kind value against the adapter's supported Deribit instrument kinds
  2. Restrict subscriptions/instruments to supported kinds (futures, options, perpetuals)
  3. Upgrade the adapter to a version supporting the new Deribit product type
  4. Open/track an adapter issue to add a conversion branch for the unsupported kind

Example fix

// before
let instrument = client.request_instrument(&instrument_id).await?; // bails on exotic kind
// after
let kind = client.instrument_kind(&instrument_id).await?;
if !matches!(kind, DeribitKind::Future | DeribitKind::Option | DeribitKind::Perpetual) {
    log::warn!("skipping unsupported instrument kind {kind:?}");
    return Ok(None);
}
let instrument = client.request_instrument(&instrument_id).await?;
Defensive patterns

Strategy: validation

Validate before calling

let supported_kinds = ["future", "option", "perpetual", "future_combo", "option_combo"];
let kind = fetch_instrument_kind(instrument_name).await?;
if !supported_kinds.contains(&kind.as_str()) {
    log::warn!("skipping unsupported Deribit kind: {kind}");
}

Type guard

fn is_supported_kind(kind: &DeribitKind) -> bool {
    matches!(kind, DeribitKind::Future | DeribitKind::Option | DeribitKind::Perpetual | DeribitKind::FutureCombo | DeribitKind::OptionCombo)
}

Prevention

When it happens

Trigger: lazy_load_instrument fetching an instrument whose Deribit 'kind' (e.g. a newly listed or exotic product type) has no conversion branch in the client's match statement.

Common situations: Deribit listing a new product type not yet supported by the adapter; subscribing to an instrument kind (e.g. certain combos) the adapter never handled; typos resolving to unexpected instrument kinds on the venue.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/e74034a6e3a500bc. Report an issue: GitHub.