{"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":3229,"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":3211,"sourceCodeEnd":3247,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/client.rs#L3211-L3247","documentation":"Wraps a failure to parse the Futures trade tick's price (trade.price) at the instrument's configured price precision into the error message. Despite the message text saying 'trade id', the underlying {e} comes from price parsing (parse_required_price_at_precision). It indicates the trade price string cannot be converted to a valid Price at the given precision.","triggerScenarios":"Calling the futures trade-tick conversion function (build TradeTick from REST trade) when parse_required_price_at_precision(&trade.price, price_precision, \"trade.price\") fails — e.g. price string has more decimal places than price_precision, is empty, or is not a number.","commonSituations":"Instrument configured with wrong price_precision for the symbol (e.g. precision 2 for a symbol quoted at 4 decimals); corrupted or unexpected trade payload from the API; using precision from a different instrument.","solutions":["Check the instrument definition's price_precision matches the actual symbol tick size from Binance exchangeInfo","Log the raw trade.price string and the configured precision to see the mismatch","Verify the instrument_id corresponds to the symbol the trades were requested for","If the payload is malformed, drop the tick and continue rather than aborting the request"],"exampleFix":"// before\nlet 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// after: align precision with instrument definition\nlet price_precision = instrument.price_precision; // from the loaded Instrument, not hardcoded\nlet price = parse_required_price_at_precision(&trade.price, price_precision, \"trade.price\")?;","handlingStrategy":"validation","validationCode":"fn valid_price(s: &str, precision: u8) -> bool {\n    match s.parse::<f64>() { Ok(v) => v > 0.0 && decimals_ok(s, precision), Err(_) => false }\n}","typeGuard":null,"tryCatchPattern":"let trade_tick = match parse_futures_trade(&trade, instrument) {\n    Ok(t) => t,\n    Err(e) => { warn!(\"dropping trade {}: {e}\", trade.id); continue; }\n};","preventionTips":["Load price_precision from the actual Instrument, never hardcode it","Cross-check symbol tick size against Binance exchangeInfo","Validate trade payloads (non-empty numeric price/qty) before conversion","Ensure requests use the same symbol as the instrument definition"],"tags":["rust","binance-futures","parsing","precision"],"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-23T08:17:48.524Z"}