{"record":{"id":"6151d3dea0cdfd6d","repo":"nautechsystems/nautilus_trader","slug":"unsupported-time-in-force-ax-supports-gtc","errorCode":null,"errorMessage":"Unsupported time in force: {:?}, AX supports GTC, IOC, and DAY","messagePattern":"Unsupported time in force: (.+?), AX supports GTC, IOC, and DAY","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1886,"sourceCode":"        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(),\n        order.is_quote_quantity(),\n        order.display_qty().is_some(),\n    )?;\n\n    AxOrderSide::try_from(order.order_side())\n        .map_err(|e| anyhow::anyhow!(\"Invalid order side: {e}\"))?;\n    quantity_to_contracts(order.quantity())?;\n\n    Ok(())\n}\n","sourceCodeStart":1868,"sourceCodeEnd":1904,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/architect_ax/src/execution.rs#L1868-L1904","documentation":"Second check in validate_order_for_ax_submit: AX's REST order API accepts only GTC, IOC and DAY time-in-force. The adapter denies other TIFs (FOK, GTD, AT_THE_OPEN, AT_THE_CLOSE, ...) locally, as the comment states, to avoid an opaque venue error - AX's HTTP API returns a bare 400 with no error schema, so an unsupported TIF would otherwise surface as an unclassifiable failure instead of a clean rejection.","triggerScenarios":"Order initialized with TimeInForce::Fok / Gtd / AtTheOpen / AtTheClose submitted to the AX execution client; GTD orders carrying an expiry_time from a strategy template; factory.limit(...).time_in_force(TimeInForce::Fok) for strict all-or-none entries.","commonSituations":"Reusing order templates from adapters (e.g. dYdX, Binance-futures) that accept FOK/GTD; copying example strategies that set GTD expiries.","solutions":["Set the order's TIF to GTC, IOC or DAY before submitting to AX","Emulate FOK: submit IOC and cancel if the fill is partial (the adapter's market emulation already yields partial-fill handling)","Emulate GTD: submit GTC and schedule a local cancel at the expiry time"],"exampleFix":"// before\nlet order = factory.limit(id, side, qty, px)\n    .time_in_force(TimeInForce::Gtd)\n    .expire_time(expiry); // -> Unsupported time in force\n// after\nlet order = factory.limit(id, side, qty, px)\n    .time_in_force(TimeInForce::Gtc);\n// schedule cancel at expiry via a TimeEvent in the strategy","handlingStrategy":"validation","validationCode":"fn ax_tif_ok(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day)\n}\ndebug_assert!(ax_tif_ok(order.time_in_force()));","typeGuard":"fn is_ax_supported_tif(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day)\n}","tryCatchPattern":null,"preventionTips":["Normalize TIF at order-construction time per venue, not at submit time","Emulate FOK with IOC + cancel-on-partial; emulate GTD with GTC + scheduled cancel","Check the adapter's supported TIF list when porting strategies between venues"],"tags":["architect-ax","order-validation","time-in-force","rust"],"backgroundTag":"unsupported-time-in-force","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}