{"record":{"id":"541ad84717d5e5d1","repo":"nautechsystems/nautilus_trader","slug":"invalid-open-price-e","errorCode":null,"errorMessage":"invalid open price: {e}","messagePattern":"invalid open price: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/data.rs","lineNumber":2074,"sourceCode":"    let ts = UnixNanos::from(entry.time * 1_000_000);\n    FundingRateUpdate::new(instrument_id, rate, Some(60), None, ts, ts)\n}\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,","sourceCodeStart":2056,"sourceCodeEnd":2092,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/data.rs#L2056-L2092","documentation":"When converting a Hyperliquid candle into a Nautilus `Bar`, the open price is parsed with `Price::from_decimal_dp(candle.open, price_precision)`. If the decimal string cannot be parsed or does not fit the instrument's price precision, the error is wrapped as \"invalid open price\". It indicates malformed or precision-incompatible candle data from the REST/WS feed.","triggerScenarios":"Requesting historical candles whose `open` field is not a valid decimal (empty, NaN-like, scientific notation out of range) or has more decimal places than the instrument's configured price_precision.","commonSituations":"Wrong instrument precision in local definitions vs the exchange feed; corrupted/manual candle data; new listings where precision config is stale; test fixtures with fake values.","solutions":["Verify the instrument's price_precision matches the Hyperliquid market (reload instrument definitions).","Inspect the raw candle payload for the offending `open` value and fix/clean the data source.","Re-request the candles; transient bad payloads may be exchange-side glitches.","If feeding custom data, format prices as plain decimal strings within the instrument's precision."],"exampleFix":"// before\nlet candle = Candle { open: \"1.23456789\".to_string(), .. };// precision = 2\n// after\nlet candle = Candle { open: \"1.23\".to_string(), .. }; // matches price_precision","handlingStrategy":"validation","validationCode":"fn candle_fits_precision(open: &str, price_precision: u8) -> bool {\n    rust_decimal::Decimal::from_str(open)\n        .map(|d| d.scale() <= price_precision as u32)\n        .unwrap_or(false)\n}\n// call before requesting/accepting candles:\nassert!(candle_fits_precision(&candle.open, price_precision));","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"invalid open price\") => {\n        tracing::warn!(\"skipping candle with bad open: {e:#}\");\n    }\n    r => r?,\n}","preventionTips":["Keep instrument definitions (price_precision) in sync with the exchange.","Sanitize decimal strings: plain notation, no whitespace, no empty values.","Round feed prices to the instrument precision before Bar construction in custom pipelines."],"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"}