{"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":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/execution.rs","lineNumber":1929,"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":1911,"sourceCodeEnd":1947,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/architect_ax/src/execution.rs#L1911-L1947","documentation":"validate_order_instructions bails when the order has display_qty set: display_qty is the iceberg (hidden quantity) instruction, and AX's order model as encoded by this adapter has no field for it. Any OrderInitialized or submitted order carrying a display quantity is denied locally rather than sent with the iceberg semantics silently dropped - otherwise the venue would execute the full size visibly, changing the order's meaning.","triggerScenarios":"factory.limit(...).display_qty(hidden) submitted to AX; order templates built for venues with native iceberg support (e.g. Binance) reused against AX.","commonSituations":"Execution algos that slice large parents and submit icebergs; shared order-building helpers that always populate display_qty when provided.","solutions":["Remove display_qty and submit the full visible LIMIT order","Emulate iceberg locally: slice into child LIMIT orders yourself and resubmit as each child fills","Gate your order builder so display_qty is never attached for instruments routed to AX"],"exampleFix":"// before\nlet order = factory.limit(id, side, qty, px)\n    .display_qty(display); // -> cannot encode display_qty\n// after: manual slicing\nfor slice_qty in qty.split_into(max_show) {\n    self.submit_order(&factory.limit(id, side, slice_qty, px));\n}","handlingStrategy":"validation","validationCode":"if order.display_qty().is_some() {\n    anyhow::bail!(\n        \"refusing to submit iceberg to AX; slice into child LIMIT orders instead\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Implement iceberg as a parent/child slicer in your execution layer for AX routes","Make display_qty opt-in per venue in shared order builders so AX never receives it","Test order-building code against the adapter's validate_order_for_ax_submit in CI"],"tags":["architect-ax","order-validation","iceberg","display-qty","rust"],"backgroundTag":"iceberg-display-qty-not-supported","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}