nautechsystems/nautilus_trader · error

Limit order missing price

Error message

Limit order missing price

What it means

When submitting a LIMIT order to dYdX, the client reads the order's price via order.price(); dYdX limit orders require an explicit price. If the Nautilus order has no price set, the client throws this error instead of sending a malformed message to the exchange.

Source

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

                            instrument_id,
                            client_id_u32,
                            client_metadata,
                            order.order_side(),
                            order.quantity(),
                            order.is_reduce_only(),
                            block_height,
                        )?;
                        (msg, "market")
                    }
                    OrderType::Limit => {
                        let msg = order_builder.build_limit_order(
                            instrument_id,
                            client_id_u32,
                            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,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set a price when creating the limit order (e.g. order_factory.limit(..., price=Price(...)))
  2. Validate the order has a price before submitting
  3. Check that the correct order type/factory method is used for the intended order

Example fix

// before
let order = factory.limit(instrument_id, side, qty, None, tif); // price None
// after
let order = factory.limit(instrument_id, side, qty, Some(price), tif);
Defensive patterns

Strategy: validation

Validate before calling

if order.order_type() == OrderType::Limit && order.price().is_none() {
    return Err("Limit order must carry a price before submission to dYdX".into());
}

Type guard

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

Try / catch

if let Err(e) = client.submit_order(order).await {
    if e.to_string().contains("Limit order missing price") {
        // reject/repair the order locally instead of retrying
    }
}

Prevention

When it happens

Trigger: Calling submit_order/submit_order_list with a Limit order whose price was never set (order created without limit_px, or a market-style construction reused as limit).

Common situations: Building orders programmatically and forgetting limit_px; an order factory call where price defaulted to None; migrating code from market orders to limit orders without adding the price argument.

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