{"record":{"id":"1991ec25489cf8b7","repo":"nautechsystems/nautilus_trader","slug":"conditional-orders-require-a-trigger-price-for-hyp","errorCode":null,"errorMessage":"Conditional orders require a trigger price for Hyperliquid: {order.order_type():?}","messagePattern":"Conditional orders require a trigger price for Hyperliquid: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/execution.rs","lineNumber":2742,"sourceCode":"\n        if !matches!(order.order_type(), OrderType::Market | OrderType::Limit) {\n            anyhow::bail!(\n                \"Trigger order types are not supported for Hyperliquid HIP-4 outcomes: \\\n                 {symbol} (received {:?})\",\n                order.order_type()\n            );\n        }\n    }\n\n    if matches!(\n        order.order_type(),\n        OrderType::StopMarket\n            | OrderType::StopLimit\n            | OrderType::MarketIfTouched\n            | OrderType::LimitIfTouched\n    ) && order.trigger_price().is_none()\n    {\n        anyhow::bail!(\n            \"Conditional orders require a trigger price for Hyperliquid: {:?}\",\n            order.order_type()\n        );\n    }\n\n    if matches!(\n        order.order_type(),\n        OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched\n    ) && order.price().is_none()\n    {\n        anyhow::bail!(\n            \"Limit orders require a limit price for Hyperliquid: {:?}\",\n            order.order_type()\n        );\n    }\n\n    Ok(())\n}","sourceCodeStart":2724,"sourceCodeEnd":2760,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/execution.rs#L2724-L2760","documentation":"Conditional order types on Hyperliquid (StopMarket, StopLimit, MarketIfTouched, LimitIfTouched) are mapped to venue trigger orders, which require a trigger price. If such an order is submitted without one, the adapter rejects it with this error naming the order type.","triggerScenarios":"submit_order with OrderType in {StopMarket, StopLimit, MarketIfTouched, LimitIfTouched} where order.trigger_price() is None — the order was built without a trigger price.","commonSituations":"Order factory default-constructed conditional orders without setting the trigger; a bug in strategy code assuming trigger_price defaults to the limit/market price; orders deserialized from external config missing the trigger field.","solutions":["Provide a trigger_price when constructing the StopMarket/StopLimit/MarketIfTouched/LimitIfTouched order.","Validate the order in the strategy before submission (assert trigger_price().is_some() for conditional types).","Fix order-construction helpers to require a trigger parameter for conditional types.","If the order should be unconditional, use Market or Limit instead."],"exampleFix":"// before\nlet order = factory.stop_market(instrument_id, side, qty); // no trigger\nexec_client.submit_order(&order).await?;\n// after\nlet order = factory.stop_market_instrument(instrument_id, side, qty, trigger_price); // trigger set\nexec_client.submit_order(&order).await?;","handlingStrategy":"validation","validationCode":"fn has_trigger(order: &OrderAny) -> bool {\n    !matches!(order.order_type(), OrderType::StopMarket | OrderType::StopLimit\n        | OrderType::MarketIfTouched | OrderType::LimitIfTouched)\n        || order.trigger_price().is_some()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass a trigger price when building conditional orders","Validate trigger presence in order-construction helpers","Use type-safe factory methods that require trigger parameters"],"tags":["rust","hyperliquid","trigger-price","missing-argument","order-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"}