{"record":{"id":"0a7703156f2dcc26","repo":"nautechsystems/nautilus_trader","slug":"invalid-name-price-e","errorCode":null,"errorMessage":"invalid {name} price: {e}","messagePattern":"invalid (.+?) price: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/http/client.rs","lineNumber":3076,"sourceCode":"        instrument_id: InstrumentId,\n        instrument: &InstrumentAny,\n        snapshot: &BinanceDepth,\n        ts_event: UnixNanos,\n    ) -> anyhow::Result<OrderBook> {\n        let sequence = u64::try_from(snapshot.last_update_id)\n            .map_err(|_| anyhow::anyhow!(\"invalid negative order-book update ID\"))?;\n        let mut book = OrderBook::new(instrument_id, BookType::L2_MBP);\n        let mut add_level = |level: &super::models::BinancePriceLevel,\n                             side: OrderSide,\n                             order_id: usize,\n                             name: &str|\n         -> anyhow::Result<()> {\n            let price = Price::from_mantissa_exponent_checked(\n                level.price_mantissa,\n                snapshot.price_exponent,\n                instrument.price_precision(),\n            )\n            .map_err(|e| anyhow::anyhow!(\"invalid {name} price: {e}\"))?;\n            anyhow::ensure!(price.is_positive(), \"invalid non-positive {name} price\");\n            let qty_mantissa = u64::try_from(level.qty_mantissa)\n                .map_err(|_| anyhow::anyhow!(\"invalid negative {name} quantity\"))?;\n            let quantity = Quantity::from_mantissa_exponent_checked(\n                qty_mantissa,\n                snapshot.qty_exponent,\n                instrument.size_precision(),\n            )\n            .map_err(|e| anyhow::anyhow!(\"invalid {name} quantity: {e}\"))?;\n            anyhow::ensure!(\n                quantity.is_positive(),\n                \"invalid non-positive {name} quantity\"\n            );\n            let order = BookOrder::new(\n                side,\n                price,\n                quantity,\n                u64::try_from(order_id)","sourceCodeStart":3058,"sourceCodeEnd":3094,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/http/client.rs#L3058-L3094","documentation":"Thrown when converting a bid/ask level's price mantissa (with the snapshot's `price_exponent`) into a Nautilus `Price` fails — e.g. the value cannot be represented at the instrument's `price_precision`. The `name` is \"bid\" or \"ask\", identifying the failing side.","triggerScenarios":"Calling `request_book_snapshot` when a level's `price_mantissa` combined with `price_exponent` cannot produce a valid `Price` at `instrument.price_precision()` — typically an exponent/precision mismatch between the cached instrument definition and the snapshot.","commonSituations":"Stale or missing instrument definitions in the adapter cache so precision doesn't match the exchange data; a corrupted depth payload with absurd price values; tick-size/precision changes on the exchange after an instrument update.","solutions":["Refresh the instruments cache so `price_precision` matches current Binance filters (PRICE_FILTER tickSize).","Re-fetch the depth snapshot to rule out a transient malformed payload.","Check the error's inner `{e}` message for the exact Price conversion failure.","Verify the adapter version matches the current Binance Spot API price-exponent encoding."],"exampleFix":"// before: assuming cached instrument is current\nlet book = client.request_book_snapshot(instrument_id, depth).await?;\n// after: reload instruments before requesting the book\nclient.reload_instruments().await?;\nlet book = client.request_book_snapshot(instrument_id, depth).await?;","handlingStrategy":"validation","validationCode":"fn price_fits_precision(level_price: i64, exponent: i32, precision: u8) -> bool {\n    // level price must be representable at the instrument's price precision\n    (exponent >= -(precision as i32)) || level_price % 10 == 0\n}","typeGuard":"fn valid_level(level: &BinancePriceLevel) -> bool { level.price_mantissa > 0 }","tryCatchPattern":"match client.request_book_snapshot(id, depth).await {\n    Ok(book) => book,\n    Err(e) if e.to_string().contains(\"invalid bid price\") || e.to_string().contains(\"invalid ask price\") => {\n        reload_instruments_and_retry(id, depth).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep the instruments cache refreshed so price_precision matches current PRICE_FILTER tick sizes.","Reload instruments after exchange filter updates.","Log the raw snapshot on parse failure for diagnosis."],"tags":["orderbook","binance","price","precision","validation"],"backgroundTag":"invalid-argument-value","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"}