nautechsystems/nautilus_trader · error · anyhow::Error
STOP_LIMIT order requires trigger_price
Error message
STOP_LIMIT order requires trigger_price
What it means
A STOP_LIMIT order on Coinbase needs both the limit price and the stop (trigger) price. This guard fires when the order carries a limit price but its trigger_price field is missing. The adapter cannot construct any Coinbase stop-limit configuration without the stop price, so it bails before the HTTP request.
Source
Thrown at crates/adapters/coinbase/src/http/client.rs:1686
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
.ok_or_else(|| anyhow::anyhow!("GTD STOP_LIMIT requires expire_time"))?;
Ok(OrderConfiguration::StopLimitGtd(StopLimitGtd {View on GitHub (pinned to 18893faf8b)
Solutions
- Provide the trigger price when constructing the StopLimit order (factory trigger_price argument).
- Double-check the order instance passed to the adapter has trigger_price set, not just price.
- If no trigger is desired, the order is a plain LIMIT, not STOP_LIMIT — change the order type.
Example fix
// before
let order = factory.stop_limit(instrument.id(), side, qty, limit_price, /* trigger missing */);
// after
let order = factory.stop_limit(
instrument.id(),
side,
qty,
limit_price,
trigger_price, // required for STOP_LIMIT
); Defensive patterns
Strategy: validation
Validate before calling
fn ensure_stop_limit_trigger(order: &OrderRequest) -> Result<(), String> {
if order.order_type == OrderType::StopLimit && order.trigger_price.is_none() {
return Err(format!("{}: STOP_LIMIT requires trigger_price", order.client_order_id));
}
Ok(())
}
ensure_stop_limit_trigger(&req)?; Type guard
fn has_trigger(o: &OrderRequest) -> bool { matches!(o.order_type, OrderType::StopLimit) && o.trigger_price.is_some() } Prevention
- Pass trigger_price explicitly in every stop-limit factory call.
- Centralize order construction so required fields per order type are enforced in one place.
- Don't derive stop-limit orders by mutating LIMIT orders.
When it happens
Trigger: Submitting OrderType::StopLimit where the order's trigger_price is None; building the order with price set but trigger left unset; order factory invocation that omits the trigger_price/stop price argument.
Common situations: Confusing the adapter's trigger semantics with other venues that call it stop_price and forget to pass it; refactoring order construction and dropping the trigger parameter; copying a LIMIT order construction and adding only an order type change.
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
- Unsupported `OrderSide` for Binance: {value:?}
- Unsupported time in force: {:?}, AX supports GTC, IOC, and D
- Market-if-touched orders require a trigger price
- Limit-if-touched orders require a trigger price
- No order, orderTrigger, or orderPriorExecution data in event
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/afa3f78e03460fa8.
Report an issue: GitHub.