nautechsystems/nautilus_trader · error · anyhow::Error

STOP_LIMIT order requires a price

Error message

STOP_LIMIT order requires a price

What it means

When submitting a STOP_LIMIT order to Coinbase through this adapter, both a limit price and a stop (trigger) price are mandatory. The adapter builds the Coinbase OrderConfiguration from the nautilus OrderType/price fields, and if the caller supplied a StopLimit order with no price set, it refuses to build the request rather than sending a malformed order. This is a fail-fast guard so an incomplete order never reaches the exchange.

Source

Thrown at crates/adapters/coinbase/src/http/client.rs:1684

                            base_size: qty,
                            limit_price,
                            end_time: format_rfc3339_from_nanos(expire)?,
                            post_only,
                        },
                    }))
                }
                TimeInForce::Fok => Ok(OrderConfiguration::LimitFok(LimitFok {
                    limit_limit_fok: LimitFokParams {
                        base_size: qty,
                        limit_price,
                    },
                })),
                _ => anyhow::bail!("Unsupported TIF {time_in_force} for LIMIT on Coinbase"),
            }
        }
        OrderType::StopLimit => {
            let limit_price =
                price.ok_or_else(|| anyhow::anyhow!("STOP_LIMIT order requires a price"))?;
            let stop_price = trigger
                .ok_or_else(|| anyhow::anyhow!("STOP_LIMIT order requires trigger_price"))?;
            let direction = match side {
                OrderSide::Buy => CoinbaseStopDirection::StopUp,
                OrderSide::Sell => CoinbaseStopDirection::StopDown,
            };

            match time_in_force {
                TimeInForce::Gtc => Ok(OrderConfiguration::StopLimitGtc(StopLimitGtc {
                    stop_limit_stop_limit_gtc: StopLimitGtcParams {
                        base_size: qty,
                        limit_price,
                        stop_price,
                        stop_direction: direction,
                    },
                })),
                TimeInForce::Gtd => {
                    let expire = expire_time

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set the limit price on the StopLimit order before submission (e.g. via the order factory with price parameter).
  2. Verify the order type is what you intend; if only a trigger is needed, use OrderType::StopMarket instead.
  3. Inspect the order object being passed to the adapter and confirm price is populated for STOP_LIMIT.

Example fix

// before
let order = factory.stop_limit(... /* price omitted or None */);
// after
let order = factory.stop_limit(
    instrument.id(),
    OrderSide::Buy,
    Quantity::from(1),
    Price::from_str("50000.00")?, // limit price required
    Price::from_str("49500.00")?, // trigger price
);
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_stop_limit_price(order: &OrderRequest) -> Result<(), String> {
    if order.order_type == OrderType::StopLimit && order.price.is_none() {
        return Err(format!("{}: STOP_LIMIT requires a price", order.client_order_id));
    }
    Ok(())
}
ensure_stop_limit_price(&req)?;

Type guard

fn has_price(o: &OrderRequest) -> bool { matches!(o.order_type, OrderType::StopLimit) && o.price.is_some() }

Prevention

When it happens

Trigger: Calling submit_order (or the HTTP client order placement path) with OrderType::StopLimit while the order's price field is None/0-unset; constructing a StopLimit order without limit price; order factory defaults omitting price for stop-limit orders.

Common situations: Developers treat STOP_LIMIT like a pure STOP_MARKET and set only the trigger price; order factories built programmatically where the limit price is accidentally omitted; porting code from venues where stop-limit uses only a stop 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/f47196c0e470a82b. Report an issue: GitHub.