{"record":{"id":"0ff0ee6de9c71ca6","repo":"nautechsystems/nautilus_trader","slug":"cannot-process-partial-quote-for-instrument-id-0ff0ee","errorCode":null,"errorMessage":"Cannot process partial quote for {instrument_id}: missing ask_price and no cached value","messagePattern":"Cannot process partial quote for (.+?): missing ask_price and no cached value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/common/src/cache/quote.rs","lineNumber":134,"sourceCode":"        instrument_id: InstrumentId,\n        bid_price: Option<Price>,\n        ask_price: Option<Price>,\n        bid_size: Option<Quantity>,\n        ask_size: Option<Quantity>,\n        ts_event: UnixNanos,\n        ts_init: UnixNanos,\n    ) -> anyhow::Result<QuoteTick> {\n        let cached = self.quotes.get(&instrument_id);\n\n        // Resolve each field: use provided value or fall back to cache\n        let Some(bid_price) = bid_price.or_else(|| cached.map(|quote| quote.bid_price)) else {\n            anyhow::bail!(\n                \"Cannot process partial quote for {instrument_id}: missing bid_price and no cached value\"\n            );\n        };\n\n        let Some(ask_price) = ask_price.or_else(|| cached.map(|quote| quote.ask_price)) else {\n            anyhow::bail!(\n                \"Cannot process partial quote for {instrument_id}: missing ask_price and no cached value\"\n            );\n        };\n\n        let Some(bid_size) = bid_size.or_else(|| cached.map(|quote| quote.bid_size)) else {\n            anyhow::bail!(\n                \"Cannot process partial quote for {instrument_id}: missing bid_size and no cached value\"\n            );\n        };\n\n        let Some(ask_size) = ask_size.or_else(|| cached.map(|quote| quote.ask_size)) else {\n            anyhow::bail!(\n                \"Cannot process partial quote for {instrument_id}: missing ask_size and no cached value\"\n            );\n        };\n\n        let quote = QuoteTick::new(\n            instrument_id,","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/cache/quote.rs#L116-L152","documentation":"Partial-quote resolution in the quote cache: each field falls back to the last cached quote for the instrument; a missing ask_price with no cached value leaves the quote incomplete, so processing fails instead of fabricating a price.","triggerScenarios":"First (or post-clear) call to QuoteCache::process for an instrument with ask_price=None, while bid_price/bid_size/ask_size are supplied.","commonSituations":"Delta feeds whose first tick omits the ask side; cache cleared on reconnect followed by partial updates; cold-start subscribers joining mid-session.","solutions":["Ensure the first update for an instrument is a complete quote (all four fields)","Hold partial updates until a full quote populates the cache","Pass an explicit ask_price when no cached value exists"],"exampleFix":"// before\nquote_cache.process(instrument_id, bid, None, bid_size, ask_size, ts_event, ts_init)?;\n// after\nif !quote_cache.contains(&instrument_id) { return; } // skip until full quote arrives\nquote_cache.process(instrument_id, bid, None, bid_size, ask_size, ts_event, ts_init)?;","handlingStrategy":"try-catch","validationCode":"fn can_process(cache: &QuoteCache, id: &InstrumentId, ask_price: Option<Price>) -> bool {\n    ask_price.is_some() || cache.contains(id)\n}","typeGuard":null,"tryCatchPattern":"match quote_cache.process(instrument_id, bid_price, ask_price, bid_size, ask_size, ts_event, ts_init) {\n    Ok(quote) => /* forward quote */,\n    Err(e) if e.to_string().contains(\"missing ask_price\") => { /* skip partial update */ }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Require the first quote per instrument to be complete (both prices and sizes)","Track per-instrument 'primed' state and drop partial ticks until primed"],"tags":["market-data","quotes","cache","missing-data","rust"],"backgroundTag":"missing-required-argument","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"}