{"record":{"id":"bfb70148dde2992e","repo":"nautechsystems/nautilus_trader","slug":"failed-to-create-price-from-limit-px-e","errorCode":null,"errorMessage":"Failed to create price from limit_px: {e}","messagePattern":"Failed to create price from limit_px: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/http/parse.rs","lineNumber":1018,"sourceCode":"    }\n\n    if let Some(reduce_only) = order.reduce_only {\n        report = report.with_reduce_only(reduce_only);\n    }\n\n    if let Some(reason) = status.rejection_reason() {\n        report = report.with_cancel_reason(reason.to_string());\n    }\n\n    // Only set price for non-filled orders. For filled orders, the limit price is not\n    // the execution price, and setting it would cause bogus inferred fills to be created\n    // during reconciliation. Real fills arrive via the userEvents WebSocket channel.\n    if !matches!(\n        order_status,\n        OrderStatus::Filled | OrderStatus::PartiallyFilled\n    ) {\n        let price = Price::from_decimal_dp(order.limit_px, price_precision)\n            .map_err(|e| anyhow::anyhow!(\"Failed to create price from limit_px: {e}\"))?;\n        report = report.with_price(price);\n    }\n\n    if is_conditional && let Some(trigger_px) = order.trigger_px {\n        let trigger_price = Price::from_decimal_dp(trigger_px, price_precision)\n            .map_err(|e| anyhow::anyhow!(\"Failed to create trigger price: {e}\"))?;\n        report = report\n            .with_trigger_price(trigger_price)\n            .with_trigger_type(TriggerType::Default);\n    }\n\n    Ok(report)\n}\n\n/// Parses a `recentTrades` info entry into a [`TradeTick`].\n///\n/// Mirrors the field mapping of the WebSocket trade parser\n/// [`parse_ws_trade_tick`](crate::websocket::parse::parse_ws_trade_tick): both the","sourceCodeStart":1000,"sourceCodeEnd":1036,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/http/parse.rs#L1000-L1036","documentation":"Raised in parse_order_status_report_from_basic when Price::from_decimal_dp fails converting the order's limit_px into a domain Price at the instrument's price precision, for orders whose status is not Filled/PartiallyFilled (open/resting orders). Price::from_decimal_dp fails when precision exceeds the fixed-point maximum, the value cannot be represented in the raw fixed-point range, or conversion overflows. This typically means limit_px from Hyperliquid is incompatible with the instrument's price_precision.","triggerScenarios":"Calling any order-status report request (by order id, client order id, or open orders for dexes) for a non-filled order whose limit_px has more decimals than the instrument's price_precision, is a sentinel/huge value, or cannot be scaled to PriceRaw without overflow.","commonSituations":"Stale instrument definitions whose price_precision doesn't match the venue (venue changed tick size); spot vs perp instrument confusion; hyperliquid returning scientific-notation or sub-tick prices for special orders (e.g. closing-liquidation orders with extreme px).","solutions":["Verify limit_px in the raw response is a sane decimal and within the instrument's tick-size/precision; re-fetch instruments if the definition is stale","Confirm the correct instrument (perp vs spot, correct asset) is being matched so price_precision is right","Round/normalize limit_px to the instrument precision before parsing if you control the data path, or widen the instrument's price_precision in its definition","Catch the error per-order and skip/degrade that report instead of failing the whole status sweep"],"exampleFix":"// before\nlet price = Price::from_decimal_dp(order.limit_px, price_precision)\n    .map_err(|e| anyhow::anyhow!(\"Failed to create price from limit_px: {e}\"))?;\n// after\nlet price = Price::from_decimal_dp(order.limit_px, price_precision)\n    .map_err(|e| anyhow::anyhow!(\"Failed to create price from limit_px {}: {e}\", order.limit_px))?;","handlingStrategy":"validation","validationCode":"// Python: check px sanity before calling the API\nif px <= 0 or len(str(px).split('.')[-1]) > expected_price_precision:\n    raise ValueError(f\"limit_px {px} not representable at precision {expected_price_precision}\")","typeGuard":null,"tryCatchPattern":"try:\n    reports = client.request_order_status_reports(...)\nexcept ValueError as e:\n    if \"limit_px\" in str(e):\n        log.warning(\"unrepresentable limit_px, skipping order: %s\", e)\n    else:\n        raise","preventionTips":["Refresh instrument definitions so price_precision matches current venue tick size","Verify the correct perp/spot instrument is matched for each order","Round prices to instrument precision before any custom parsing"],"tags":["rust","hyperliquid","parsing","price-conversion","order-status"],"backgroundTag":"invalid-argument-value","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"}