{"record":{"id":"7e35f37615ff5d0c","repo":"nautechsystems/nautilus_trader","slug":"instrument-not-found-in-cache-symbol","errorCode":null,"errorMessage":"Instrument not found in cache: {symbol}","messagePattern":"Instrument not found in cache: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":2672,"sourceCode":"                    None\n                }\n            }\n        } else {\n            None\n        };\n\n        Ok(Some(BinanceFuturesAlgoOrderQueryResult {\n            algo: order,\n            actual,\n        }))\n    }\n\n    /// Returns the size precision for an instrument from the cache.\n    fn get_size_precision(&self, symbol: &str) -> anyhow::Result<u8> {\n        let instrument = self\n            .instruments\n            .get(&Ustr::from(symbol))\n            .ok_or_else(|| anyhow::anyhow!(\"Instrument not found in cache: {symbol}\"))?;\n\n        let precision = match instrument.value() {\n            BinanceFuturesInstrument::UsdM(s) => s.quantity_precision,\n            BinanceFuturesInstrument::CoinM(s) => s.quantity_precision,\n        };\n\n        Ok(precision as u8)\n    }\n\n    /// Returns the price precision for an instrument from the cache.\n    fn get_price_precision(&self, symbol: &str) -> anyhow::Result<u8> {\n        let instrument = self\n            .instruments\n            .get(&Ustr::from(symbol))\n            .ok_or_else(|| anyhow::anyhow!(\"Instrument not found in cache: {symbol}\"))?;\n\n        let precision = match instrument.value() {\n            BinanceFuturesInstrument::UsdM(s) => s.price_precision,","sourceCodeStart":2654,"sourceCodeEnd":2690,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/http/client.rs#L2654-L2690","documentation":"Thrown by BinanceFuturesHttpClient::get_size_precision when the symbol (derived from the InstrumentId via format_binance_symbol) has no entry in the client's in-memory instruments DashMap cache. The cache is populated when instruments are fetched/defined during client or actor initialization; requesting order reports for a symbol never loaded means the quantity precision needed to build Quantity values is unavailable, so the method fails fast rather than guessing a precision.","triggerScenarios":"Calling request_order_status_reports / request_fill_reports (which call get_size_precision) before the instrument definitions for that market have been loaded into the client; using a symbol whose formatting does not match the cached key (the cache is keyed by the formatted base symbol string, e.g. 'BTCUSDT'); a delisted or misspelled instrument; USD-M symbol sent to a Coin-M client.","commonSituations":"Backtest or live nodes that fetch instruments lazily after the first report request; typos in InstrumentId symbols; instruments delisted by Binance between session start and report generation; skipping the instrument-loading step in custom wiring of the HTTP client.","solutions":["Load/await the instrument definitions for the market before requesting order or fill reports (populate the cache the client was constructed with)","Verify the InstrumentId: correct venue (BINANCE_PERP vs BINANCE_COINM), correct quote currency, and a symbol Binance actually lists","If the instrument was recently delisted, stop requesting reports for it and clear residual state","Confirm you are using the matching client type for the market type (USD-M client for USDT/USDC pairs, Coin-M client for coin-margined pairs)"],"exampleFix":"// before\nlet fills = client.request_fill_reports(/* ... */).await?; // cache empty\n\n// after\nclient.request_instruments(None).await?; // populate instrument cache first\nlet fills = client.request_fill_reports(/* ... */).await?;","handlingStrategy":"validation","validationCode":"if client.get_size_precision(&symbol).is_err() {\n    client.request_instruments(None).await?; // ensure cache populated\n}\nlet precision = client.get_size_precision(&symbol)?;","typeGuard":null,"tryCatchPattern":"Catch the anyhow error mentioning \"Instrument not found in cache\", trigger an instrument reload once, and only then retry the report request.","preventionTips":["Always complete instrument loading before requesting order/fill reports","Use canonical InstrumentIds like BTCUSDT.BINANCE_PERP","Match client type to market type (UsdM vs CoinM)"],"tags":["binance","futures","instrument-cache","precision","rust","nautilustrader"],"backgroundTag":"instrument-not-in-cache","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}