{"record":{"id":"f005666bf3f33547","repo":"nautechsystems/nautilus_trader","slug":"trailing-stop-orders-are-not-yet-supported-on-the","errorCode":null,"errorMessage":"Trailing stop orders are not yet supported on the Kraken WS path; use REST","messagePattern":"Trailing stop orders are not yet supported on the Kraken WS path; use REST","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/order_params.rs","lineNumber":65,"sourceCode":"    cmd: &SubmitOrder,\n    order: &OrderAny,\n    token: SecretString,\n    leverage: Option<u16>,\n) -> anyhow::Result<KrakenWsAddOrderParams> {\n    let order_type = order.order_type();\n    let order_side = order.order_side();\n    let time_in_force = order.time_in_force();\n\n    let side = match order_side {\n        OrderSide::Buy => KrakenOrderSide::Buy,\n        OrderSide::Sell => KrakenOrderSide::Sell,\n    };\n\n    if matches!(\n        order_type,\n        OrderType::TrailingStopMarket | OrderType::TrailingStopLimit\n    ) {\n        anyhow::bail!(\"Trailing stop orders are not yet supported on the Kraken WS path; use REST\",);\n    }\n\n    if order.display_qty().is_some() {\n        anyhow::bail!(\n            \"Iceberg (display_qty) orders are not supported on the Kraken WS path; use REST\"\n        );\n    }\n\n    let kraken_order_type = match order_type {\n        OrderType::Market => KrakenOrderType::Market,\n        OrderType::Limit => KrakenOrderType::Limit,\n        OrderType::StopMarket => KrakenOrderType::StopLoss,\n        OrderType::StopLimit => KrakenOrderType::StopLossLimit,\n        OrderType::MarketIfTouched => KrakenOrderType::TakeProfit,\n        OrderType::LimitIfTouched => KrakenOrderType::TakeProfitLimit,\n        _ => anyhow::bail!(\"Unsupported order type for Kraken WS: {order_type:?}\"),\n    };\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/order_params.rs#L47-L83","documentation":"build_add_order_params converts a Nautilus order command into Kraken Spot WS v2 addOrder parameters. Trailing stop orders (TrailingStopMarket/TrailingStopLimit) have no supported mapping on the WS path yet, so the builder explicitly bails and directs users to the Kraken REST execution path.","triggerScenarios":"Submitting an order of type TrailingStopMarket or TrailingStopLimit through the Kraken WebSocket execution client (submit_via_ws -> build_add_order_params).","commonSituations":"A strategy config generates trailing-stop orders (e.g. trailing stop loss on positions) while the adapter's execution routing is set to WebSocket instead of REST.","solutions":["Route trailing stop orders through the Kraken REST execution path instead of the WS path.","Change the strategy to use plain StopMarket/StopLimit orders if WS execution is required.","Track adapter updates: WS support for trailing stops may be added later; feature-gate trailing stops off for Kraken WS until then."],"exampleFix":"// before\nexec_client.submit(order); // routed to WS, order type = TrailingStopMarket\n// after\nif matches!(order.order_type(), OrderType::TrailingStopMarket | OrderType::TrailingStopLimit) {\n    rest_exec_client.submit(order); // use REST adapter for trailing stops\n} else {\n    ws_exec_client.submit(order);\n}","handlingStrategy":"validation","validationCode":"if matches!(order.order_type(), OrderType::TrailingStopMarket | OrderType::TrailingStopLimit) {\n    // route to REST client or reject at strategy level before reaching WS\n}","typeGuard":null,"tryCatchPattern":"match ws_client.submit(order).await {\n    Err(e) if e.to_string().contains(\"Trailing stop orders are not yet supported\") => {\n        // fall back to REST execution or disable trailing stops\n    }\n    result => result?,\n}","preventionTips":["Feature-gate trailing stop order types off in strategy configs targeting Kraken WS.","Document per-venue order-type support in strategy config reviews.","Add a pre-trade filter that rejects unsupported order types per execution client."],"tags":["rust","kraken","websocket","unsupported-order-type"],"backgroundTag":"unsupported-operation","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"}