nautechsystems/nautilus_trader · error

Unsupported time in force

Error message

Unsupported time in force: {:?}, AX supports GTC, IOC, and DAY

What it means

This error is raised locally by the Architect AX execution adapter when an order is submitted with a TimeInForce that AX does not support. AX only accepts GTC, IOC, and DAY; other values (e.g. GTD, FOK, ATK/FOK variants) are rejected before being sent, so the developer gets a clear local error instead of an opaque venue HTTP error.

Solutions

  1. Change the order's TimeInForce to GTC, IOC, or DAY before submitting
  2. If GTD semantics are needed, implement local cancellation/expiry logic with GTC plus your own timer
  3. Check the factory/order template defaults and set time_in_force explicitly

Example fix

// before
let order = order_factory.limit(market_id, OrderSide::Buy, qty, price, TimeInForce::Gtd, expire);
// after
let order = order_factory.limit(market_id, OrderSide::Buy, qty, price, TimeInForce::Gtc, None);
Defensive patterns

Strategy: validation

Validate before calling

const AX_SUPPORTED_TIF: [TimeInForce; 3] = [TimeInForce::Gtc, TimeInForce::Ioc, TimeInForce::Day];
if !AX_SUPPORTED_TIF.contains(&order.time_in_force()) {
    return Err(anyhow::anyhow!("order TIF {:?} not supported by AX", order.time_in_force()));
}

Type guard

fn is_ax_supported_tif(tif: TimeInForce) -> bool {
    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day)
}

Try / catch

match client.submit_order(&order).await {
    Err(e) if e.to_string().contains("Unsupported time in force") => {
        // fall back to GTC or surface a config error
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling submit_order (which runs validate_order_for_ax_submit) with an order whose time_in_force() is not TimeInForce::Gtc, TimeInForce::Ioc, or TimeInForce::Day — e.g. a GTD or FOK order.

Common situations: Porting strategies from other venues (crypto adapters commonly accept GTD/FOK) to AX; defaulting order factory TIF to Gtd or Fok; copying order templates from another adapter.

Related errors


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

Appendix: source

Thrown at crates/adapters/architect_ax/src/execution.rs:1962

        ts_init,
        Some(UUID4::new()),
    ))
}

fn validate_order_for_ax_submit(order: &OrderAny) -> anyhow::Result<()> {
    if !matches!(order.order_type(), OrderType::Market | OrderType::Limit) {
        anyhow::bail!(
            "Unsupported order type: {:?}, the Architect AX adapter accepts Nautilus MARKET and LIMIT orders",
            order.order_type(),
        );
    }

    // AX accepts only GTC, IOC, and DAY; deny others locally to avoid an opaque venue error
    if !matches!(
        order.time_in_force(),
        TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day
    ) {
        anyhow::bail!(
            "Unsupported time in force: {:?}, AX supports GTC, IOC, and DAY",
            order.time_in_force(),
        );
    }

    validate_order_instructions(
        order.is_reduce_only(),
        order.is_quote_quantity(),
        order.display_qty().is_some(),
    )?;

    quantity_to_contracts(order.quantity())?;

    Ok(())
}

fn validate_order_init_instructions(order_init: &OrderInitialized) -> anyhow::Result<()> {
    validate_order_instructions(

View on GitHub (pinned to 18893faf8b)