{"record":{"id":"0334d921f64305f9","repo":"nautechsystems/nautilus_trader","slug":"invalid-candle-low-e","errorCode":null,"errorMessage":"invalid candle low: {e}","messagePattern":"invalid candle low: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/http/parse.rs","lineNumber":219,"sourceCode":"    );\n    anyhow::ensure!(\n        candle.close > Decimal::ZERO,\n        \"non-positive candle close `{}`\",\n        candle.close\n    );\n\n    let timestamp_ms =\n        u64::try_from(candle.timestamp).context(\"negative Lighter candle timestamp\")?;\n    let ts_event = parse_millis_to_nanos(timestamp_ms)?;\n    let price_precision = instrument.price_precision();\n    let size_precision = instrument.size_precision();\n\n    let open = Price::from_decimal_dp(candle.open, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid candle open: {e}\"))?;\n    let high = Price::from_decimal_dp(candle.high, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid candle high: {e}\"))?;\n    let low = Price::from_decimal_dp(candle.low, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid candle low: {e}\"))?;\n    let close = Price::from_decimal_dp(candle.close, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid candle close: {e}\"))?;\n    anyhow::ensure!(\n        candle.volume_base.is_sign_positive(),\n        \"negative candle volume `{}`\",\n        candle.volume_base,\n    );\n    let volume = Quantity::from_decimal_dp(candle.volume_base, size_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid candle volume: {e}\"))?;\n\n    Bar::new_checked(bar_type, open, high, low, close, volume, ts_event, ts_init)\n        .context(\"failed to construct Bar from Lighter candle\")\n}\n\n/// Parses a Lighter historical funding row into a Nautilus [`FundingRateUpdate`].\n///\n/// Lighter returns `rate` as a magnitude and `direction` as the side paying\n/// the funding. Nautilus uses the conventional signed rate: positive when","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/http/parse.rs#L201-L237","documentation":"This error wraps a failure converting the candle's low Decimal into a Price with the instrument's price precision in parse_candle_bar. from_decimal_dp rejects values it cannot represent, so a malformed or precision-incompatible low produces this wrapped error.","triggerScenarios":"LighterCandle.low rejected by Price::from_decimal_dp(low, price_precision) during parse_candle_bar/parse_bars — e.g. non-finite decimals or precision conflicts with the instrument definition.","commonSituations":"Bad upstream lows (NaN/inf); wrong instrument (precision) supplied; API schema change altering decimal formatting of candle fields.","solutions":["Check the chained cause {e} for the exact conversion failure","Use the instrument definition matching the candle's instrument_id and tick size","Pre-validate that candle decimals are finite before parsing","Inspect the raw response for malformed low values"],"exampleFix":"// before\nlet low = Price::from_decimal_dp(candle.low, price_precision)?;\n// after\nanyhow::ensure!(candle.low.is_finite(), \"non-finite candle low\");\nlet low = Price::from_decimal_dp(candle.low, price_precision)?;","handlingStrategy":"try-catch","validationCode":"anyhow::ensure!(candle.low.is_finite(), \"non-finite candle low: {}\", candle.low);","typeGuard":"fn convertible_low(c: &LighterCandle, precision: u8) -> bool {\n    c.low.is_finite() && c.low > Decimal::ZERO\n}","tryCatchPattern":"let low = Price::from_decimal_dp(candle.low, price_precision)\n    .map_err(|e| anyhow::anyhow!(\"invalid candle low: {e}\"))\n    .with_context(|| format!(\"candle for {}\", instrument.id()))?;","preventionTips":["Pre-validate candle decimals (finite, positive) before parsing","Keep instrument definitions in sync with the venue's tick/precision","Verify fixture candles convert cleanly at fixture instrument precision","Log the raw candle on conversion failure for diagnosis"],"tags":["rust","price-conversion","candles","precision"],"backgroundTag":"invalid-argument-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}