nautechsystems/nautilus_trader · error

Unsupported instrument type for fill report

Error message

Unsupported instrument type for fill report

What it means

To build a fill report's commission Money, the quote currency is taken from the parsed instrument. Kraken Spot fill report parsing only supports CurrencyPair, CryptoPerpetual, and TokenizedAsset instruments; any other InstrumentAny variant causes this bail.

Source

Thrown at crates/adapters/kraken/src/common/parse.rs:838

) -> anyhow::Result<FillReport> {
    let instrument_id = instrument.id();
    let venue_order_id = VenueOrderId::new(&trade.ordertxid);
    let trade_id_obj = TradeId::new(trade_id);

    let order_side = trade.trade_type.into();

    let last_qty =
        parse_quantity_with_precision(&trade.vol, instrument.size_precision(), "trade.vol")?;

    let last_px =
        parse_price_with_precision(&trade.price, instrument.price_precision(), "trade.price")?;

    let fee_decimal = parse_decimal(&trade.fee)?;
    let quote_currency = match instrument {
        InstrumentAny::CurrencyPair(pair) => pair.quote_currency,
        InstrumentAny::CryptoPerpetual(perp) => perp.quote_currency,
        InstrumentAny::TokenizedAsset(ta) => ta.quote_currency,
        _ => anyhow::bail!("Unsupported instrument type for fill report"),
    };

    let commission = Money::from_decimal(fee_decimal, quote_currency)?;

    let liquidity_side = match trade.maker {
        Some(true) => LiquiditySide::Maker,
        Some(false) => LiquiditySide::Taker,
        None => LiquiditySide::NoLiquiditySide,
    };

    let ts_event = parse_millis_timestamp(trade.time, "trade.time")?;

    Ok(FillReport {
        account_id,
        instrument_id,
        venue_order_id,
        trade_id: trade_id_obj,
        order_side,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check the instrument_id of the fill and ensure it was parsed by the correct adapter path (Spot vs Futures).
  2. Add or match the missing instrument variant in the catalog before requesting fill reports.
  3. Extend parse_fill_report's match to support the needed instrument type if it is legitimately tradeable on Kraken Spot.

Example fix

// before
InstrumentAny::TokenizedAsset(ta) => ta.quote_currency,
_ => anyhow::bail!("Unsupported instrument type for fill report"),
// after (if options support is needed)
InstrumentAny::CryptoOption(opt) => opt.quote_currency,
_ => anyhow::bail!("Unsupported instrument type for fill report"),
Defensive patterns

Strategy: type-guard

Validate before calling

// Before requesting fill reports, verify the instrument kind is supported
let supported = matches!(instrument,
    InstrumentAny::CurrencyPair(_) | InstrumentAny::CryptoPerpetual(_) | InstrumentAny::TokenizedAsset(_));
if !supported { eprintln!("{}: unsupported for spot fill reports", instrument.id()); }

Type guard

fn supports_spot_fill_report(inst: &InstrumentAny) -> bool {
    matches!(inst,
        InstrumentAny::CurrencyPair(_) | InstrumentAny::CryptoPerpetual(_) | InstrumentAny::TokenizedAsset(_))
}

Try / catch

match parse_fill_report(&trade, instrument) {
    Ok(r) => push(r),
    Err(e) if e.to_string().contains("Unsupported instrument type") => log::warn!("skipping fill for {}", instrument.id()),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: parse_fill_report receives an execution/trade whose instrument resolves to an unsupported InstrumentAny variant (anything other than CurrencyPair, CryptoPerpetual, or TokenizedAsset), so quote_currency cannot be extracted.

Common situations: Futures/options instruments leaking into the Spot fill-report path; instruments built incorrectly from the catalog; a newly added instrument kind not yet handled by the adapter.

Related errors


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