nautechsystems/nautilus_trader · error

Unsupported trigger type for Kraken Spot WS batch: {other:?}

Error message

Unsupported trigger type for Kraken Spot WS batch: {other:?} (only LastPrice and IndexPrice supported)

What it means

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.

Source

Thrown at crates/adapters/kraken/src/execution/spot.rs:1049

        compute_ws_time_in_force(is_limit_order, order.time_in_force(), order.expire_time())?;
    let expire_time = match (ws_tif, order.expire_time()) {
        (Some(KrakenTimeInForce::GoodTilDate), Some(ts)) => Some(format_expire_time(ts)),
        _ => None,
    };

    let is_conditional = matches!(
        order_type,
        OrderType::StopMarket
            | OrderType::StopLimit
            | OrderType::MarketIfTouched
            | OrderType::LimitIfTouched
    );

    let trigger = if is_conditional {
        let trigger_ref = match order.trigger_type() {
            Some(TriggerType::IndexPrice) => KrakenSpotTrigger::Index,
            Some(TriggerType::LastPrice | TriggerType::Default) | None => KrakenSpotTrigger::Last,
            Some(other) => anyhow::bail!(
                "Unsupported trigger type for Kraken Spot WS batch: {other:?} (only LastPrice and IndexPrice supported)",
            ),
        };
        order.trigger_price().map(|tp| KrakenWsTriggerParams {
            reference: trigger_ref,
            price: tp.as_decimal(),
            price_type: None,
        })
    } else {
        None
    };

    if is_conditional && trigger.is_none() {
        anyhow::bail!(
            "Conditional order type {order_type:?} requires trigger_price for Kraken WS batch",
        );
    }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Change the order's trigger type to TriggerType::LastPrice (or Default/None) or TriggerType::IndexPrice.
  2. Submit the order via a non-batch path that supports the trigger type, if available.
  3. Normalize unsupported trigger types to LastPrice before building the batch order.

Example fix

// before
order_builder.trigger_type(TriggerType::MarkPrice)
// after
order_builder.trigger_type(TriggerType::LastPrice)
Defensive patterns

Strategy: validation

Validate before calling

fn trigger_supported(tt: Option<TriggerType>) -> bool {
    matches!(tt, None | Some(TriggerType::Default) | Some(TriggerType::LastPrice) | Some(TriggerType::IndexPrice))
}

Type guard

fn is_kraken_spot_trigger(tt: TriggerType) -> bool {
    matches!(tt, TriggerType::IndexPrice | TriggerType::LastPrice | TriggerType::Default)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/113d685b29796fec. Report an issue: GitHub.