{"record":{"id":"6069aefcf1513d6b","repo":"nautechsystems/nautilus_trader","slug":"invalid-high-price-e","errorCode":null,"errorMessage":"invalid high price: {e}","messagePattern":"invalid high price: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/data.rs","lineNumber":2076,"sourceCode":"}\n\npub(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>,","sourceCodeStart":2058,"sourceCodeEnd":2094,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/data.rs#L2058-L2094","documentation":"Same candle-to-Bar conversion as error 3105, applied to the high price: `Price::from_decimal_dp(candle.high, price_precision)` failed and is wrapped as \"invalid high price\". The feed returned a high value that cannot be represented as a valid Price at the instrument's precision.","triggerScenarios":"Historical/requested candle whose `high` field is an unparsable decimal or exceeds the configured price_precision during Bar construction.","commonSituations":"Stale instrument precision config; corrupted exchange payload; manually constructed Candle structs in tests/backtests with wrong formatting.","solutions":["Reload instrument definitions so price_precision matches the exchange.","Inspect the raw candle `high` value and correct the data source.","Re-fetch the affected candle range.","Normalize custom candle values to the instrument's decimal precision before conversion."],"exampleFix":"// before\nCandle { high: \"NaN\".to_string(), .. }\n// after\nCandle { high: \"4250.5\".to_string(), .. }","handlingStrategy":"validation","validationCode":"fn candle_fits_precision(high: &str, price_precision: u8) -> bool {\n    rust_decimal::Decimal::from_str(high)\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 high price\") => {\n        tracing::warn!(\"dropping candle with bad high: {e:#}\");\n    }\n    r => r?,\n}","preventionTips":["Reload instrument definitions after exchange precision changes.","Validate all four OHLC fields, not just the one that failed last time.","Log the raw candle payload on failure to speed up diagnosis."],"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-14T00:17:10.932Z"}