{"record":{"id":"f5b194559dd03799","repo":"nautechsystems/nautilus_trader","slug":"stop-market-orders-require-a-trigger-price","errorCode":null,"errorMessage":"Stop market orders require a trigger price","messagePattern":"Stop market orders require a trigger price","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/hyperliquid/src/common/parse.rs","lineNumber":575,"sourceCode":"        }\n        OrderType::StopMarket => {\n            if let Some(trigger_price) = order.trigger_price() {\n                let raw = trigger_price.as_decimal();\n                let trigger_price_decimal = if should_normalize_prices {\n                    normalize_price(raw, price_decimals).normalize()\n                } else {\n                    raw.normalize()\n                };\n                let tpsl = determine_tpsl_type(order_type, order_side, trigger_price_decimal, None);\n                HyperliquidExchangeOrderKind::Trigger {\n                    trigger: HyperliquidExchangeTriggerParams {\n                        is_market: true,\n                        trigger_px: trigger_price_decimal,\n                        tpsl,\n                    },\n                }\n            } else {\n                anyhow::bail!(\"Stop market orders require a trigger price\")\n            }\n        }\n        OrderType::StopLimit => {\n            if let Some(trigger_price) = order.trigger_price() {\n                let raw = trigger_price.as_decimal();\n                let trigger_price_decimal = if should_normalize_prices {\n                    normalize_price(raw, price_decimals).normalize()\n                } else {\n                    raw.normalize()\n                };\n                let tpsl = determine_tpsl_type(order_type, order_side, trigger_price_decimal, None);\n                HyperliquidExchangeOrderKind::Trigger {\n                    trigger: HyperliquidExchangeTriggerParams {\n                        is_market: false,\n                        trigger_px: trigger_price_decimal,\n                        tpsl,\n                    },\n                }","sourceCodeStart":557,"sourceCodeEnd":593,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/common/parse.rs#L557-L593","documentation":"StopMarket orders on Hyperliquid are expressed as trigger orders and therefore require a trigger_px; the adapter bails with this message when order.trigger_price() is None for a StopMarket order. Without a trigger price the exchange request cannot be built.","triggerScenarios":"Submitting or modifying a StopMarket order via submit_order, submit_orders, order_request, or modify_order where the order was created without a trigger price (order_factory.market(...).to_stop... style construction that skipped the trigger), e.g. risk-module stop generation with an unset trigger.","commonSituations":"Stop orders created from templates where the trigger is attached in a later step that never ran; risk-management code deriving stops from prices that were unavailable (NaN/None) at build time; orders reconstructed from persistence losing the optional trigger field.","solutions":["Provide a trigger price when constructing the StopMarket order (e.g. order_factory.stop_market(..., trigger_price)).","Audit the code path that sets trigger_price — ensure it runs before submission and that the source price was valid, not NaN/None.","Add pre-submit validation that all trigger-type orders carry Some(trigger_price).","If no trigger was intended, submit a plain Market order instead."],"exampleFix":"// before\nlet order = order_factory.stop_market(instrument_id, side, qty, None); // no trigger\n// after\nlet trigger = Price::from(\"41000.0\");\nlet order = order_factory.stop_market(instrument_id, side, qty, Some(trigger));","handlingStrategy":"validation","validationCode":"if order.order_type() == OrderType::StopMarket && order.trigger_price().is_none() {\n    return Err(anyhow::anyhow!(\"stop market {} missing trigger price\", order.client_order_id()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass trigger_price explicitly when creating stop orders","Verify the trigger-derivation code always yields a valid price before building the order","Sanity-check deserialized/persisted orders for lost optional trigger fields"],"tags":["hyperliquid","orders","stop-order","missing-field","rust"],"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-14T00:17:10.932Z"}