{"record":{"id":"086c42a52669ea70","repo":"nautechsystems/nautilus_trader","slug":"unsupported-inverse-contract-variant-other","errorCode":null,"errorMessage":"unsupported inverse contract variant: {other:?}","messagePattern":"unsupported inverse contract variant: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bybit/src/common/parse.rs","lineNumber":708,"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 inverse contract variant: {other:?}\"\n        )),\n    }\n}\n\nfn build_instrument_info(\n    symbol_type: Option<BybitSymbolType>,\n    xstock_multiplier: Option<&str>,\n) -> Option<Params> {\n    let symbol_type = symbol_type?;\n    let value = symbol_type.as_str()?;\n    let mut info = Params::new();\n    info.insert(\n        \"symbol_type\".to_string(),\n        serde_json::Value::String(value.to_string()),\n    );\n\n    if symbol_type == BybitSymbolType::Xstocks","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bybit/src/common/parse.rs#L690-L726","documentation":"parse_inverse_instrument matches BybitContractType to map InversePerpetual to CryptoPerpetual and InverseFutures to CryptoFuture. Any other variant falls into a catch-all arm returning this error, meaning the adapter encountered an inverse contract type it cannot translate into a Nautilus instrument.","triggerScenarios":"An instruments-info response for category=inverse yields a contractType variant outside {InversePerpetual, InverseFutures} (e.g. a newly listed product type), and the symbol is passed through parse_inverse_instrument via request_instruments or request_instruments_with_statuses.","commonSituations":"Bybit extending its v5 API with new inverse contract types; stale adapter versions behind the exchange API; broad category queries returning instruments the caller did not expect.","solutions":["Upgrade the adapter to a version that handles the new BybitContractType variant","Skip symbols with unsupported contract types and log them instead of failing the request","Add an explicit mapping or early-return arm for the new variant in parse_inverse_instrument","Narrow the instrument request (symbols filter) to exclude the unsupported contract"],"exampleFix":"// before\nother => Err(anyhow::anyhow!(\"unsupported inverse contract variant: {other:?}\")),\n// after\nother => {\n    tracing::debug!(?other, \"skipping unsupported inverse contract variant\");\n    Ok(None)\n}","handlingStrategy":"type-guard","validationCode":"fn is_supported_inverse(ct: &BybitContractType) -> bool {\n    matches!(ct, BybitContractType::InversePerpetual | BybitContractType::InverseFutures)\n}","typeGuard":"fn as_supported_inverse(ct: &BybitContractType) -> Option<&BybitContractType> {\n    matches!(ct, BybitContractType::InversePerpetual | BybitContractType::InverseFutures).then_some(ct)\n}","tryCatchPattern":"match parse_inverse_instrument(&def, &fee, ts_event, ts_init) {\n    Ok(inst) => instruments.push(inst),\n    Err(e) if e.to_string().contains(\"unsupported inverse contract variant\") => {\n        tracing::debug!(symbol = %def.symbol, \"skipping unsupported inverse contract\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Filter inverse symbols by contractType before parsing","Track Bybit v5 API changes for new contract types","Use Debug-logged skips instead of hard failures for unknown variants","Cover all BybitContractType variants in exhaustive-match tests"],"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"}