{"record":{"id":"05e360fbd0cb58ca","repo":"nautechsystems/nautilus_trader","slug":"architect-ax-adapter-cannot-encode-display-qty-ice","errorCode":null,"errorMessage":"Architect AX adapter cannot encode display_qty iceberg instructions","messagePattern":"Architect AX adapter cannot encode display_qty iceberg instructions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":2003,"sourceCode":"}\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 {\n        AxHttpError::MissingCredentials\n        | AxHttpError::MissingSessionToken\n        | AxHttpError::ValidationError(_)\n        | AxHttpError::BuildError(_) => CommandFailure::NotSent(message),\n        AxHttpError::ApiError { .. }\n        | AxHttpError::JsonError(_)","sourceCodeStart":1985,"sourceCodeEnd":2021,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/execution.rs#L1985-L2021","documentation":"AX cannot encode iceberg-style display_qty instructions, so the adapter rejects any order that has a display_qty set. The flag is checked in validate_order_instructions to prevent silently dropping the iceberg behavior.","triggerScenarios":"Calling submit_order with a limit order whose display_qty field is Some(...) (iceberg order) — e.g. order_factory.limit(...).with_display_qty(qty).","commonSituations":"Large-order execution strategies using iceberg slicing ported from venues that support display quantity; copied order templates retaining display_qty.","solutions":["Submit the order without display_qty (set it to None)","Implement iceberg slicing locally: submit child orders of display-size and resubmit on fills","If iceberg execution is essential, use a different venue/adapter that supports it"],"exampleFix":"// before\nlet order = order_factory.limit(market_id, OrderSide::Buy, total_qty, price, TimeInForce::Gtc, None).with_display_qty(disp);\n// after\nlet order = order_factory.limit(market_id, OrderSide::Buy, total_qty, price, TimeInForce::Gtc, None); // no display_qty","handlingStrategy":"validation","validationCode":"if order.display_qty().is_some() {\n    return Err(anyhow::anyhow!(\"AX adapter: display_qty not supported\"));\n}","typeGuard":"fn has_display_qty(order: &OrderAny) -> bool {\n    order.display_qty().is_some()\n}","tryCatchPattern":"match submit(order).await {\n    Err(e) if e.to_string().contains(\"display_qty\") => {\n        let plain = without_display_qty(order.clone());\n        submit(&plain).await\n    }\n    other => other,\n}","preventionTips":["Do not set display_qty on orders targeting AX","Implement iceberg behavior as an algorithmic layer above the adapter if needed","Check per-adapter feature flags before enabling execution algos"],"tags":["order-submission","iceberg","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"}