nautechsystems/nautilus_trader · error · anyhow::Error
LIMIT order requires a price
Error message
LIMIT order requires a price
What it means
This error is raised by `build_order_configuration` when a `LIMIT` order is submitted without a `price`. A limit order is meaningless without a limit price, and Coinbase's `LimitGtc`/`LimitGtd`/`LimitFok` payloads require `limit_price`, so the adapter fails fast rather than sending a malformed request. It typically indicates the submit request was constructed as LIMIT but its price field was None.
Source
Thrown at crates/adapters/coinbase/src/http/client.rs:1651
match time_in_force {
TimeInForce::Ioc | TimeInForce::Gtc => {
Ok(OrderConfiguration::MarketIoc(MarketIoc {
market_market_ioc: params,
}))
}
TimeInForce::Fok => Ok(OrderConfiguration::MarketFok(MarketFok {
market_market_fok: params,
})),
_ => {
anyhow::bail!(
"Unsupported TIF {time_in_force} for MARKET on Coinbase (use IOC or FOK)"
)
}
}
}
OrderType::Limit => {
let limit_price =
price.ok_or_else(|| anyhow::anyhow!("LIMIT order requires a price"))?;
match time_in_force {
TimeInForce::Gtc => Ok(OrderConfiguration::LimitGtc(LimitGtc {
limit_limit_gtc: LimitGtcParams {
base_size: qty,
limit_price,
post_only,
},
})),
TimeInForce::Gtd => {
let expire = expire_time
.ok_or_else(|| anyhow::anyhow!("GTD LIMIT requires expire_time"))?;
Ok(OrderConfiguration::LimitGtd(LimitGtd {
limit_limit_gtd: LimitGtdParams {
base_size: qty,
limit_price,
end_time: format_rfc3339_from_nanos(expire)?,
post_only,View on GitHub (pinned to 18893faf8b)
Solutions
- Provide a valid limit `Price` when constructing the LIMIT order/request.
- Check the strategy/order-factory code path to ensure price is populated for LIMIT orders.
- Validate before submission: reject LIMIT requests with no price early with a clearer message.
- If the order was meant to be MARKET, change the order type instead of leaving price unset.
Example fix
// before
let order = factory.limit(instrument_id, Buy, qty); // price never set
// after
let price = Price::from("65000.00");
let order = factory.limit(instrument_id, Buy, qty, price, TimeInForce::Gtc); Defensive patterns
Strategy: validation
Validate before calling
fn validate_limit_request(order_type: OrderType, price: Option<Price>) -> Result<(), String> {
match order_type {
OrderType::Limit if price.is_none() => Err("LIMIT order requires a price".into()),
_ => Ok(()),
}
} Try / catch
match build_order_configuration(OrderType::Limit, side, qty, price, None, tif, None, post_only, false, false) {
Ok(config) => submit(config),
Err(e) if e.to_string().contains("requires a price") => {
tracing::error!("limit order submitted without price; fix order construction");
Err(e)
}
Err(e) => return Err(e),
} Prevention
- Always set a price for LIMIT/STOP_LIMIT orders at the order-factory level.
- Add pre-submit validation of required fields per order type.
- Use typed builders that force a price for limit orders.
- Add unit tests asserting limit orders carry a price.
When it happens
Trigger: Submitting a LIMIT order where the price parameter is None — e.g. a strategy building a limit order without specifying price, or a generic order factory that leaves price unset, with any TIF (GTC/GTD/FOK).
Common situations: Strategy bugs where the limit price is computed but never passed into the order request; converting market-order code paths to limit without adding a price; serialization round-trips dropping an unset 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
- GTD LIMIT requires expire_time
- {:?} orders require a trigger_price
- {FAILED}: {e}
- {FAILED}: {e}
- {FAILED}: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/11e0c67c1e4d2b9e.
Report an issue: GitHub.