nautechsystems/nautilus_trader · error · anyhow::Error
Stop market orders require a trigger price
Error message
Stop market orders require a trigger price
What it means
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.
Source
Thrown at crates/adapters/hyperliquid/src/common/parse.rs:575
}
OrderType::StopMarket => {
if let Some(trigger_price) = order.trigger_price() {
let raw = trigger_price.as_decimal();
let trigger_price_decimal = if should_normalize_prices {
normalize_price(raw, price_decimals).normalize()
} else {
raw.normalize()
};
let tpsl = determine_tpsl_type(order_type, order_side, trigger_price_decimal, None);
HyperliquidExchangeOrderKind::Trigger {
trigger: HyperliquidExchangeTriggerParams {
is_market: true,
trigger_px: trigger_price_decimal,
tpsl,
},
}
} else {
anyhow::bail!("Stop market orders require a trigger price")
}
}
OrderType::StopLimit => {
if let Some(trigger_price) = order.trigger_price() {
let raw = trigger_price.as_decimal();
let trigger_price_decimal = if should_normalize_prices {
normalize_price(raw, price_decimals).normalize()
} else {
raw.normalize()
};
let tpsl = determine_tpsl_type(order_type, order_side, trigger_price_decimal, None);
HyperliquidExchangeOrderKind::Trigger {
trigger: HyperliquidExchangeTriggerParams {
is_market: false,
trigger_px: trigger_price_decimal,
tpsl,
},
}View on GitHub (pinned to 18893faf8b)
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.
Example fix
// before
let order = order_factory.stop_market(instrument_id, side, qty, None); // no trigger
// after
let trigger = Price::from("41000.0");
let order = order_factory.stop_market(instrument_id, side, qty, Some(trigger)); Defensive patterns
Strategy: validation
Validate before calling
if order.order_type() == OrderType::StopMarket && order.trigger_price().is_none() {
return Err(anyhow::anyhow!("stop market {} missing trigger price", order.client_order_id()));
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Stop limit orders require a trigger price
- Limit orders require a price
- Unsupported OrderType for conditional orders: {value:?}
- {FAILED}: {e}
- {FAILED}: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/f5b194559dd03799.
Report an issue: GitHub.