{"record":{"id":"fce2b692cb61a2da","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-fill-report-end-time-requires-star","errorCode":null,"errorMessage":"Binance Futures fill report end time requires start time for a complete range","messagePattern":"Binance Futures fill report end time requires start time for a complete range","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2527,"sourceCode":"                    }\n\n                    let next_from_id = max_trade_id\n                        .checked_add(1)\n                        .context(\"Binance user trade ID overflow during pagination\")?;\n                    anyhow::ensure!(\n                        from_id.is_none_or(|cursor| next_from_id > cursor),\n                        \"Binance user-trades pagination made no progress\"\n                    );\n                    from_id = Some(next_from_id);\n                }\n\n                if window_end >= query_end_time {\n                    break;\n                }\n                window_start = window_end.saturating_add(1);\n            }\n        } else {\n            anyhow::ensure!(\n                cmd.end.is_none(),\n                \"Binance Futures fill report end time requires start time for a complete range\"\n            );\n            let mut from_id = 0;\n\n            loop {\n                let params = BinanceUserTradesParamsBuilder::default()\n                    .symbol(symbol.clone())\n                    .from_id(from_id)\n                    .limit(USER_TRADES_PAGE_LIMIT)\n                    .build()\n                    .map_err(|e| anyhow::anyhow!(\"{e}\"))?;\n                let page = self.http_client.query_user_trades(&params).await?;\n\n                if page.is_empty() {\n                    break;\n                }\n","sourceCodeStart":2509,"sourceCodeEnd":2545,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L2509-L2545","documentation":"Binance's user-trades endpoint paginates by trade ID; querying only an `end` time with no `start` cannot yield a well-defined complete range (the ID cursor would need to start at 0 and scan everything). The adapter therefore rejects a GenerateFillReports command that sets `end` without `start`.","triggerScenarios":"Building GenerateFillReports with `.end(...)` set and `.start(None)`, then calling generate_fill_reports (typically via generate_mass_status).","commonSituations":"Developers wanting 'trades up to now' or 'trades in the last hour' pass only an end bound; or code that conditionally sets start/end leaves end populated while start is omitted.","solutions":["Always provide a `start` timestamp when calling generate_fill_reports; add `end` only if you need a bounded range.","To bound only the upper edge, compute a start (e.g. account activation time or now - lookback) and pass both.","Filter the returned fill reports by ts_event afterwards if you only need recent trades, as generate_mass_status itself does."],"exampleFix":"// before\nlet cmd = GenerateFillReportsBuilder::default()\n    .ts_init(ts_now)\n    .end(Some(end))\n    .build()?;\n// after\nlet cmd = GenerateFillReportsBuilder::default()\n    .ts_init(ts_now)\n    .start(Some(start))\n    .end(Some(end))\n    .build()?;","handlingStrategy":"validation","validationCode":"if let (None, Some(_)) = (cmd.start, cmd.end) {\n    return Err(anyhow::anyhow!(\"fill report end time requires start time\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set `start` on GenerateFillReports; treat `end` as optional refinement only.","Centralize fill-report command construction in one helper that enforces the invariant.","Write a unit test asserting the builder helper never emits end-without-start."],"tags":["binance","arguments","time-range","validation"],"backgroundTag":"missing-required-argument","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"}