{"record":{"id":"400a68737664b1f0","repo":"nautechsystems/nautilus_trader","slug":"no-price-available-for-instrument-id","errorCode":null,"errorMessage":"No price available for {instrument_id}","messagePattern":"No price available for (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/common/src/greeks.rs","lineNumber":577,"sourceCode":"            None => flat_interest_rate,\n        };\n        let dividend_curve = cache.yield_curve(&underlying_instrument_id.to_string());\n        drop(cache);\n\n        let mut cost_of_carry = 0.0;\n\n        if let Some(dividend_curve) = dividend_curve {\n            cost_of_carry = interest_rate - dividend_curve(expiry_in_years);\n        } else if let Some(div_yield) = flat_dividend_yield {\n            cost_of_carry = interest_rate - div_yield;\n        }\n\n        let multiplier = instrument.multiplier();\n        let is_call = instrument.option_kind().unwrap_or(OptionKind::Call) == OptionKind::Call;\n        let strike = instrument.strike_price().unwrap_or_default().as_f64();\n        let option_price = self\n            .get_price(&instrument_id)\n            .ok_or_else(|| anyhow::anyhow!(\"No price available for {instrument_id}\"))?;\n        let underlying_price = self.get_underlying_price(&underlying_instrument_id)?;\n\n        if let Some(vol_index_id) = vol_index_instrument_id {\n            self.get_price(&vol_index_id)\n                .ok_or_else(|| anyhow::anyhow!(\"No price available for {vol_index_id}\"))?;\n        }\n        let greeks = if update_vol {\n            let cached_greeks = self.cache.borrow().greeks(&instrument_id);\n            match cached_greeks {\n                Some(cached_greeks) => refine_vol_and_greeks(\n                    underlying_price,\n                    interest_rate,\n                    cost_of_carry,\n                    is_call,\n                    strike,\n                    expiry_in_years,\n                    option_price,\n                    cached_greeks.vol,","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/greeks.rs#L559-L595","documentation":"calculate_option_greeks requires the option's own price (plus the underlying's price) to compute greeks. When get_price returns None for the option instrument id, the calculation is aborted with this error. It indicates missing market data for the option contract itself.","triggerScenarios":"Calling instrument_greeks on an option whose cached price is absent — no quote/trade/mark price received for that contract, wrong option instrument id, or data not yet warmed in the cache.","commonSituations":"Computing greeks at strategy start before option data arrives; illiquid options that rarely quote; instrument id built with wrong expiry/strike formatting; venue not publishing the configured price type.","solutions":["Subscribe to and wait for the option's quotes/trades before requesting greeks","Verify the option instrument id (symbol, expiry, strike, right) matches the cache exactly","Provide a fallback price_type (e.g. use last trade or mark price) that exists for the contract","Add a pre-check on get_price and skip/log when the option price is missing"],"exampleFix":"// before\nlet greeks = calculator.instrument_greeks(&option_id, None, None, None, None)?;\n// after\nif calculator.get_price(&option_id).is_none() {\n    anyhow::bail!(\"option {option_id} has no cached price; waiting for data\");\n}\nlet greeks = calculator.instrument_greeks(&option_id, None, None, None, None)?;","handlingStrategy":"validation","validationCode":"if calculator.get_price(&option_id).is_none() {\n    log::warn!(\"no price for option {option_id}; skipping greeks\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match calculator.instrument_greeks(&option_id, None, None, None, None) {\n    Ok(g) => g,\n    Err(e) if e.to_string().starts_with(\"No price available\") => {\n        log::warn!(\"waiting for option data: {e}\");\n        return Ok(());\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Subscribe to option quotes/trades before enabling greeks-based logic","Verify option id formatting (expiry/strike/right) against the instrument provider","Add a readiness gate that requires cached prices for all greeks inputs"],"tags":["greeks","options","missing-data","pricing"],"backgroundTag":"empty-result-set","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"}