{"record":{"id":"4a79b41c3bb614e0","repo":"nautechsystems/nautilus_trader","slug":"terminal-report-for-has-unaccounted-fills-wait","errorCode":null,"errorMessage":"terminal report for {} has unaccounted fills; waiting for fill reports","messagePattern":"terminal report for (.+?) has unaccounted fills; waiting for fill reports","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/live/src/execution/manager.rs","lineNumber":4720,"sourceCode":"            &order_report,\n            account_id,\n            instrument,\n            &[],\n            true,\n            None,\n            None,\n        );\n        Some(events)\n    }\n\n    fn reconcile_order_report(\n        &self,\n        order: &OrderAny,\n        report: &OrderStatusReport,\n        instrument: Option<&InstrumentAny>,\n        commission_client: Option<&dyn ExecutionClient>,\n    ) -> anyhow::Result<Vec<OrderEventAny>> {\n        anyhow::ensure!(\n            !terminal_report_has_missing_fills(report, order.filled_qty()),\n            \"terminal report for {} has unaccounted fills; waiting for fill reports\",\n            order.client_order_id(),\n        );\n        let ts_now = self.clock.borrow().timestamp_ns();\n        let commission = if matches!(\n            report.order_status,\n            OrderStatus::PartiallyFilled | OrderStatus::Filled\n        ) && report.filled_qty > order.filled_qty()\n            && let Some(instrument) = instrument\n        {\n            let fill_qty = report.filled_qty - order.filled_qty();\n            Self::resolve_inferred_fill_commission(\n                commission_client,\n                instrument,\n                fill_qty,\n                incremental_inferred_fill_price_and_liquidity(order, report, instrument),\n            )?","sourceCodeStart":4702,"sourceCodeEnd":4738,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/execution/manager.rs#L4702-L4738","documentation":"When processing an OrderStatusReport that is terminal (e.g. FILLED, CANCELED), the manager ensures the report's filled quantity accounts for all fills already known to the order. If terminal_report_has_missing_fills is true, there are unaccounted fills - the manager refuses to apply the terminal event and waits for the outstanding fill reports so no fill is lost.","triggerScenarios":"A status report arrives with a terminal status while the venue's fill reports for the executed quantity haven't all been received/processed yet (e.g. FILLED status seen before the corresponding TradeReports).","commonSituations":"Venues that emit order status updates and trade fills over separate streams with different latencies; reconciliation snapshots taken mid-flight; adapters that suppress individual fill reports and rely only on status reports.","solutions":["Ensure the adapter delivers fill (trade) reports and that nothing drops them (check stream subscriptions)","Retry/re-request the status report after fills arrive - the manager waits, so verify the fill stream is connected","Check venue-specific ordering guarantees; if the venue sends FILLED status first, defer terminal handling until fills are in","Review adapter reconciliation logic so status reports don't bypass fill reports"],"exampleFix":"// before (adapter skips individual trade reports)\nif status.is_terminal() { self.generate_order_events(status); }\n// after (emit fills first, let manager verify)\nfor fill in venue_fills { self.generate_fill_events(fill); }\nself.generate_order_events(status);","handlingStrategy":"retry","validationCode":"if terminal_report_has_missing_fills(&report, order.filled_qty()) {\n    // wait for fill reports or re-request the status report later\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unaccounted fills\") => {\n        // schedule re-request of the status report after fill reports arrive\n    }\n    other => other?,\n}","preventionTips":["Subscribe to and verify the venue's fill/trade stream health","Keep both status and fill report paths enabled in adapter config","Test with venues whose status and fill deliveries race"],"tags":["rust","live-execution","fill-reconciliation","report-ordering"],"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"}