{"record":{"id":"61b6e12e5e85e383","repo":"nautechsystems/nautilus_trader","slug":"invalid-field-precision-e-61b6e1","errorCode":null,"errorMessage":"invalid {field} precision: {e}","messagePattern":"invalid (.+?) precision: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/websocket/streams/parse_exec.rs","lineNumber":435,"sourceCode":"        return None;\n    }\n\n    Price::from_decimal_dp(decimal, precision).ok()\n}\n\nfn parse_positive_price_at_precision(\n    raw: &str,\n    precision: u8,\n    field: &str,\n) -> anyhow::Result<Option<Price>> {\n    let decimal = parse_required_decimal(raw, field)?;\n    if decimal <= Decimal::ZERO {\n        return Ok(None);\n    }\n\n    Price::from_decimal_dp(decimal, precision)\n        .map(Some)\n        .map_err(|e| anyhow::anyhow!(\"invalid {field} precision: {e}\"))\n}\n\nfn parse_algo_trigger_price(\n    algo_data: &AlgoOrderUpdateData,\n    price_precision: u8,\n) -> anyhow::Result<Option<Price>> {\n    let trigger_price = parse_positive_price_at_precision(\n        &algo_data.trigger_price,\n        price_precision,\n        \"trigger_price\",\n    )?;\n\n    if trigger_price.is_none() && requires_algo_trigger_price(algo_data.order_type) {\n        anyhow::bail!(\n            \"missing positive trigger_price for Binance algo order type {:?}\",\n            algo_data.order_type\n        );\n    }","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/websocket/streams/parse_exec.rs#L417-L453","documentation":"parse_positive_price_at_precision converts a raw price string from a Binance Futures algo-order update into a Nautilus Price at the instrument's price precision. Price::from_decimal_dp rounds to the target precision but still fails when the instrument precision exceeds the model's FIXED_PRECISION, the value cannot be converted to the fixed-point raw representation, or scaling overflows/out-ranges PriceRaw. The field name (trigger_price or price) is included in the message.","triggerScenarios":"An algo order update whose trigger_price or price string cannot be represented as a Price at the given instrument precision: precision metadata above the model maximum, or a value whose scaled mantissa overflows the fixed-point PriceRaw range (extremely large or extremely fine-grained values).","commonSituations":"Stale instrument cache built before Binance changed a symbol's precision or tick size; new listings whose metadata was guessed with an out-of-range precision; symbols with very high precision and very large mantissas.","solutions":["Check the log line for which field failed and the underlying {e}; compare the raw value and the instrument's price precision","Refresh the Binance Futures instrument definitions (exchangeInfo) so price precision matches the venue, then re-run","If the venue legitimately sends values outside the representable range, report upstream with the raw algo order update payload","Update to the latest adapter version in case the precision mapping was corrected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"use rust_decimal::Decimal;\n\nfn fits_price_precision(price: Decimal, price_precision: u8) -> bool {\n    // Price::from_decimal_dp rounds, so only range/precision limits matter:\n    // reject absurd values and precisions beyond the model's fixed maximum.\n    price.abs() < Decimal::from(1_000_000_000u64) && price_precision <= 18\n}\n\nlet trigger = Decimal::from_str_exact(&raw_trigger_price)?;\nassert!(fits_price_precision(trigger, instrument.price_precision), \"trigger price not representable\");","typeGuard":null,"tryCatchPattern":"Wrap per-message algo-order parsing in an error boundary: log the field name and raw string from the error, skip that update, and keep the stream running; alert if failures repeat for the same symbol (indicates stale instrument metadata).","preventionTips":["Refresh instrument definitions after Binance tick-size/precision changes","Place orders at tick-aligned prices","Alert on repeated precision failures per symbol to catch metadata drift early"],"tags":["binance","futures","algo-orders","price-precision","parsing"],"backgroundTag":"price-precision-mismatch","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}