{"record":{"id":"49b295b325e7cc42","repo":"nautechsystems/nautilus_trader","slug":"unsupported-order-type-the-architect-ax-ada","errorCode":null,"errorMessage":"Unsupported order type: {:?}, the Architect AX adapter accepts Nautilus MARKET and LIMIT orders","messagePattern":"Unsupported order type: (.+?), the Architect AX adapter accepts Nautilus MARKET and LIMIT orders","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1875,"sourceCode":"        instrument_id,\n        venue_order_id,\n        TradeId::new(&execution.tid),\n        order_side,\n        last_qty,\n        last_px,\n        commission,\n        liquidity_side,\n        client_order_id,\n        None,\n        ts_event,\n        ts_init,\n        Some(UUID4::new()),\n    ))\n}\n\nfn validate_order_for_ax_submit(order: &OrderAny) -> anyhow::Result<()> {\n    if !matches!(order.order_type(), OrderType::Market | OrderType::Limit) {\n        anyhow::bail!(\n            \"Unsupported order type: {:?}, the Architect AX adapter accepts Nautilus MARKET and LIMIT orders\",\n            order.order_type(),\n        );\n    }\n\n    // AX accepts only GTC, IOC, and DAY; deny others locally to avoid an opaque venue error\n    if !matches!(\n        order.time_in_force(),\n        TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day\n    ) {\n        anyhow::bail!(\n            \"Unsupported time in force: {:?}, AX supports GTC, IOC, and DAY\",\n            order.time_in_force(),\n        );\n    }\n\n    validate_order_instructions(\n        order.is_reduce_only(),","sourceCodeStart":1857,"sourceCodeEnd":1893,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/architect_ax/src/execution.rs#L1857-L1893","documentation":"Local pre-flight validation in validate_order_for_ax_submit: the adapter can only encode Nautilus MARKET and LIMIT orders into AX's order model. Any other OrderType (STOP_MARKET, STOP_LIMIT, MARKET_TO_LIMIT, ...) is rejected before anything is sent, producing a denied submit rather than an opaque venue error. AX emulates market orders internally, so the two accepted types cover all supported behavior.","triggerScenarios":"Strategy submits a stop or stop-limit order (factory.stop_market / factory.stop_limit, or an order initialized with those types) to the AX execution client; bracket/OCO order packs whose entry legs contain stop-type orders.","commonSituations":"Porting a strategy from a venue that supports native stops (Binance, Bybit) to AX; using standard bracket-order helpers that attach stop-loss legs without remembering AX cannot take them.","solutions":["Replace stop orders with plain LIMIT or MARKET orders on AX","Emulate stops locally: subscribe to trades/quotes in the strategy and fire a MARKET order when the stop level trades","If you need server-side protection, check whether Architect supports a different order product for your account and use that outside this adapter"],"exampleFix":"// before\nlet stop = factory.stop_market(id, side, qty, trigger_px);\nself.submit_order(&stop); // -> Unsupported order type\n// after: local stop emulation\nif price_crossed(trigger_px) {\n    let mkt = factory.market(id, side, qty);\n    self.submit_order(&mkt);\n}","handlingStrategy":"validation","validationCode":"// Reject unsupported types before they reach the engine\nfn ax_order_type_ok(t: OrderType) -> bool {\n    matches!(t, OrderType::Market | OrderType::Limit)\n}\ndebug_assert!(ax_order_type_ok(order.order_type()));","typeGuard":"fn is_ax_supported_order_type(t: OrderType) -> bool {\n    matches!(t, OrderType::Market | OrderType::Limit)\n}","tryCatchPattern":null,"preventionTips":["Implement stop-loss logic locally (price trigger -> MARKET order) when running on AX","Audit bracket/OCO templates before porting a strategy to AX - legs must be MARKET/LIMIT only","Add a strategy-level unit test that every order type you emit is in {Market, Limit}"],"tags":["architect-ax","order-validation","order-type","stop-order","rust"],"backgroundTag":"unsupported-order-type","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}