{"record":{"id":"882bc74dd8dd1bc2","repo":"nautechsystems/nautilus_trader","slug":"invalid-low-price-e","errorCode":null,"errorMessage":"invalid low price: {e}","messagePattern":"invalid low price: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/data.rs","lineNumber":2078,"sourceCode":"pub(crate) fn candle_to_bar(\n    candle: &HyperliquidCandle,\n    bar_type: BarType,\n    price_precision: u8,\n    size_precision: u8,\n) -> anyhow::Result<Bar> {\n    let ts_event = millis_to_nanos(candle.timestamp)?;\n    let close_boundary = candle\n        .end_timestamp\n        .checked_add(1)\n        .context(\"candle close boundary overflow\")?;\n    let ts_init = millis_to_nanos(close_boundary)?;\n\n    let open = Price::from_decimal_dp(candle.open, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid open price: {e}\"))?;\n    let high = Price::from_decimal_dp(candle.high, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid high price: {e}\"))?;\n    let low = Price::from_decimal_dp(candle.low, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid low price: {e}\"))?;\n    let close = Price::from_decimal_dp(candle.close, price_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid close price: {e}\"))?;\n    let volume = Quantity::from_decimal_dp(candle.volume, size_precision)\n        .map_err(|e| anyhow::anyhow!(\"invalid volume: {e}\"))?;\n\n    Ok(Bar::new(\n        bar_type, open, high, low, close, volume, ts_event, ts_init,\n    ))\n}\n\n/// Request bars from HTTP API.\nasync fn request_bars_from_http(\n    http_client: HyperliquidHttpClient,\n    bar_type: BarType,\n    start: Option<Timestamp>,\n    end: Option<Timestamp>,\n    limit: Option<u32>,\n    instruments: Arc<AtomicMap<InstrumentId, InstrumentAny>>,","sourceCodeStart":2060,"sourceCodeEnd":2096,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/data.rs#L2060-L2096","documentation":"During Hyperliquid candle-to-Bar conversion, the low price fails `Price::from_decimal_dp(candle.low, price_precision)` and is wrapped as \"invalid low price\". The low value from the candle payload cannot be parsed or represented at the instrument's price precision.","triggerScenarios":"Candle response containing an `low` field that is empty, malformed, or has more decimals than the configured instrument price_precision while building a Bar.","commonSituations":"Precision mismatch between local instrument definition and exchange; bad payloads from a data proxy; hand-written fixtures with wrongly formatted decimals.","solutions":["Confirm instrument price_precision matches the Hyperliquid market definition.","Inspect and fix the offending candle `low` value at the source.","Re-request the affected candles.","Pre-validate decimal strings (parseable, within precision) before constructing Candles."],"exampleFix":"// before\nCandle { low: \"\".to_string(), .. }\n// after\nCandle { low: \"4248.25\".to_string(), .. }","handlingStrategy":"validation","validationCode":"fn candle_fits_precision(low: &str, price_precision: u8) -> bool {\n    rust_decimal::Decimal::from_str(low)\n        .map(|d| d.scale() <= price_precision as u32)\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"invalid low price\") => {\n        tracing::warn!(\"dropping candle with bad low: {e:#}\");\n    }\n    r => r?,\n}","preventionTips":["Reject empty or whitespace-padded decimal strings upstream.","Keep price_precision config matched to the Hyperliquid market definition.","Round-trip test fixtures through the same parser used in production."],"tags":["data","candles","parsing","precision","hyperliquid"],"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-14T05:17:10.506Z"}