{"record":{"id":"b05bdbef60390af6","repo":"nautechsystems/nautilus_trader","slug":"modify-order-requires-a-price-none-on-order-or-co","errorCode":null,"errorMessage":"modify_order requires a price (none on order or command)","messagePattern":"modify_order requires a price \\(none on order or command\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":1972,"sourceCode":"        // acceptable `price` cap, derived from the trigger and slippage like submit.\n        let price_ticks = match order.order_type() {\n            OrderType::StopMarket | OrderType::MarketIfTouched => {\n                let trigger = new_trigger.ok_or_else(|| {\n                    anyhow::anyhow!(\"{:?} orders require a trigger_price\", order.order_type())\n                })?;\n                let is_buy = matches!(order.order_side(), OrderSide::Buy);\n                let slippage_bps = self.resolve_slippage_bps(cmd.params.as_ref());\n\n                derive_market_order_price_ticks(\n                    trigger.as_decimal(),\n                    is_buy,\n                    price_precision,\n                    slippage_bps,\n                )?\n            }\n            _ => {\n                let new_price = cmd.price.or(order.price()).ok_or_else(|| {\n                    anyhow::anyhow!(\"modify_order requires a price (none on order or command)\")\n                })?;\n\n                price_to_ticks(&new_price, price_precision)?\n            }\n        };\n\n        let base_amount = quantity_to_ticks(&new_qty, instrument.size_precision())?;\n        anyhow::ensure!(\n            base_amount > 0,\n            \"quantity `{new_qty}` rounds to 0 ticks at size_precision {}\",\n            instrument.size_precision(),\n        );\n        let trigger_price_ticks = match new_trigger {\n            Some(trigger) if trigger.raw != 0 => price_to_ticks(&trigger, price_precision)?,\n            _ => 0,\n        };\n\n        if matches!(","sourceCodeStart":1954,"sourceCodeEnd":1990,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L1954-L1990","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nlet cmd = ModifyOrder::new(instrument_id, client_order_id).quantity(Some(new_qty));\n// after\nlet cmd = ModifyOrder::new(instrument_id, client_order_id)\n    .quantity(Some(new_qty))\n    .price(Some(order.price().unwrap()));","handlingStrategy":"validation","validationCode":"if cmd.price.is_none() && order.price().is_none() {\n    return Err(\"modify needs a price: set cmd.price or use an order with a limit price\".into());\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = client.modify_order(&cmd).await {\n    if e.to_string().contains(\"requires a price\") {\n        let cmd = cmd.with_price(order.price().expect(\"order has no price\"));\n        client.modify_order(&cmd).await?;\n    }\n}","preventionTips":["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."],"tags":["price","limit-order","modify-order","lighter"],"backgroundTag":"missing-required-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}