{"record":{"id":"ee68e967032649b5","repo":"nautechsystems/nautilus_trader","slug":"failed-to-create-trigger-price-e","errorCode":null,"errorMessage":"Failed to create trigger price: {e}","messagePattern":"Failed to create trigger price: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/http/parse.rs","lineNumber":1024,"sourceCode":"    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\n/// `trades` channel and the `recentTrades` endpoint carry the same\n/// `px`/`sz`/`side`/`time`/`tid` fields. For this historical snapshot `ts_init` is\n/// set to the trade's `ts_event` (venue time), matching the other request\n/// converters so the data engine's window trimming keeps bounded requests.\n///\n/// # Errors","sourceCodeStart":1006,"sourceCodeEnd":1042,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/http/parse.rs#L1006-L1042","documentation":"Raised in parse_order_status_report_from_basic for conditional (trigger/stop) orders when Price::from_decimal_dp fails converting order.trigger_px into a domain Price at the instrument's price precision. Trigger prices from Hyperliquid must be representable in the fixed-point Price type; failures mean the value is negative, out of raw range, overflows during scaling, or uses a precision the Price type can't hold.","triggerScenarios":"Requesting an order status report for a conditional order (stop-loss/take-under trigger order) whose trigger_px is negative, extremely large, or has more decimal places than the instrument's price_precision allows.","commonSituations":"Liquidation/stop orders with extreme trigger prices during volatile markets; instrument definitions fetched with wrong precision; API format changes to trigger_px.","solutions":["Inspect the raw trigger_px value in the response; confirm it is a positive decimal within the instrument's price range","Re-fetch/refresh instrument definitions so price_precision matches current venue tick rules","Normalize trigger_px to the instrument precision before conversion, or update the instrument definition precision","Catch per-order and skip/mark-degraded conditional orders instead of aborting the whole reconciliation sweep"],"exampleFix":"// before\nlet trigger_price = Price::from_decimal_dp(trigger_px, price_precision)\n    .map_err(|e| anyhow::anyhow!(\"Failed to create trigger price: {e}\"))?;\n// after\nlet trigger_price = Price::from_decimal_dp(trigger_px, price_precision)\n    .map_err(|e| anyhow::anyhow!(\"Failed to create trigger price from {trigger_px}: {e}\"))?;","handlingStrategy":"validation","validationCode":"# Python: validate trigger price before requesting conditional order status\nif trigger_px <= 0:\n    raise ValueError(f\"invalid trigger_px {trigger_px}\")","typeGuard":null,"tryCatchPattern":"try:\n    report = client.request_order_status_report(instrument_id, client_order_id)\nexcept ValueError as e:\n    if \"trigger price\" in str(e):\n        log.warning(\"bad trigger_px for conditional order: %s\", e)\n    else:\n        raise","preventionTips":["Expect extreme trigger prices on stop/liquidation orders and pre-validate them","Keep instrument price_precision definitions in sync with the venue","Handle conditional orders per-item so one bad trigger_px doesn't abort the sweep"],"tags":["rust","hyperliquid","parsing","trigger-order","price-conversion"],"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"}