{"record":{"id":"2f761a144fcaeef7","repo":"nautechsystems/nautilus_trader","slug":"invalid-futures-trade-id-e","errorCode":null,"errorMessage":"invalid Futures trade id {}: {e}","messagePattern":"invalid Futures trade id (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":3158,"sourceCode":"                &rate,\n                instrument_id,\n                ts_init,\n            )?);\n        }\n\n        Ok(result)\n    }\n}\n\nfn parse_futures_trade_tick(\n    trade: &BinanceFuturesTrade,\n    instrument_id: InstrumentId,\n    price_precision: u8,\n    size_precision: u8,\n    ts_init: UnixNanos,\n) -> anyhow::Result<TradeTick> {\n    let price = parse_required_price_at_precision(&trade.price, price_precision, \"trade.price\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures trade id {}: {e}\", trade.id))?;\n    let size = parse_required_quantity_at_precision(&trade.qty, size_precision, \"trade.qty\")\n        .map_err(|e| anyhow::anyhow!(\"invalid Futures trade id {}: {e}\", trade.id))?;\n    let ts_event = parse_millis(trade.time, \"Futures trade time\")?;\n\n    let aggressor_side = if trade.is_buyer_maker {\n        AggressorSide::Sell\n    } else {\n        AggressorSide::Buy\n    };\n\n    Ok(TradeTick::new(\n        instrument_id,\n        price,\n        size,\n        aggressor_side,\n        TradeId::new(trade.id.to_string()),\n        ts_event,\n        ts_init,","sourceCodeStart":3140,"sourceCodeEnd":3176,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/http/client.rs#L3140-L3176","documentation":"Thrown by parse_futures_trade_tick when the trade's price string cannot be converted to a Price at the cached instrument's price_precision. The chain is Decimal::from_str (fails on malformed strings) then Price::from_decimal_dp (fails when the value is negative, zero, or has more precision than the instrument declares); the message prefixes the offending trade's ID so the raw venue payload can be located.","triggerScenarios":"An aggTrade/trade payload whose price string has more decimal places than quantity_precision... (price side: price_precision) of the cached instrument definition — typically after Binance changes tick precision and the client cache still holds stale precision loaded at session start; malformed values like '-' or scientific-notation strings; negative or zero prices (impossible from the venue, possible from broken fixtures).","commonSituations":"Long-running live sessions that loaded instruments before a venue precision change; testnet instruments whose metadata differs from mainnet; replay fixtures with synthetic price strings; stale instrument cache after Binance contract adjustments (e.g. price precision changes on delisting/consolidation events).","solutions":["Reload instrument definitions (re-request instruments) so the cache holds the venue's current price_precision, then retry","Capture the failing raw trade (by the ID in the message) and compare its decimals against the cached instrument's precision to confirm the mismatch","If the value is malformed/negative, inspect for proxy or fixture tampering rather than retrying","Report persistent mismatches upstream — NautilusTrader must not silently round venue prices"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// keep instrument precisions fresh before parsing live trades\nif client.get_price_precision(&symbol).is_err() {\n    client.request_instruments(None).await?;\n}","typeGuard":null,"tryCatchPattern":"Catch per-trade: the error names the trade ID — log it with the raw price string, skip the tick (or halt the stream if mismatches cluster), and trigger an instrument-cache refresh before resuming.","preventionTips":["Refresh instrument definitions on long-running sessions","Compare failing raw prices with exchangeInfo tickSize","Do not hand-edit precision assumptions; always derive from instrument cache"],"tags":["binance","futures","trade-ticks","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"}