{"record":{"id":"f7eaa75b8c5325d4","repo":"nautechsystems/nautilus_trader","slug":"stop-limit-order-missing-limit-price","errorCode":null,"errorMessage":"Stop limit order missing limit price","messagePattern":"Stop limit order missing limit price","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/dydx/src/execution/mod.rs","lineNumber":1488,"sourceCode":"                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);\n                        let msg = order_builder.build_stop_market_order(\n                            instrument_id,\n                            client_id_u32,\n                            client_metadata,\n                            order.order_side(),\n                            trigger_price,\n                            order.quantity(),\n                            order.is_reduce_only(),\n                            cond_expire,\n                        )?;\n                        (msg, \"stop_market\")\n                    }\n                    OrderType::StopLimit => {\n                        let trigger_price = order.trigger_price().ok_or_else(|| {\n                            anyhow::anyhow!(\"Stop limit order missing trigger_price\")\n                        })?;\n                        let limit_price = order.price().ok_or_else(|| {\n                            anyhow::anyhow!(\"Stop limit order missing limit price\")\n                        })?;\n                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);\n                        let msg = order_builder.build_stop_limit_order(\n                            instrument_id,\n                            client_id_u32,\n                            client_metadata,\n                            order.order_side(),\n                            trigger_price,\n                            limit_price,\n                            order.quantity(),\n                            order.time_in_force(),\n                            order.is_post_only(),\n                            order.is_reduce_only(),\n                            cond_expire,\n                        )?;\n                        (msg, \"stop_limit\")\n                    }\n                    // dYdX TakeProfitMarket maps to Nautilus MarketIfTouched","sourceCodeStart":1470,"sourceCodeEnd":1506,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/execution/mod.rs#L1470-L1506","documentation":"For STOP_LIMIT orders, after the trigger_price check the client reads order.price() for the limit price; if absent it throws this error. dYdX stop-limit messages carry both a trigger and a limit price, so a limit price is mandatory.","triggerScenarios":"Submitting a StopLimit order with a trigger_price set but limit price None (e.g. factory call with price=None, or an order converted from StopMarket to StopLimit without adding a price).","commonSituations":"Constructing stop-limit orders where only the trigger was specified; pipeline that sets trigger programmatically but forgets the limit px; nil price from upstream strategy logic.","solutions":["Set the limit price on the StopLimit order (factory price argument)","Validate both prices before submit","If a limit price is not meaningful for the strategy, use StopMarket instead"],"exampleFix":"// before\nlet order = factory.stop_limit(id, side, qty, None, Some(trigger)); // limit px missing\n// after\nlet order = factory.stop_limit(id, side, qty, Some(limit_price), Some(trigger));","handlingStrategy":"validation","validationCode":"if order.order_type() == OrderType::StopLimit && order.price().is_none() {\n    return Err(\"StopLimit order requires a limit price for dYdX\".into());\n}","typeGuard":"fn has_limit_price(order: &OrderAny) -> bool { order.price().is_some() }","tryCatchPattern":"if let Err(e) = client.submit_order(order).await {\n    if e.to_string().contains(\"Stop limit order missing limit price\") {\n        // rebuild with a limit price, or switch to StopMarket\n    }\n}","preventionTips":["Never pass None as the price to stop_limit factory calls","If no limit price is meaningful, use StopMarket instead","Validate both prices before submit in a shared pre-check"],"tags":["rust","orders","conditional-orders","dydx"],"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"}