{"record":{"id":"f47196c0e470a82b","repo":"nautechsystems/nautilus_trader","slug":"stop-limit-order-requires-a-price","errorCode":null,"errorMessage":"STOP_LIMIT order requires a price","messagePattern":"STOP_LIMIT order requires a price","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/http/client.rs","lineNumber":1684,"sourceCode":"                            base_size: qty,\n                            limit_price,\n                            end_time: format_rfc3339_from_nanos(expire)?,\n                            post_only,\n                        },\n                    }))\n                }\n                TimeInForce::Fok => Ok(OrderConfiguration::LimitFok(LimitFok {\n                    limit_limit_fok: LimitFokParams {\n                        base_size: qty,\n                        limit_price,\n                    },\n                })),\n                _ => anyhow::bail!(\"Unsupported TIF {time_in_force} for LIMIT on Coinbase\"),\n            }\n        }\n        OrderType::StopLimit => {\n            let limit_price =\n                price.ok_or_else(|| anyhow::anyhow!(\"STOP_LIMIT order requires a price\"))?;\n            let stop_price = trigger\n                .ok_or_else(|| anyhow::anyhow!(\"STOP_LIMIT order requires trigger_price\"))?;\n            let direction = match side {\n                OrderSide::Buy => CoinbaseStopDirection::StopUp,\n                OrderSide::Sell => CoinbaseStopDirection::StopDown,\n            };\n\n            match time_in_force {\n                TimeInForce::Gtc => Ok(OrderConfiguration::StopLimitGtc(StopLimitGtc {\n                    stop_limit_stop_limit_gtc: StopLimitGtcParams {\n                        base_size: qty,\n                        limit_price,\n                        stop_price,\n                        stop_direction: direction,\n                    },\n                })),\n                TimeInForce::Gtd => {\n                    let expire = expire_time","sourceCodeStart":1666,"sourceCodeEnd":1702,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/http/client.rs#L1666-L1702","documentation":"When submitting a STOP_LIMIT order to Coinbase through this adapter, both a limit price and a stop (trigger) price are mandatory. The adapter builds the Coinbase OrderConfiguration from the nautilus OrderType/price fields, and if the caller supplied a StopLimit order with no price set, it refuses to build the request rather than sending a malformed order. This is a fail-fast guard so an incomplete order never reaches the exchange.","triggerScenarios":"Calling submit_order (or the HTTP client order placement path) with OrderType::StopLimit while the order's price field is None/0-unset; constructing a StopLimit order without limit price; order factory defaults omitting price for stop-limit orders.","commonSituations":"Developers treat STOP_LIMIT like a pure STOP_MARKET and set only the trigger price; order factories built programmatically where the limit price is accidentally omitted; porting code from venues where stop-limit uses only a stop price.","solutions":["Set the limit price on the StopLimit order before submission (e.g. via the order factory with price parameter).","Verify the order type is what you intend; if only a trigger is needed, use OrderType::StopMarket instead.","Inspect the order object being passed to the adapter and confirm price is populated for STOP_LIMIT."],"exampleFix":"// before\nlet order = factory.stop_limit(... /* price omitted or None */);\n// after\nlet order = factory.stop_limit(\n    instrument.id(),\n    OrderSide::Buy,\n    Quantity::from(1),\n    Price::from_str(\"50000.00\")?, // limit price required\n    Price::from_str(\"49500.00\")?, // trigger price\n);","handlingStrategy":"validation","validationCode":"fn ensure_stop_limit_price(order: &OrderRequest) -> Result<(), String> {\n    if order.order_type == OrderType::StopLimit && order.price.is_none() {\n        return Err(format!(\"{}: STOP_LIMIT requires a price\", order.client_order_id));\n    }\n    Ok(())\n}\nensure_stop_limit_price(&req)?;","typeGuard":"fn has_price(o: &OrderRequest) -> bool { matches!(o.order_type, OrderType::StopLimit) && o.price.is_some() }","tryCatchPattern":null,"preventionTips":["Always create stop-limit orders through the order factory with both price and trigger_price.","Add a pre-submission validation helper that checks order-type-specific required fields.","Prefer StopMarket when a limit price is not needed."],"tags":["order-submission","validation","missing-price"],"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"}