nautechsystems/nautilus_trader · error

Unsupported order type: {order_type:?}

Error message

Unsupported order type: {order_type:?}

What it means

build_send_order_params maps Nautilus OrderTypes to Kraken Futures order kinds; the trailing catch-all bails for any order type without a Kraken Futures mapping (e.g. trailing-stop variants not representable on the venue). This guards against silently sending a wrong order kind.

Source

Thrown at crates/adapters/kraken/src/http/futures/client.rs:1964

                    KrakenFuturesOrderType::Post
                } else {
                    match time_in_force {
                        TimeInForce::Ioc => KrakenFuturesOrderType::Ioc,
                        TimeInForce::Fok => {
                            anyhow::bail!("FOK not supported by Kraken Futures, use IOC instead")
                        }
                        TimeInForce::Gtd => {
                            anyhow::bail!("GTD not supported by Kraken Futures, use GTC instead")
                        }
                        _ => KrakenFuturesOrderType::Limit, // GTC is default
                    }
                }
            }
            OrderType::StopMarket | OrderType::StopLimit => KrakenFuturesOrderType::Stop,
            OrderType::MarketIfTouched | OrderType::LimitIfTouched => {
                KrakenFuturesOrderType::TakeProfit
            }
            _ => anyhow::bail!("Unsupported order type: {order_type:?}"),
        };

        let kraken_side = KrakenOrderSide::from(order_side);

        let mut builder = KrakenFuturesSendOrderParamsBuilder::default();
        builder
            .cli_ord_id(truncate_cl_ord_id(&client_order_id))
            .broker(NAUTILUS_KRAKEN_BROKER_ID)
            .symbol(raw_symbol)
            .side(kraken_side)
            .size(quantity.to_string())
            .order_type(kraken_order_type);

        if matches!(
            order_type,
            OrderType::StopMarket
                | OrderType::StopLimit
                | OrderType::MarketIfTouched

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Use a supported order type: Limit, Market, StopMarket, StopLimit, MarketIfTouched, or LimitIfTouched.
  2. Emulate trailing behavior client-side by amending Stop orders as the price moves.
  3. Add venue-specific configuration that disables unsupported order types for Kraken Futures.

Example fix

// before
OrderBuilder::trailing_stop_market(...).build()
// after
OrderBuilder::stop_market(...).build()
Defensive patterns

Strategy: validation

Validate before calling

fn order_type_futures_supported(t: OrderType) -> bool {
    matches!(t, OrderType::Limit | OrderType::Market | OrderType::StopMarket | OrderType::StopLimit | OrderType::MarketIfTouched | OrderType::LimitIfTouched)
}

Prevention

When it happens

Trigger: Calling submit_order or send_order_batches with an order type that falls into the `_` arm — e.g. TrailingStopMarket, TrailingStopLimit — on the Kraken Futures adapter.

Common situations: Multi-venue strategies using trailing stops enabled on venues that support them; defaults in strategy config not specialized per venue.

Related errors


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