{"record":{"id":"5f39683780e86c43","repo":"nautechsystems/nautilus_trader","slug":"unsupported-linear-contract-variant-other","errorCode":null,"errorMessage":"unsupported linear contract variant: {other:?}","messagePattern":"unsupported linear contract variant: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bybit/src/common/parse.rs","lineNumber":551,"sourceCode":"                .size_increment(size_increment)\n                .maybe_lot_size(lot_size)\n                .maybe_max_quantity(max_quantity)\n                .maybe_min_quantity(min_quantity)\n                .maybe_min_notional(min_notional)\n                .maybe_max_price(max_price)\n                .maybe_min_price(min_price)\n                .margin_init(default_margin())\n                .margin_maint(default_margin())\n                .maker_fee(maker_fee)\n                .taker_fee(taker_fee)\n                .maybe_info(info)\n                .ts_event(ts_event)\n                .ts_init(ts_init)\n                .build()\n                .unwrap();\n            Ok(InstrumentAny::CryptoFuture(instrument))\n        }\n        other => Err(anyhow::anyhow!(\n            \"unsupported linear contract variant: {other:?}\"\n        )),\n    }\n}\n\n/// Parses Bybit's `minNotionalValue` string (when present) into a `Money` value\n/// denominated in the instrument's quote currency. Returns `Ok(None)` if the\n/// field is absent or an empty string.\nfn parse_optional_notional(\n    raw: Option<&str>,\n    currency: Currency,\n    field: &str,\n) -> anyhow::Result<Option<Money>> {\n    let Some(s) = raw.map(str::trim).filter(|s| !s.is_empty()) else {\n        return Ok(None);\n    };\n    let amount: f64 = s\n        .parse()","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bybit/src/common/parse.rs#L533-L569","documentation":"parse_linear_instrument matches on BybitContractType to decide whether a linear instrument is a LinearPerpetual (CryptoPerpetual) or LinearFutures (CryptoFuture). Any other contract-type variant returned by the exchange hits a catch-all arm that returns this error. It signals an exchange contract type the adapter does not know how to map to a Nautilus instrument type.","triggerScenarios":"Bybit's instruments-info response contains a contractType value (e.g. a newly introduced product line) that deserializes into a BybitContractType variant outside LinearPerpetual/LinearFutures, and the symbol is routed through parse_linear_instrument.","commonSituations":"Bybit adding new contract types on v5 API (e.g. options-like or pre-market contracts appearing in the linear list); running an older adapter version against an updated exchange API; filtered category='linear' requests returning unexpected instruments.","solutions":["Upgrade the adapter to a version supporting the new BybitContractType variant","Filter out symbols with unsupported contractType before calling parse_linear_instrument","Extend the match in parse_linear_instrument to map or explicitly skip the new variant","Check which symbol/contractType triggered it (the Debug output in the message) and exclude that category"],"exampleFix":"// before\nother => Err(anyhow::anyhow!(\"unsupported linear contract variant: {other:?}\")),\n// after\nother => {\n    tracing::debug!(?other, \"skipping unsupported linear contract variant\");\n    Ok(None)\n}","handlingStrategy":"type-guard","validationCode":"fn is_supported_linear(ct: &BybitContractType) -> bool {\n    matches!(ct, BybitContractType::LinearPerpetual | BybitContractType::LinearFutures)\n}","typeGuard":"fn as_supported_linear(ct: &BybitContractType) -> Option<&BybitContractType> {\n    matches!(ct, BybitContractType::LinearPerpetual | BybitContractType::LinearFutures).then_some(ct)\n}","tryCatchPattern":"match parse_linear_instrument(&def, &fee, ts_event, ts_init) {\n    Ok(inst) => instruments.push(inst),\n    Err(e) if e.to_string().contains(\"unsupported linear contract variant\") => {\n        tracing::debug!(symbol = %def.symbol, \"skipping unsupported contract\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Filter by contractType before routing symbols to parsers","Keep the adapter updated for new Bybit contract types","Log (Debug) unknown variants rather than failing batch requests","Add exhaustive-match tests covering every BybitContractType variant"],"tags":["bybit","enum","instrument-parsing"],"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-14T05:17:10.506Z"}