{"record":{"id":"55a237e0aa00afe4","repo":"nautechsystems/nautilus_trader","slug":"ax-fills-page-length-page-len-exceeds-requested","errorCode":null,"errorMessage":"AX fills page length {page_len} exceeds requested limit {PAGE_SIZE}","messagePattern":"AX fills page length (.+?) exceeds requested limit (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/http/client.rs","lineNumber":2225,"sourceCode":"        let start_ns = start.map_or(floor_ns, |s| s.as_i64().max(floor_ns));\n        let mut params = GetFillsParams::new(start_ns, end_ns);\n        params.limit = Some(PAGE_SIZE);\n        params.sort_ts = Some(\"desc\".to_string());\n\n        let mut fills = Vec::new();\n        let mut seen_trade_ids = HashSet::new();\n        let mut seen_cursors = HashSet::new();\n        let mut expected_total = None;\n\n        loop {\n            let response = self\n                .inner\n                .get_fills_page(&params)\n                .await\n                .map_err(|e| anyhow::anyhow!(e))?;\n            let page_len = response.fills.len();\n\n            anyhow::ensure!(\n                page_len <= PAGE_SIZE as usize,\n                \"AX fills page length {page_len} exceeds requested limit {PAGE_SIZE}\"\n            );\n\n            if let Some(limit) = response.limit {\n                anyhow::ensure!(\n                    (0..=PAGE_SIZE).contains(&limit),\n                    \"AX fills applied limit must be between 0 and {PAGE_SIZE}, was {limit}\"\n                );\n                anyhow::ensure!(\n                    page_len <= limit as usize,\n                    \"AX fills page length {page_len} exceeds applied limit {limit}\"\n                );\n            }\n\n            if let Some(total_count) = response.total_count {\n                anyhow::ensure!(\n                    total_count >= 0,","sourceCodeStart":2207,"sourceCodeEnd":2243,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/http/client.rs#L2207-L2243","documentation":"The fills paginator requests a fixed PAGE_SIZE per call and asserts no page contains more rows than it asked for. A larger page means the server ignored or misapplied the limit, breaking the caller's batching assumptions and potentially returning oversized payloads.","triggerScenarios":"A get_fills_page response contains more fill rows than the PAGE_SIZE the client requested, i.e. the server's limit handling changed or was ignored.","commonSituations":"AX API limit parameter regression or semantic change (e.g. limit interpreted as minimum); adapter/venue version drift; server ignoring limit when filters match many rows.","solutions":["Check whether the limit query parameter is actually transmitted and named per current AX docs","Update the adapter for any API limit-semantics change","Truncate pages to PAGE_SIZE client-side only if you can prove rows beyond the limit are duplicates","Report limit-noncompliance to the venue/adapter maintainers"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if page.fills.len() > PAGE_SIZE {\n    return Err(anyhow!(\"server ignored limit: {} rows > {}\",\n        page.fills.len(), PAGE_SIZE));\n}","typeGuard":"fn respects_page_size(page_len: usize, page_size: usize) -> bool {\n    page_len <= page_size\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"exceeds requested limit\") => {\n        error!(\"AX fills limit ignored by server; check API version/params\");\n        Err(e)\n    }\n    other => other,\n}","preventionTips":["Confirm the limit parameter name and placement match current AX API docs","Pin adapter and venue API versions together","Inspect raw requests (e.g. via a proxy/log) to confirm the limit reaches the server"],"tags":["pagination","http","limit-violation"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}