nautechsystems/nautilus_trader · error
modify_order requires a price (none on order or command)
Error message
modify_order requires a price (none on order or command)
What it means
For non-market-style orders (limits, stop-limits, etc.) Lighter requires an explicit limit price in ticks on a modify. The adapter looks for the price on the ModifyOrder command first, then falls back to the order's own price; if both are absent it cannot build the modify.
Source
Thrown at crates/adapters/lighter/src/execution.rs:1972
// acceptable `price` cap, derived from the trigger and slippage like submit.
let price_ticks = match order.order_type() {
OrderType::StopMarket | OrderType::MarketIfTouched => {
let trigger = new_trigger.ok_or_else(|| {
anyhow::anyhow!("{:?} orders require a trigger_price", order.order_type())
})?;
let is_buy = matches!(order.order_side(), OrderSide::Buy);
let slippage_bps = self.resolve_slippage_bps(cmd.params.as_ref());
derive_market_order_price_ticks(
trigger.as_decimal(),
is_buy,
price_precision,
slippage_bps,
)?
}
_ => {
let new_price = cmd.price.or(order.price()).ok_or_else(|| {
anyhow::anyhow!("modify_order requires a price (none on order or command)")
})?;
price_to_ticks(&new_price, price_precision)?
}
};
let base_amount = quantity_to_ticks(&new_qty, instrument.size_precision())?;
anyhow::ensure!(
base_amount > 0,
"quantity `{new_qty}` rounds to 0 ticks at size_precision {}",
instrument.size_precision(),
);
let trigger_price_ticks = match new_trigger {
Some(trigger) if trigger.raw != 0 => price_to_ticks(&trigger, price_precision)?,
_ => 0,
};
if matches!(View on GitHub (pinned to 18893faf8b)
Solutions
- Include price in the ModifyOrder command (cmd.price = Some(current or new price)).
- Ensure the original order was created with a limit price so order.price() is populated.
- If the order is truly market-style, expect the trigger_price branch instead and supply trigger_price.
Example fix
// before
let cmd = ModifyOrder::new(instrument_id, client_order_id).quantity(Some(new_qty));
// after
let cmd = ModifyOrder::new(instrument_id, client_order_id)
.quantity(Some(new_qty))
.price(Some(order.price().unwrap())); Defensive patterns
Strategy: validation
Validate before calling
if cmd.price.is_none() && order.price().is_none() {
return Err("modify needs a price: set cmd.price or use an order with a limit price".into());
} Try / catch
if let Err(e) = client.modify_order(&cmd).await {
if e.to_string().contains("requires a price") {
let cmd = cmd.with_price(order.price().expect("order has no price"));
client.modify_order(&cmd).await?;
}
} Prevention
- Populate price on every limit-order modify command explicitly.
- Reject order creation without a price for limit types at strategy level.
- Keep price fields as Decimal end-to-end to avoid dropping them in conversions.
When it happens
Trigger: prepare_signed_modify_order reaches the non-market branch (order_type not StopMarket/MarketIfTouched) with cmd.price = None and order.price() = None — typically a market-typed order being routed through the modify path, or a limit order created without a price.
Common situations: Modifying only the quantity of a limit order but the order object was built without a persisted price; passing a ModifyOrder with quantity-only updates to a venue that always resends the full price; mixing up market and limit order types.
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
- price decimals {decimals} exceeds maximum {MAX_DECIMALS}
- Lighter execution client cannot modify without credentials
- IncompleteOrderReports { reports, detail: detail.into() }
- Limit order must have a price
- missing positive trigger_price for Binance algo order type {
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/b05bdbef60390af6.
Report an issue: GitHub.