nautechsystems/nautilus_trader · error · anyhow::Error
Stop limit orders require a trigger price
Error message
Stop limit orders require a trigger price
What it means
StopLimit orders require both a trigger price (to arm the order) and a limit price (to execute it). The adapter bails with this message when order.trigger_price() is None for a StopLimit order, because Hyperliquid's trigger order request needs trigger_px to construct the order.
Source
Thrown at crates/adapters/hyperliquid/src/common/parse.rs:595
}
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,
},
}
} else {
anyhow::bail!("Stop limit orders require a trigger price")
}
}
OrderType::MarketIfTouched => {
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()
};
HyperliquidExchangeOrderKind::Trigger {
trigger: HyperliquidExchangeTriggerParams {
is_market: true,
trigger_px: trigger_price_decimal,
tpsl: HyperliquidExchangeTpSl::Tp,
},
}
} else {View on GitHub (pinned to 18893faf8b)
Solutions
- Pass a trigger price when building the StopLimit order (order_factory.stop_limit(..., trigger_price)).
- Ensure the trigger-computation step runs before order creation and yields a valid price.
- Add pre-submit validation requiring Some(trigger_price) for StopLimit and StopMarket orders.
- If only a limit price was intended without a trigger, submit a plain Limit order instead.
Example fix
// before
let order = order_factory.stop_limit(instrument_id, side, qty, price, None); // no trigger
// after
let trigger = Price::from("41000.0");
let order = order_factory.stop_limit(instrument_id, side, qty, price, Some(trigger)); Defensive patterns
Strategy: validation
Validate before calling
if order.order_type() == OrderType::StopLimit
&& (order.trigger_price().is_none() || order.price().is_none()) {
return Err(anyhow::anyhow!("stop limit {} needs both trigger and limit price", order.client_order_id()));
} Prevention
- Pass both trigger_price and limit price to order_factory.stop_limit
- Resolve indicator-based triggers before constructing the order
- Validate all trigger-type orders carry trigger prices in a pre-submit check
When it happens
Trigger: Submitting or modifying a StopLimit order through submit_order, submit_orders, order_request, or modify_order where the order lacks a trigger price — construction with order_factory.limit(...).to_stop_limit style helpers or deserialization that dropped the optional trigger_price field.
Common situations: Configured stop-limit strategies where the trigger offset was never resolved (e.g. based on an indicator value not yet computed), orders persisted/reloaded losing optional fields, or copy-pasted order factory calls omitting the trigger parameter.
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 market 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/10c500e7db844eee.
Report an issue: GitHub.