nautechsystems/nautilus_trader · error

Take profit limit order missing limit price

Error message

Take profit limit order missing limit price

What it means

This error is raised by the dYdX execution client when submitting a LimitIfTouched order (Nautilus's mapping of dYdX TakeProfitLimit) whose limit price is None. dYdX's take-profit limit order type requires both a trigger price and a limit price, so the client refuses to build the order without one.

Source

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

                        let msg = order_builder.build_take_profit_market_order(
                            instrument_id,
                            client_id_u32,
                            client_metadata,
                            order.order_side(),
                            trigger_price,
                            order.quantity(),
                            order.is_reduce_only(),
                            cond_expire,
                        )?;
                        (msg, "take_profit_market")
                    }
                    // dYdX TakeProfitLimit maps to Nautilus LimitIfTouched
                    OrderType::LimitIfTouched => {
                        let trigger_price = order.trigger_price().ok_or_else(|| {
                            anyhow::anyhow!("Take profit limit order missing trigger_price")
                        })?;
                        let limit_price = order.price().ok_or_else(|| {
                            anyhow::anyhow!("Take profit limit order missing limit price")
                        })?;
                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);
                        let msg = order_builder.build_take_profit_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, "take_profit_limit")
                    }
                    _ => unreachable!("Order type already validated"),

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Pass a limit price when creating the order: OrderFactory.limit_if_touched(instrument_id, OrderSide.BUY, qty, price=limit_px, trigger_price=trigger_px).
  2. Verify with order.price (Python) before submitting; only use LimitIfTouched when both trigger and limit prices are set.
  3. If you do not want a limit price, submit a MarketIfTouched order instead (dYdX maps that to a market-type take profit).
  4. Check the instrument's tick size and round the limit price before submission.

Example fix

// before: LimitIfTouched built without price -> error at submit
// let order = factory.limit_if_touched(instrument_id, OrderSide::Buy, qty, None, Some(trigger_px), ...);
// after
let order = factory.limit_if_touched(instrument_id, OrderSide::Buy, qty, Some(limit_px), Some(trigger_px), ...);
Defensive patterns

Strategy: validation

Validate before calling

if order.order_type() == OrderType::LimitIfTouched {
    assert!(order.trigger_price().is_some(), "LIT order missing trigger price");
    assert!(order.price().is_some(), "LIT order missing limit price");
}

Type guard

fn has_required_prices(order: &dyn Order) -> bool {
    order.trigger_price().is_some() && order.price().is_some()
}

Prevention

When it happens

Trigger: Calling ExecutionClient.submit_order (directly or via submit_order_list) with an order of type LimitIfTouched that was created without a price (order.price() returns None), while its trigger_price is present.

Common situations: Constructing a LimitIfTouched order in Python/Nautilus without passing price=...; copying an order-building snippet from a MarketIfTouched order (which has no limit price) and switching the type to LimitIfTouched; a strategy that sets trigger_price programmatically but forgets the limit price.

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