{"record":{"id":"4ee865a7d7f33139","repo":"nautechsystems/nautilus_trader","slug":"invalid-multiplier-e","errorCode":null,"errorMessage":"Invalid multiplier {}: {e}","messagePattern":"Invalid multiplier (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/http/parse.rs","lineNumber":563,"sourceCode":"        .taker_fee(taker_fee)\n        .ts_event(ts_event)\n        .ts_init(ts_init)\n        .build()\n        .unwrap();\n\n    Ok(InstrumentAny::CryptoFuture(instrument))\n}\n\nfn parse_instrument_multiplier(\n    definition: &BitmexInstrument,\n    settlement_currency: Currency,\n) -> anyhow::Result<Quantity> {\n    if !definition.is_quanto {\n        return Quantity::new_checked(definition.multiplier.abs(), 0).map_err(Into::into);\n    }\n\n    let raw = Decimal::try_from(definition.multiplier.abs())\n        .map_err(|e| anyhow::anyhow!(\"Invalid multiplier {}: {e}\", definition.multiplier))?;\n    let bitmex_currency = definition\n        .settl_currency\n        .as_ref()\n        .unwrap_or(&definition.quote_currency);\n    let divisor = bitmex_currency_divisor(bitmex_currency.as_str());\n    let value = raw.checked_div(divisor).ok_or_else(|| {\n        anyhow::anyhow!(\"Invalid multiplier divisor {divisor} for {bitmex_currency}\")\n    })?;\n\n    Quantity::from_decimal_dp(value, settlement_currency.precision).map_err(Into::into)\n}\n\n/// Parse a BitMEX futures spread instrument into a Nautilus `InstrumentAny`.\n///\n/// # Errors\n///\n/// Returns an error if values are out of valid range or cannot be parsed.\n///","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/http/parse.rs#L545-L581","documentation":"parse_instrument_multiplier converts a BitMEX quanto instrument's multiplier into a Nautilus Quantity. For quanto contracts it converts the f64 multiplier to Decimal; if Decimal::try_from fails (NaN, infinite, or otherwise unrepresentable), the f64 value and the conversion error are wrapped in this message.","triggerScenarios":"Parsing a perpetual or futures instrument definition whose is_quanto is true and whose multiplier is NaN, infinite, or cannot be represented as a fixed-point Decimal.","commonSituations":"BitMEX listing a new/odd contract with an anomalous multiplier field; corrupted or partially-updated instrument definition responses; float serialization changes from the venue API.","solutions":["Log the full instrument definition (symbol, multiplier, settl_currency) to identify the offending contract.","Skip or exclude the affected symbol from the instrument load list if it is not needed.","Check for a newer nautilus_bitmex adapter version that handles the multiplier representation.","Report/verify against the BitMEX /instrument endpoint whether the multiplier is genuinely non-finite."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if definition.is_quanto && !definition.multiplier.is_finite() {\n    log::warn!(\"skipping {} : non-finite multiplier\", definition.symbol);\n    return Ok(None);\n}","typeGuard":null,"tryCatchPattern":"match parse_perpetual_instrument(&definition, ...) {\n    Ok(inst) => Some(inst),\n    Err(e) if e.to_string().contains(\"Invalid multiplier\") => {\n        log::warn!(\"skipping instrument: {e}\"); None\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Log the raw instrument definition on parse failure for diagnosis.","Filter instrument loads to a known symbol list.","Track BitMEX new-listing announcements and test parsing against them."],"tags":["parsing","instrument","multiplier","bitmex","decimal"],"backgroundTag":"invalid-argument-format","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"}