{"record":{"id":"4568ab3abd25bd73","repo":"nautechsystems/nautilus_trader","slug":"architect-ax-adapter-cannot-encode-quote-quantity","errorCode":null,"errorMessage":"Architect AX adapter cannot encode quote_quantity; submit a base quantity instead","messagePattern":"Architect AX adapter cannot encode quote_quantity; submit a base quantity instead","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1997,"sourceCode":"fn 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\n// classifies a send failure as `CommandFailure::VenueRejected`.\nfn classify_ax_http_failure(error: &AxHttpError) -> CommandFailure {\n    let message = error.to_string();\n    match error {","sourceCodeStart":1979,"sourceCodeEnd":2015,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/execution.rs#L1979-L2015","documentation":"AX order encoding cannot represent a quote-denominated quantity, so validate_order_instructions rejects any order with quote_quantity = true. The adapter only supports base-asset quantities, and the error tells you to convert to base quantity.","triggerScenarios":"Calling submit_order with an order created with quote_quantity = true (e.g. order_factory.market(..., quote_quantity: true)) or a strategy configured to spend a notional amount.","commonSituations":"Strategies sized in quote currency (e.g. 'buy $1000 of BTC') ported from adapters that support quote_quantity; notional-based risk sizing.","solutions":["Recreate the order with quote_quantity = false and a base-asset quantity","Convert the quote notional to base using the current price before constructing the order","Adjust strategy sizing config to emit base quantities"],"exampleFix":"// before\nlet order = order_factory.market(market_id, OrderSide::Buy, Quantity::from(1000), None, /*quote*/ true);\n// after\nlet base_qty = quote_notional / price; // convert at current price\nlet order = order_factory.market(market_id, OrderSide::Buy, base_qty, None, false);","handlingStrategy":"validation","validationCode":"if order.quote_quantity() {\n    let base_qty = quote_notional / instrument.last_price();\n    order = build_order(base_qty, /*quote_quantity*/ false);\n}","typeGuard":null,"tryCatchPattern":"match submit(order).await {\n    Err(e) if e.to_string().contains(\"quote_quantity\") => {\n        let base = to_base_quantity(order, price)?;\n        submit(&base).await\n    }\n    other => other,\n}","preventionTips":["Always size AX orders in base units","Convert notionals to base quantity at order-construction time, not submit time","Add quote_quantity: false to strategy sizing config explicitly"],"tags":["order-submission","quote-quantity","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"}