{"record":{"id":"722264674c873d00","repo":"nautechsystems/nautilus_trader","slug":"conditional-order-missing-trigger-price","errorCode":null,"errorMessage":"Conditional order missing trigger price","messagePattern":"Conditional order missing trigger price","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/common/parse.rs","lineNumber":890,"sourceCode":"    if let Some(callback) = callback_price {\n        format!(\"Trailing stop: {offset_desc} offset, callback at {callback}\")\n    } else {\n        format!(\"Trailing stop: {offset_desc} offset\")\n    }\n}\n\n/// Validates conditional order parameters from WebSocket data.\n///\n/// # Returns\n///\n/// `Ok(())` if parameters are valid, `Err` with description otherwise.\npub fn validate_conditional_order_params(\n    trigger_px: Option<&str>,\n    tpsl: Option<&HyperliquidTpSl>,\n    is_market: Option<bool>,\n) -> anyhow::Result<()> {\n    if trigger_px.is_none() {\n        anyhow::bail!(\"Conditional order missing trigger price\");\n    }\n\n    if tpsl.is_none() {\n        anyhow::bail!(\"Conditional order missing tpsl indicator\");\n    }\n\n    // No need to validate tpsl value - the enum type guarantees it's either Tp or Sl\n\n    if is_market.is_none() {\n        anyhow::bail!(\"Conditional order missing is_market flag\");\n    }\n\n    Ok(())\n}\n\n/// Parses trigger price from string to Decimal.\n///\n/// # Returns","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/parse.rs#L872-L908","documentation":"validate_conditional_order_params checks that every field Hyperliquid requires for a trigger (TP/SL) order is present. The first check rejects a None trigger_px, since a conditional order on Hyperliquid is meaningless without the price at which it activates. It is a guard so malformed trigger requests never reach the exchange.","triggerScenarios":"Calling validate_conditional_order_params with trigger_px: None — typically when building a TP/SL (take-profit/stop-loss) request from parsed string params where the trigger price key was absent or empty.","commonSituations":"Constructing bracket/TPSL orders from user config where the trigger price field is omitted; parsing venue responses into conditional params and dropping the trigger_px on a code path.","solutions":["Provide the trigger price string (e.g. \"50000.0\") when constructing the conditional/TPSL order params.","Read trigger_px from user input/config explicitly and fail early with a clearer message in your own layer.","If the order should not be conditional, use a plain Market/Limit order path instead of the TPSL path."],"exampleFix":"// before\nvalidate_conditional_order_params(None, Some(&tpsl), Some(true))?;\n// after\nvalidate_conditional_order_params(Some(\"50000.0\"), Some(&tpsl), Some(true))?;","handlingStrategy":"validation","validationCode":"let trigger_px = params.get(\"trigger_px\").filter(|s| !s.is_empty())\n    .ok_or(\"TPSL order requires trigger_px\")?;\nvalidate_conditional_order_params(Some(trigger_px), tpsl, is_market)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make trigger_px a required field in TPSL order config schemas.","Fail with a descriptive error at config-load time, not order time.","Test TPSL order construction with missing-field cases."],"tags":["conditional-order","missing-parameter","hyperliquid","validation"],"backgroundTag":"missing-required-argument","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"}