nautechsystems/nautilus_trader · error

Stop limit order missing limit price

Error message

Stop limit order missing limit price

What it means

For STOP_LIMIT orders, after the trigger_price check the client reads order.price() for the limit price; if absent it throws this error. dYdX stop-limit messages carry both a trigger and a limit price, so a limit price is mandatory.

Source

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

                        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,
                        )?;
                        (msg, "stop_limit")
                    }
                    // dYdX TakeProfitMarket maps to Nautilus MarketIfTouched

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set the limit price on the StopLimit order (factory price argument)
  2. Validate both prices before submit
  3. If a limit price is not meaningful for the strategy, use StopMarket instead

Example fix

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

Strategy: validation

Validate before calling

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

Type guard

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

Try / catch

if let Err(e) = client.submit_order(order).await {
    if e.to_string().contains("Stop limit order missing limit price") {
        // rebuild with a limit price, or switch to StopMarket
    }
}

Prevention

When it happens

Trigger: Submitting a StopLimit order with a trigger_price set but limit price None (e.g. factory call with price=None, or an order converted from StopMarket to StopLimit without adding a price).

Common situations: Constructing stop-limit orders where only the trigger was specified; pipeline that sets trigger programmatically but forgets the limit px; nil price from upstream strategy logic.

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/f7eaa75b8c5325d4. Report an issue: GitHub.