{"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":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1962,"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    quantity_to_contracts(order.quantity())?;\n\n    Ok(())\n}\n\nfn validate_order_init_instructions(order_init: &OrderInitialized) -> anyhow::Result<()> {\n    validate_order_instructions(","sourceCodeStart":1944,"sourceCodeEnd":1980,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/execution.rs#L1944-L1980","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Change the order's TimeInForce to GTC, IOC, or DAY before submitting","If GTD semantics are needed, implement local cancellation/expiry logic with GTC plus your own timer","Check the factory/order template defaults and set time_in_force explicitly"],"exampleFix":"// before\nlet order = order_factory.limit(market_id, OrderSide::Buy, qty, price, TimeInForce::Gtd, expire);\n// after\nlet order = order_factory.limit(market_id, OrderSide::Buy, qty, price, TimeInForce::Gtc, None);","handlingStrategy":"validation","validationCode":"const AX_SUPPORTED_TIF: [TimeInForce; 3] = [TimeInForce::Gtc, TimeInForce::Ioc, TimeInForce::Day];\nif !AX_SUPPORTED_TIF.contains(&order.time_in_force()) {\n    return Err(anyhow::anyhow!(\"order TIF {:?} not supported by AX\", order.time_in_force()));\n}","typeGuard":"fn is_ax_supported_tif(tif: TimeInForce) -> bool {\n    matches!(tif, TimeInForce::Gtc | TimeInForce::Ioc | TimeInForce::Day)\n}","tryCatchPattern":"match client.submit_order(&order).await {\n    Err(e) if e.to_string().contains(\"Unsupported time in force\") => {\n        // fall back to GTC or surface a config error\n    }\n    other => other?,\n}","preventionTips":["Set time_in_force explicitly when building orders for AX","Keep a shared constant of AX-supported TIF values and validate in strategy config load","Review adapter docs before porting order templates from other venues"],"tags":["order-submission","validation","unsupported-value"],"backgroundTag":"unsupported-enum-value","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"}