{"record":{"id":"113d685b29796fec","repo":"nautechsystems/nautilus_trader","slug":"unsupported-trigger-type-for-kraken-spot-ws-batch","errorCode":null,"errorMessage":"Unsupported trigger type for Kraken Spot WS batch: {other:?} (only LastPrice and IndexPrice supported)","messagePattern":"Unsupported trigger type for Kraken Spot WS batch: (.+?) \\(only LastPrice and IndexPrice supported\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/execution/spot.rs","lineNumber":1049,"sourceCode":"        compute_ws_time_in_force(is_limit_order, order.time_in_force(), order.expire_time())?;\n    let expire_time = match (ws_tif, order.expire_time()) {\n        (Some(KrakenTimeInForce::GoodTilDate), Some(ts)) => Some(format_expire_time(ts)),\n        _ => None,\n    };\n\n    let is_conditional = matches!(\n        order_type,\n        OrderType::StopMarket\n            | OrderType::StopLimit\n            | OrderType::MarketIfTouched\n            | OrderType::LimitIfTouched\n    );\n\n    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 batch: {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!(\n            \"Conditional order type {order_type:?} requires trigger_price for Kraken WS batch\",\n        );\n    }\n","sourceCodeStart":1031,"sourceCodeEnd":1067,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/execution/spot.rs#L1031-L1067","documentation":"Kraken Spot WS batch conditional orders only support trigger references of LastPrice or IndexPrice. The adapter maps TriggerType::IndexPrice to Index and LastPrice/Default (or absent) to Last; any other trigger type is rejected with this bail. This reflects Kraken's WS batch API surface, not a bug.","triggerScenarios":"Calling batch_add_via_ws with a conditional order (stop-limit etc.) whose trigger_type() is Some(TriggerType::MarkPrice) or another non-supported variant like bid/ask price triggers.","commonSituations":"Porting futures or FX adapter code that uses mark-price triggers to the Kraken Spot batch endpoint; defaulting trigger types from a shared order model that includes MarkPrice.","solutions":["Change the order's trigger type to TriggerType::LastPrice (or Default/None) or TriggerType::IndexPrice.","Submit the order via a non-batch path that supports the trigger type, if available.","Normalize unsupported trigger types to LastPrice before building the batch order."],"exampleFix":"// before\norder_builder.trigger_type(TriggerType::MarkPrice)\n// after\norder_builder.trigger_type(TriggerType::LastPrice)","handlingStrategy":"validation","validationCode":"fn trigger_supported(tt: Option<TriggerType>) -> bool {\n    matches!(tt, None | Some(TriggerType::Default) | Some(TriggerType::LastPrice) | Some(TriggerType::IndexPrice))\n}","typeGuard":"fn is_kraken_spot_trigger(tt: TriggerType) -> bool {\n    matches!(tt, TriggerType::IndexPrice | TriggerType::LastPrice | TriggerType::Default)\n}","tryCatchPattern":null,"preventionTips":["Constrain trigger types per venue in strategy config.","Translate MarkPrice triggers to LastPrice for Kraken Spot before submission.","Document Kraken Spot batch trigger limitations in your order-emitter code."],"tags":["kraken","orders","trigger","unsupported"],"backgroundTag":"unsupported-enum-value","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"}