{"record":{"id":"4f1dfa143a657b47","repo":"nautechsystems/nautilus_trader","slug":"limit-order-missing-price-4f1dfa","errorCode":null,"errorMessage":"Limit order missing price","messagePattern":"Limit order missing price","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/dydx/src/execution/mod.rs","lineNumber":1454,"sourceCode":"                            instrument_id,\n                            client_id_u32,\n                            client_metadata,\n                            order.order_side(),\n                            order.quantity(),\n                            order.is_reduce_only(),\n                            block_height,\n                        )?;\n                        (msg, \"market\")\n                    }\n                    OrderType::Limit => {\n                        let msg = order_builder.build_limit_order(\n                            instrument_id,\n                            client_id_u32,\n                            client_metadata,\n                            order.order_side(),\n                            order\n                                .price()\n                                .ok_or_else(|| anyhow::anyhow!(\"Limit order missing price\"))?,\n                            order.quantity(),\n                            order.time_in_force(),\n                            order.is_post_only(),\n                            order.is_reduce_only(),\n                            block_height,\n                            expire_time, // Uses default_short_term_expiry if configured\n                        )?;\n                        (msg, \"limit\")\n                    }\n                    // Conditional orders use their own expiration logic (not affected by default_short_term_expiry)\n                    // They are always stored on-chain with long-term semantics\n                    OrderType::StopMarket => {\n                        let trigger_price = order.trigger_price().ok_or_else(|| {\n                            anyhow::anyhow!(\"Stop market order missing trigger_price\")\n                        })?;\n                        let cond_expire = order.expire_time().map(nanos_to_secs_i64);\n                        let msg = order_builder.build_stop_market_order(\n                            instrument_id,","sourceCodeStart":1436,"sourceCodeEnd":1472,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/execution/mod.rs#L1436-L1472","documentation":"When submitting a LIMIT order to dYdX, the client reads the order's price via order.price(); dYdX limit orders require an explicit price. If the Nautilus order has no price set, the client throws this error instead of sending a malformed message to the exchange.","triggerScenarios":"Calling submit_order/submit_order_list with a Limit order whose price was never set (order created without limit_px, or a market-style construction reused as limit).","commonSituations":"Building orders programmatically and forgetting limit_px; an order factory call where price defaulted to None; migrating code from market orders to limit orders without adding the price argument.","solutions":["Set a price when creating the limit order (e.g. order_factory.limit(..., price=Price(...)))","Validate the order has a price before submitting","Check that the correct order type/factory method is used for the intended order"],"exampleFix":"// before\nlet order = factory.limit(instrument_id, side, qty, None, tif); // price None\n// after\nlet order = factory.limit(instrument_id, side, qty, Some(price), tif);","handlingStrategy":"validation","validationCode":"if order.order_type() == OrderType::Limit && order.price().is_none() {\n    return Err(\"Limit order must carry a price before submission to dYdX\".into());\n}","typeGuard":"fn has_price(order: &OrderAny) -> bool { order.price().is_some() }","tryCatchPattern":"if let Err(e) = client.submit_order(order).await {\n    if e.to_string().contains(\"Limit order missing price\") {\n        // reject/repair the order locally instead of retrying\n    }\n}","preventionTips":["Always build limit orders via order_factory with an explicit price","Add a pre-submit validation step that checks required fields per order type","Cover each order type in unit tests asserting price/trigger presence"],"tags":["rust","orders","validation","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-14T05:17:10.506Z"}