nautechsystems/nautilus_trader · error

Stop limit order missing trigger_price

Error message

Stop limit order missing trigger_price

What it means

dYdX STOP_LIMIT conditional orders need both a trigger_price (activation) and a limit price (execution). The client first checks order.trigger_price(); if None it throws this error. Trigger and limit prices are sent as separate fields in the on-chain message.

Source

Thrown at crates/adapters/dydx/src/execution/mod.rs:1485

                        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")
                        })?;
                        let limit_price = order.price().ok_or_else(|| {
                            anyhow::anyhow!("Stop limit order missing limit price")
                        })?;
                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);
                        let msg = order_builder.build_stop_limit_order(
                            instrument_id,
                            client_id_u32,
                            client_metadata,
                            order.order_side(),
                            trigger_price,
                            limit_price,
                            order.quantity(),
                            order.time_in_force(),
                            order.is_post_only(),
                            order.is_reduce_only(),
                            cond_expire,
                        )?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Pass trigger_price to the stop_limit factory call
  2. Validate both trigger_price and price exist before submit
  3. Verify the order was built with the StopLimit factory method rather than mutated later

Example fix

// before
let order = factory.stop_limit(id, side, qty, price, None); // trigger missing
// after
let order = factory.stop_limit(id, side, qty, price, Some(trigger_price));
Defensive patterns

Strategy: validation

Validate before calling

if order.order_type() == OrderType::StopLimit {
    if order.trigger_price().is_none() {
        return Err("StopLimit order requires a trigger_price for dYdX".into());
    }
    if order.price().is_none() {
        return Err("StopLimit order requires a limit price for dYdX".into());
    }
}

Type guard

fn stop_limit_complete(order: &OrderAny) -> bool {
    order.trigger_price().is_some() && order.price().is_some()
}

Try / catch

if let Err(e) = client.submit_order(order).await {
    if e.to_string().contains("Stop limit order missing") {
        // rebuild the order with both trigger and limit prices
    }
}

Prevention

When it happens

Trigger: Submitting a StopLimit order whose trigger_price was never set (factory call omitted it, or plain Limit order converted to StopLimit).

Common situations: order_factory.stop_limit call missing trigger_price; editing an order's type without setting the trigger; restoring orders from persistence where the trigger field was dropped.

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


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/f94910a7794a429e. Report an issue: GitHub.