nautechsystems/nautilus_trader · error

AX does not support reduce-only orders

Error message

AX does not support reduce-only orders

What it means

The AX adapter does not support the reduce-only flag on orders, so validate_order_instructions rejects any order with reduce_only set to true before submission. The venue API has no field for it, so passing it through would silently lose the semantics.

Solutions

  1. Set reduce_only to false / don't set the reduce-only flag on the order
  2. Manage position reduction explicitly (compute quantities against the current position and submit normal orders)
  3. Add a local pre-trade check that only reduces position size if reduce-only semantics are required

Example fix

// before
let order = order_factory.market(market_id, OrderSide::Sell, qty).set_reduce_only(true);
// after
let order = order_factory.market(market_id, OrderSide::Sell, qty); // manage size vs position yourself
Defensive patterns

Strategy: validation

Validate before calling

if order.reduce_only() {
    return Err(anyhow::anyhow!("AX adapter: disable reduce_only before submit"));
}

Type guard

fn is_ax_submittable(order: &OrderAny) -> bool {
    !order.reduce_only()
}

Try / catch

match submit(order).await {
    Err(e) if e.to_string().contains("reduce-only") => {
        let plain = strip_reduce_only(order.clone());
        submit(&plain).await
    }
    other => other,
}

Prevention

When it happens

Trigger: Submitting an order via validate_order_for_ax_submit or validate_order_init_instructions where the order has reduce_only = true (common on derivatives/adapters where reduce-only is default).

Common situations: Reusing hedge/position-close logic built for Binance/Bybit adapters on AX; strategies that mark closing orders reduce-only by default.

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/a0a6f776f653ec0c. Report an issue: GitHub.

Appendix: source

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

    Ok(())
}

fn validate_order_init_instructions(order_init: &OrderInitialized) -> anyhow::Result<()> {
    validate_order_instructions(
        order_init.reduce_only,
        order_init.quote_quantity,
        order_init.display_qty.is_some(),
    )
}

fn validate_order_instructions(
    reduce_only: bool,
    quote_quantity: bool,
    has_display_qty: bool,
) -> anyhow::Result<()> {
    if reduce_only {
        anyhow::bail!("AX does not support reduce-only orders");
    }

    if quote_quantity {
        anyhow::bail!(
            "Architect AX adapter cannot encode quote_quantity; submit a base quantity instead"
        );
    }

    if has_display_qty {
        anyhow::bail!("Architect AX adapter cannot encode display_qty iceberg instructions");
    }

    Ok(())
}

// The AX HTTP API documents only a bare 400 with no error schema, so no venue
// failure can be allowlisted as an unambiguous rejection; those arrive via the
// orders WS `Rejected` and `CancelRejected` events instead. AX therefore never

View on GitHub (pinned to 18893faf8b)