{"record":{"id":"6686d03afd9652e0","repo":"nautechsystems/nautilus_trader","slug":"iceberg-display-qty-orders-are-not-supported-on-6686d0","errorCode":null,"errorMessage":"Iceberg (display_qty) orders are not supported on the Kraken WS batch path; use REST","messagePattern":"Iceberg \\(display_qty\\) orders are not supported on the Kraken WS batch path; use REST","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/execution/spot.rs","lineNumber":1006,"sourceCode":"    leverage: Option<u16>,\n) -> anyhow::Result<KrakenWsBatchAddOrder> {\n    let order_type = order.order_type();\n    let side = match order.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!(\n            \"Trailing stop orders are not yet supported on the Kraken WS batch path; use REST\",\n        );\n    }\n\n    if order.display_qty().is_some() {\n        anyhow::bail!(\n            \"Iceberg (display_qty) orders are not supported on the Kraken WS batch 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        ty => anyhow::bail!(\"Unsupported order type for Kraken WS batch: {ty:?}\"),\n    };\n\n    let is_limit_order = matches!(\n        order_type,\n        OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched\n    );","sourceCodeStart":988,"sourceCodeEnd":1024,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/execution/spot.rs#L988-L1024","documentation":"Iceberg orders (with a visible `display_qty`) are not supported on Kraken's WebSocket batch-order path, so `build_batch_order` rejects any order whose display_qty is set and directs the caller to REST.","triggerScenarios":"Calling `batch_add_via_ws` with an order that has `display_qty` populated (OrderFactory-created iceberg orders).","commonSituations":"Executing large parent orders as icebergs while the execution setup routes adds through the WS batch API; accidentally leaving display_qty set on an order template.","solutions":["Submit iceberg orders via REST instead of the WS batch path","Remove display_qty (submit the full quantity) if iceberg behavior is not required","Exclude the iceberg order from the batch and send it individually over REST"],"exampleFix":"// before\nlet order = factory.iceberg_limit(...display_qty...);\nbatch_add_via_ws(vec![order]);\n// after\nclient.submit_order_via_rest(order); // icebergs must go over REST","handlingStrategy":"validation","validationCode":"if order.display_qty().is_some() {\n    submit_via_rest(order); // icebergs unsupported on WS batch\n} else {\n    batch_add_via_ws(vec![order])?;\n}","typeGuard":"fn is_non_iceberg(order: &OrderAny) -> bool { order.display_qty().is_none() }","tryCatchPattern":"match batch_result {\n    Err(e) if e.to_string().contains(\"Iceberg\") => submit_via_rest(order),\n    r => r?,\n}","preventionTips":["Check display_qty before adding an order to a WS batch","Submit icebergs over REST only","Clear display_qty accidentally set by order templates when iceberg behavior is not intended"],"tags":["rust","kraken-spot","orders","batch","iceberg"],"backgroundTag":"operation-not-supported","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"}