{"record":{"id":"a0a6f776f653ec0c","repo":"nautechsystems/nautilus_trader","slug":"ax-does-not-support-reduce-only-orders","errorCode":null,"errorMessage":"AX does not support reduce-only orders","messagePattern":"AX does not support reduce-only orders","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1993,"sourceCode":"\n    Ok(())\n}\n\nfn validate_order_init_instructions(order_init: &OrderInitialized) -> anyhow::Result<()> {\n    validate_order_instructions(\n        order_init.reduce_only,\n        order_init.quote_quantity,\n        order_init.display_qty.is_some(),\n    )\n}\n\nfn validate_order_instructions(\n    reduce_only: bool,\n    quote_quantity: bool,\n    has_display_qty: bool,\n) -> anyhow::Result<()> {\n    if reduce_only {\n        anyhow::bail!(\"AX does not support reduce-only orders\");\n    }\n\n    if quote_quantity {\n        anyhow::bail!(\n            \"Architect AX adapter cannot encode quote_quantity; submit a base quantity instead\"\n        );\n    }\n\n    if has_display_qty {\n        anyhow::bail!(\"Architect AX adapter cannot encode display_qty iceberg instructions\");\n    }\n\n    Ok(())\n}\n\n// The AX HTTP API documents only a bare 400 with no error schema, so no venue\n// failure can be allowlisted as an unambiguous rejection; those arrive via the\n// orders WS `Rejected` and `CancelRejected` events instead. AX therefore never","sourceCodeStart":1975,"sourceCodeEnd":2011,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/execution.rs#L1975-L2011","documentation":"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.","triggerScenarios":"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).","commonSituations":"Reusing hedge/position-close logic built for Binance/Bybit adapters on AX; strategies that mark closing orders reduce-only by default.","solutions":["Set reduce_only to false / don't set the reduce-only flag on the order","Manage position reduction explicitly (compute quantities against the current position and submit normal orders)","Add a local pre-trade check that only reduces position size if reduce-only semantics are required"],"exampleFix":"// before\nlet order = order_factory.market(market_id, OrderSide::Sell, qty).set_reduce_only(true);\n// after\nlet order = order_factory.market(market_id, OrderSide::Sell, qty); // manage size vs position yourself","handlingStrategy":"validation","validationCode":"if order.reduce_only() {\n    return Err(anyhow::anyhow!(\"AX adapter: disable reduce_only before submit\"));\n}","typeGuard":"fn is_ax_submittable(order: &OrderAny) -> bool {\n    !order.reduce_only()\n}","tryCatchPattern":"match submit(order).await {\n    Err(e) if e.to_string().contains(\"reduce-only\") => {\n        let plain = strip_reduce_only(order.clone());\n        submit(&plain).await\n    }\n    other => other,\n}","preventionTips":["Never enable reduce_only in strategy code that targets AX","Encapsulate position-closing logic to size orders against the current position","Add an adapter-capability matrix to your strategy config validation"],"tags":["order-submission","reduce-only","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}