{"record":{"id":"f180c1da7728a8d1","repo":"nautechsystems/nautilus_trader","slug":"trigger-price-is-required-for-conditional-order-ty","errorCode":null,"errorMessage":"trigger_price is required for conditional order type {order_type:?}","messagePattern":"trigger_price is required for conditional order type (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/order_params.rs","lineNumber":127,"sourceCode":"    let trigger = if is_conditional {\n        let trigger_ref = match order.trigger_type() {\n            Some(TriggerType::IndexPrice) => KrakenSpotTrigger::Index,\n            Some(TriggerType::LastPrice | TriggerType::Default) | None => KrakenSpotTrigger::Last,\n            Some(other) => anyhow::bail!(\n                \"Unsupported trigger type for Kraken Spot WS: {other:?} (only LastPrice and IndexPrice supported)\",\n            ),\n        };\n        order.trigger_price().map(|tp| KrakenWsTriggerParams {\n            reference: trigger_ref,\n            price: tp.as_decimal(),\n            price_type: None,\n        })\n    } else {\n        None\n    };\n\n    if is_conditional && trigger.is_none() {\n        anyhow::bail!(\"trigger_price is required for conditional order type {order_type:?}\");\n    }\n\n    let symbol = cmd.instrument_id.symbol.inner().to_string();\n    let cl_ord_id = Some(truncate_cl_ord_id(&order.client_order_id()));\n    let post_only = order.is_post_only().then_some(true);\n    let reduce_only = order.is_reduce_only().then_some(true);\n\n    Ok(KrakenWsAddOrderParams {\n        order_type: kraken_order_type,\n        side,\n        order_qty: order.quantity().as_decimal(),\n        symbol,\n        token,\n        limit_price,\n        time_in_force: ws_tif,\n        expire_time,\n        cl_ord_id,\n        post_only,","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/order_params.rs#L109-L145","documentation":"Conditional order types on Kraken WS require a trigger price to build KrakenWsTriggerParams. If the order is conditional but order.trigger_price() is None, the resulting trigger struct is None and the builder bails with this message.","triggerScenarios":"Submitting a StopMarket/StopLimit/MarketIfTouched/LimitIfTouched order via Kraken WS without a trigger price set on the order (trigger.is_none() while is_conditional is true).","commonSituations":"Order built without the trigger_price argument, trigger price computation returning None/zero and being skipped, or converting a plain order into a conditional one without adding the trigger.","solutions":["Pass a trigger_price when constructing the stop/conditional order in the order factory.","Validate before submission that conditional orders have both trigger_type and trigger_price set.","Fix any logic that clears or fails to populate the trigger price (e.g. defaulting to None on parse errors)."],"exampleFix":"// before\norder_factory.stop_market(instrument_id, OrderSide::Buy, qty) // no trigger price\n// after\norder_factory.stop_market(instrument_id, OrderSide::Buy, qty, Some(trigger_price))","handlingStrategy":"validation","validationCode":"const CONDITIONAL: &[OrderType] = &[OrderType::StopMarket, OrderType::StopLimit, OrderType::MarketIfTouched, OrderType::LimitIfTouched];\nif CONDITIONAL.contains(&order.order_type()) && order.trigger_price().is_none() {\n    return Err(anyhow::anyhow!(\"conditional order {} needs trigger_price\", order.order_type()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass trigger_price when creating stop/conditional orders.","Validate order invariants (conditional => trigger price present) before the submit call.","Add order-factory unit tests asserting conditional orders carry trigger prices."],"tags":["rust","kraken","websocket","missing-trigger-price","conditional-orders"],"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"}