nautechsystems/nautilus_trader · error
Stop market order missing trigger_price
Error message
Stop market order missing trigger_price
What it means
dYdX STOP_MARKET orders are conditional orders that require a trigger_price. The client reads order.trigger_price() when building the on-chain message and throws this error if it is None. Without a trigger the exchange could not evaluate when to activate the order.
Source
Thrown at crates/adapters/dydx/src/execution/mod.rs:1468
client_metadata,
order.order_side(),
order
.price()
.ok_or_else(|| anyhow::anyhow!("Limit order missing price"))?,
order.quantity(),
order.time_in_force(),
order.is_post_only(),
order.is_reduce_only(),
block_height,
expire_time, // Uses default_short_term_expiry if configured
)?;
(msg, "limit")
}
// Conditional orders use their own expiration logic (not affected by default_short_term_expiry)
// They are always stored on-chain with long-term semantics
OrderType::StopMarket => {
let trigger_price = order.trigger_price().ok_or_else(|| {
anyhow::anyhow!("Stop market order missing trigger_price")
})?;
let cond_expire = order.expire_time().map(nanos_to_secs_i64);
let msg = order_builder.build_stop_market_order(
instrument_id,
client_id_u32,
client_metadata,
order.order_side(),
trigger_price,
order.quantity(),
order.is_reduce_only(),
cond_expire,
)?;
(msg, "stop_market")
}
OrderType::StopLimit => {
let trigger_price = order.trigger_price().ok_or_else(|| {
anyhow::anyhow!("Stop limit order missing trigger_price")
})?;View on GitHub (pinned to 18893faf8b)
Solutions
- Set trigger_price when creating the StopMarket order (order_factory.stop_market(..., trigger_price=...))
- Validate trigger_price is present before submit
- Confirm the order type mapping: Nautilus StopMarket requires a trigger on dYdX
Example fix
// before let order = factory.stop_market(id, side, qty, None); // no trigger // after let order = factory.stop_market(id, side, qty, Some(trigger_price));
Defensive patterns
Strategy: validation
Validate before calling
if order.order_type() == OrderType::StopMarket && order.trigger_price().is_none() {
return Err("StopMarket order requires a trigger_price for dYdX".into());
} Type guard
fn has_trigger(order: &OrderAny) -> bool { order.trigger_price().is_some() } Try / catch
if let Err(e) = client.submit_order(order).await {
if e.to_string().contains("missing trigger_price") {
// fix the order construction; retrying will not help
}
} Prevention
- Set trigger_price in every conditional-order factory call
- Maintain a checklist mapping Nautilus order types to dYdX required fields (Stop*/*IfTouched need triggers)
- Validate order fields at strategy level before enqueueing submits
When it happens
Trigger: Submitting a StopMarket order where trigger_price was never set on the Nautilus order (factory call omitted trigger_price, or the order type was changed from a plain market order).
Common situations: Order factory call missing the trigger_price parameter; converting an existing market order to stop-market without adding a trigger; deserialized/edited orders missing the 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 order missing trigger_price
- Stop limit order missing limit price
- Take profit market order missing trigger_price
- Take profit limit order missing trigger_price
- Execution PostOnly not supported for {order_type:?}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/bd55abd130acbd27.
Report an issue: GitHub.