nautechsystems/nautilus_trader · error

Trigger/conditional orders ({order_type:?}) are not supporte

Error message

Trigger/conditional orders ({order_type:?}) are not supported for OKX options

What it means

Conditional/trigger (algo) orders are not supported for OKX options in this adapter. When the order type is conditional and the instrument resolves to `OKXInstrumentType::Option`, `submit_order_route` bails rather than routing to the algo HTTP endpoint. The adapter only routes conditional orders via `OrderCommandRoute::AlgoHttp` for non-option, non-spread instruments.

Source

Thrown at crates/adapters/okx/src/execution.rs:651

    fn is_conditional_order(&self, order_type: OrderType) -> bool {
        OKX_CONDITIONAL_ORDER_TYPES.contains(&order_type)
    }

    fn submit_order_route(
        &self,
        instrument_id: InstrumentId,
        order_type: OrderType,
    ) -> anyhow::Result<OrderCommandRoute> {
        if self.is_conditional_order(order_type) {
            if is_spread_instrument(instrument_id) {
                anyhow::bail!(
                    "Trigger/conditional orders ({order_type:?}) are not supported for OKX spreads"
                );
            }

            let inst_type = okx_instrument_type_from_symbol(instrument_id.symbol.as_str());
            if inst_type == OKXInstrumentType::Option {
                anyhow::bail!(
                    "Trigger/conditional orders ({order_type:?}) are not supported for OKX options"
                );
            }

            return Ok(OrderCommandRoute::AlgoHttp);
        }

        if is_spread_instrument(instrument_id) {
            Ok(OrderCommandRoute::SpreadHttp)
        } else {
            Ok(OrderCommandRoute::RegularWs)
        }
    }

    fn cancel_order_route(
        &self,
        instrument_id: InstrumentId,
        order_state: Option<(OrderType, Option<bool>)>,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Submit plain LIMIT/MARKET options orders and manage stop logic in the strategy itself.
  2. Hedge or protect the options position at the underlying (e.g. perp/futures) level with supported conditional orders.
  3. Check `okx_instrument_type_from_symbol` on your symbol to confirm you are not accidentally targeting an option.
Defensive patterns

Strategy: validation

Validate before calling

if is_conditional_order(order_type)
    && okx_instrument_type_from_symbol(instrument_id.symbol.as_str()) == OKXInstrumentType::Option {
    return Err(anyhow::anyhow!("Conditional orders unsupported for OKX options"));
}
client.submit_order(order)?;

Prevention

When it happens

Trigger: Calling `submit_order` with a conditional order type (`is_conditional_order` true, e.g. `StopMarket`, `LimitIfTouched`) where `okx_instrument_type_from_symbol(instrument_id.symbol)` is `OKXInstrumentType::Option`.

Common situations: Adding stop-loss protection to an options position on OKX; reusing an options strategy config that worked on another venue which supports options trigger orders.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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