{"record":{"id":"939c5a990d457f10","repo":"nautechsystems/nautilus_trader","slug":"invalid-futures-kline-e","errorCode":null,"errorMessage":"invalid Futures kline {}: {e}","messagePattern":"invalid Futures kline (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":3212,"sourceCode":"    };\n    parse_futures_trade_tick(\n        &trade,\n        instrument_id,\n        price_precision,\n        size_precision,\n        ts_init,\n    )\n}\n\nfn parse_futures_kline_binance_bar(\n    kline: &BinanceFuturesKline,\n    bar_type: BarType,\n    price_precision: u8,\n    size_precision: u8,\n    ts_init: UnixNanos,\n) -> anyhow::Result<BinanceBar> {\n    let open = parse_required_price_at_precision(&kline.open, price_precision, \"kline.open\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures kline {}: {e}\", kline.open_time))?;\n    let high = parse_required_price_at_precision(&kline.high, price_precision, \"kline.high\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures kline {}: {e}\", kline.open_time))?;\n    let low = parse_required_price_at_precision(&kline.low, price_precision, \"kline.low\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures kline {}: {e}\", kline.open_time))?;\n    let close = parse_required_price_at_precision(&kline.close, price_precision, \"kline.close\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures kline {}: {e}\", kline.open_time))?;\n    let volume =\n        parse_required_quantity_at_precision(&kline.volume, size_precision, \"kline.volume\")\n            .map_err(|e| anyhow::anyhow!(\"invalid Futures kline {}: {e}\", kline.open_time))?;\n    let ts_event = parse_millis(kline.close_time, \"Futures kline close time\")?;\n\n    let quote_volume = kline.quote_volume.parse::<Decimal>().map_err(|e| {\n        anyhow::anyhow!(\n            \"invalid Futures kline {} quote volume: {e}\",\n            kline.open_time\n        )\n    })?;\n    let taker_buy_base_volume = kline","sourceCodeStart":3194,"sourceCodeEnd":3230,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/http/client.rs#L3194-L3230","documentation":"Thrown by parse_futures_kline_binance_bar when a kline's open/high price field cannot be parsed into a Price at the instrument's price_precision. Each of open/high/low/close (and volume) is wrapped with the same message keyed by kline.open_time, so this specific instance fires when the OHLC parse fails on one of the first fields; the underlying error is either a malformed decimal string or a value whose precision exceeds the cached instrument's price_precision.","triggerScenarios":"Kline payloads (request_binance_bars / historical klines) with more price decimals than the cached instrument declares — classic stale-instrument-cache drift after Binance tick-size changes; malformed strings from fixtures or proxies; negative/zero prices that Price rejects.","commonSituations":"Historical backfill jobs running long after session start against a stale instrument cache; testnet/mainnet metadata divergence; hand-built kline fixtures in tests with arbitrary precision; schema drift after Binance API updates.","solutions":["Reload instrument definitions to pick up current price_precision, then retry the kline request","Log the failing kline's open_time and compare the raw JSON decimals against the cached precision","Use raw venue exchangeInfo to confirm whether PRICE_FILTER tickSize changed for the symbol","In tests, generate fixtures with prices consistent with the instrument precision used to seed the cache"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure cache precision matches live metadata before backfill\nclient.request_instruments(None).await?; // refresh before long backfills\nlet (symbol, pp, sp) = client.cached_precisions_by_id(instrument_id)?;","typeGuard":null,"tryCatchPattern":"Catch with the kline open_time from the message; log the raw kline, refresh the instrument cache once, and retry the request window; abort the backfill if mismatches persist.","preventionTips":["Refresh instruments at the start of backfill jobs","Generate kline fixtures at the seeded instrument's precision","Watch exchangeInfo for PRICE_FILTER tickSize changes on held symbols"],"tags":["binance","futures","klines","price-parsing","precision","rust","nautilustrader"],"backgroundTag":"price-precision-mismatch","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}