{"record":{"id":"8c0892527e7cd315","repo":"nautechsystems/nautilus_trader","slug":"unsupported-trigger-type-for-kraken-spot-ws-othe","errorCode":null,"errorMessage":"Unsupported trigger type for Kraken Spot WS: {other:?} (only LastPrice and IndexPrice supported)","messagePattern":"Unsupported trigger type for Kraken Spot WS: (.+?) \\(only LastPrice and IndexPrice supported\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/common/order_params.rs","lineNumber":113,"sourceCode":"        (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 limit_price = order.price().map(|p| p.as_decimal());\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: {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()));","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/common/order_params.rs#L95-L131","documentation":"For conditional orders, build_add_order_params maps Nautilus TriggerType to Kraken's trigger reference: IndexPrice -> 'index', LastPrice/Default/None -> 'last'. Any other TriggerType variant (e.g. MarkPrice, BidPrice, AskPrice) has no Kraken WS equivalent and bails with this message.","triggerScenarios":"Submitting a conditional order (StopMarket/StopLimit/MarketIfTouched/LimitIfTouched) via Kraken WS with trigger_type set to an unsupported variant such as MarkPrice, BidPrice, or AskPrice.","commonSituations":"Strategies that explicitly configure mark-price triggers (common on derivatives venues) run against Kraken Spot, whose WS API only supports last- and index-price triggers.","solutions":["Set the order's trigger_type to LastPrice, IndexPrice, or Default so it maps to a Kraken WS trigger reference.","If mark/bid/ask-price triggers are essential, execute the order via the Kraken REST path or a different venue.","Audit order-construction code that hardcodes TriggerType variants copied from other adapters."],"exampleFix":"// before\n.trigger_type(TriggerType::MarkPrice)\n// after\n.trigger_type(TriggerType::LastPrice) // or TriggerType::IndexPrice for Kraken Spot WS","handlingStrategy":"validation","validationCode":"if let Some(t) = order.trigger_type() {\n    if !matches!(t, TriggerType::LastPrice | TriggerType::IndexPrice | TriggerType::Default) {\n        // reject or remap before Kraken WS submission\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use LastPrice/IndexPrice trigger types for conditional orders on Kraken Spot.","Avoid copying trigger_type settings from derivatives venues (MarkPrice etc.).","Centralize trigger-type selection in venue-aware order factory configuration."],"tags":["rust","kraken","websocket","trigger-type","unsupported-enum-value"],"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"}