nautechsystems/nautilus_trader · error

CryptoOption missing `option_type` field for instrument: {}

Error message

CryptoOption missing `option_type` field for instrument: {}

What it means

Raised in create_crypto_option when the Tardis instrument info lacks the mandatory `option_type` field (Call/Put). A CryptoOption instrument cannot be constructed without knowing its type, so the parse fails and the instrument is skipped.

Source

Thrown at crates/adapters/tardis/src/http/instruments.rs:235

    info: &TardisInstrumentInfo,
    instrument_id: InstrumentId,
    raw_symbol: Symbol,
    activation: UnixNanos,
    expiration: UnixNanos,
    price_increment: Price,
    size_increment: Quantity,
    multiplier: Option<Quantity>,
    margin_init: Decimal,
    margin_maint: Decimal,
    maker_fee: Decimal,
    taker_fee: Decimal,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
) -> anyhow::Result<InstrumentAny> {
    let is_inverse = info.inverse.unwrap_or(false);

    let option_type = info.option_type.ok_or_else(|| {
        anyhow::anyhow!(
            "CryptoOption missing `option_type` field for instrument: {}",
            info.id
        )
    })?;

    let strike_price = info.strike_price.ok_or_else(|| {
        anyhow::anyhow!(
            "CryptoOption missing `strike_price` field for instrument: {}",
            info.id
        )
    })?;

    Ok(InstrumentAny::CryptoOption(
        CryptoOption::builder()
            .instrument_id(instrument_id)
            .raw_symbol(raw_symbol)
            .underlying(get_currency(info.base_currency.to_uppercase().as_str()))
            .quote_currency(get_currency(info.quote_currency.to_uppercase().as_str()))

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Update the adapter's instrument mapping to populate option_type for that exchange.
  2. Check for adapter/API version mismatch and upgrade the tardis adapter.
  3. Inspect the raw Tardis response for the instrument id to confirm the field is truly absent.
  4. Skip/report the unparseable instrument if it's not needed for your strategy.
Defensive patterns

Strategy: validation

Validate before calling

// Check the raw info before constructing options
if info.option_type.is_none() {
    log::warn!("skipping option {} with missing option_type", info.id);
}

Type guard

fn has_option_type(info: &TardisInstrumentInfo) -> bool {
    info.option_type.is_some()
}

Try / catch

match create_crypto_option(...) {
    Ok(instr) => Some(instr),
    Err(e) if e.to_string().contains("missing `option_type`") => {
        log::warn!("skipping option instrument: {e}");
        None
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Parsing an options instrument from the Tardis HTTP API whose info record has no `option_type` value — API payload missing the field or an unhandled contract kind.

Common situations: Tardis API schema change for a new/renamed exchange; options data fetched for an exchange whose metadata mapping omits option_type; version drift between adapter and Tardis API; exotic instruments the mapper doesn't recognize.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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