nautechsystems/nautilus_trader · error
Unsupported order type for Kraken WS batch: {ty:?}
Error message
Unsupported order type for Kraken WS batch: {ty:?} What it means
The Kraken Spot WS batch path maps a fixed set of Nautilus order types (Market, Limit, StopMarket, StopLimit, MarketIfTouched, LimitIfTouched) onto Kraken order types. Any other order type reaches the catch-all arm and bails with this error naming the unsupported type.
Source
Thrown at crates/adapters/kraken/src/execution/spot.rs:1018
anyhow::bail!(
"Trailing stop orders are not yet supported on the Kraken WS batch path; use REST",
);
}
if order.display_qty().is_some() {
anyhow::bail!(
"Iceberg (display_qty) orders are not supported on the Kraken WS batch path; use REST",
);
}
let kraken_order_type = match order_type {
OrderType::Market => KrakenOrderType::Market,
OrderType::Limit => KrakenOrderType::Limit,
OrderType::StopMarket => KrakenOrderType::StopLoss,
OrderType::StopLimit => KrakenOrderType::StopLossLimit,
OrderType::MarketIfTouched => KrakenOrderType::TakeProfit,
OrderType::LimitIfTouched => KrakenOrderType::TakeProfitLimit,
ty => anyhow::bail!("Unsupported order type for Kraken WS batch: {ty:?}"),
};
let is_limit_order = matches!(
order_type,
OrderType::Limit | OrderType::StopLimit | OrderType::LimitIfTouched
);
if is_limit_order && order.price().is_none() {
anyhow::bail!("limit_price is required for batch order type {order_type:?}");
}
let ws_tif =
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,
};
View on GitHub (pinned to 18893faf8b)
Solutions
- Resubmit the order with a supported type (Market, Limit, StopMarket, StopLimit, MarketIfTouched, LimitIfTouched)
- Send the unsupported order type via REST if Kraken's REST API supports it
- Exclude it from the WS batch and handle it on a separate path
Example fix
// before batch_add_via_ws(vec![market_to_limit_order]); // after let order = factory.limit(...); // or submit the original order via REST batch_add_via_ws(vec![order]);
Defensive patterns
Strategy: validation
Validate before calling
fn is_ws_batch_order_type(ty: OrderType) -> bool {
matches!(ty, OrderType::Market | OrderType::Limit | OrderType::StopMarket
| OrderType::StopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched)
}
if !is_ws_batch_order_type(order.order_type()) { submit_via_rest(order); } Type guard
fn ws_batch_supported(ty: OrderType) -> bool {
matches!(ty, OrderType::Market | OrderType::Limit | OrderType::StopMarket
| OrderType::StopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched)
} Try / catch
match batch_result {
Err(e) if e.to_string().contains("Unsupported order type") => {
log::warn!("order type not supported on WS batch; retrying via REST");
submit_via_rest(order)
}
r => r?,
} Prevention
- Restrict strategy order types to the venue-supported set when targeting Kraken Spot
- Route exotic order types to REST at the execution-client layer
- Add a pre-submission order-type check in the strategy or risk engine
When it happens
Trigger: Calling `batch_add_via_ws` with an order whose OrderType is not in the supported set — e.g. TrailingStopMarket/Limit are caught earlier, so this typically fires for types like MarketToLimit or other exotic order types.
Common situations: Batching mixed order types where a less-common type slips through; strategies written for venues with broader order-type support being ported to Kraken Spot.
Related errors
- Trailing stop orders are not yet supported on the Kraken WS
- Iceberg (display_qty) orders are not supported on the Kraken
- {FAILED}: {e}
- {FAILED}: {e}
- {FAILED}: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/8a469bf8e9d8cc64.
Report an issue: GitHub.