{"record":{"id":"7440e23011a45b5f","repo":"nautechsystems/nautilus_trader","slug":"unsupported-instrument-type-for-futures-fill-repor","errorCode":null,"errorMessage":"Unsupported instrument type for futures fill report","messagePattern":"Unsupported instrument type for futures fill report","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/parse.rs","lineNumber":1094,"sourceCode":"pub fn parse_futures_fill_report(\n    fill: &FuturesFill,\n    instrument: &InstrumentAny,\n    account_id: AccountId,\n    ts_init: UnixNanos,\n) -> anyhow::Result<FillReport> {\n    let instrument_id = instrument.id();\n    let venue_order_id = VenueOrderId::new(&fill.order_id);\n    let trade_id = TradeId::new(&fill.fill_id);\n\n    let order_side = fill.side.into();\n\n    let last_qty = Quantity::from_decimal_dp(fill.size, instrument.size_precision())?;\n    let last_px = Price::from_decimal_dp(fill.price, instrument.price_precision())?;\n\n    let quote_currency = match instrument {\n        InstrumentAny::CryptoPerpetual(perp) => perp.quote_currency,\n        InstrumentAny::CryptoFuture(future) => future.quote_currency,\n        _ => anyhow::bail!(\"Unsupported instrument type for futures fill report\"),\n    };\n\n    let commission = Money::from_decimal(fill.fee_paid.unwrap_or(Decimal::ZERO), quote_currency)?;\n\n    let liquidity_side = fill.fill_type.into();\n\n    let ts_event = parse_rfc3339_timestamp(&fill.fill_time, \"fill.fill_time\")?;\n\n    Ok(FillReport {\n        account_id,\n        instrument_id,\n        venue_order_id,\n        trade_id,\n        order_side,\n        last_qty,\n        last_px,\n        commission,\n        liquidity_side,","sourceCodeStart":1076,"sourceCodeEnd":1112,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/parse.rs#L1076-L1112","documentation":"Kraken Futures fill report parsing extracts the quote currency from the instrument to construct the commission Money. Only CryptoPerpetual and CryptoFuture variants are supported; any other instrument kind bails with this message.","triggerScenarios":"parse_futures_fill_report (called by request_fill_reports) processes a fill whose instrument resolves to something other than CryptoPerpetual or CryptoFuture — e.g. a CurrencyPair or TokenizedAsset instrument registered under the Futures client.","commonSituations":"Spot and Futures instruments mixed in one cache/catalog; fills arriving for instruments parsed by the wrong adapter branch; future instrument kinds added upstream but not handled here.","solutions":["Verify the fill's instrument_id is a Futures (perpetual or dated future) symbol like 'PF_XBTUSD' or 'FI_...'.","Ensure the instrument was parsed/loaded via parse_futures_instrument, not the Spot parser.","Route the fill report through parse_fill_report instead if the instrument is actually a Spot instrument."],"exampleFix":"// before (wrong parser for a spot pair)\nlet report = parse_futures_fill_report(fill, &currency_pair_instrument)?;\n// after\nlet report = parse_fill_report(fill, &currency_pair_instrument)?;","handlingStrategy":"type-guard","validationCode":"let is_futures = matches!(instrument,\n    InstrumentAny::CryptoPerpetual(_) | InstrumentAny::CryptoFuture(_));\nif !is_futures { eprintln!(\"{}: not a futures instrument; use spot fill parser\", instrument.id()); }","typeGuard":"fn supports_futures_fill_report(inst: &InstrumentAny) -> bool {\n    matches!(inst, InstrumentAny::CryptoPerpetual(_) | InstrumentAny::CryptoFuture(_))\n}","tryCatchPattern":"match parse_futures_fill_report(&fill, instrument) {\n    Ok(r) => push(r),\n    Err(e) if e.to_string().contains(\"Unsupported instrument type\") => route_to_spot_parser(&fill)?,\n    Err(e) => return Err(e),\n}","preventionTips":["Validate that fill instrument IDs are Futures symbols (PF_/FI_ prefixes) before parsing.","Load Futures instruments exclusively via parse_futures_instrument.","Keep per-venue, per-market-type clients separated in configuration."],"tags":["kraken-futures","fill-report","instrument-type","unsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}