{"record":{"id":"aac996e9ae6eb511","repo":"nautechsystems/nautilus_trader","slug":"actual-order-side-mismatch-expected-was","errorCode":null,"errorMessage":"actual order side mismatch: expected {:?}, was {:?}","messagePattern":"actual order side mismatch: expected (.+?), was (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/models.rs","lineNumber":1635,"sourceCode":"            .context(\"algo order has no actual_order_id\")?;\n\n        if expected_actual_order_id != actual.order_id.to_string() {\n            anyhow::bail!(\n                \"actual order ID mismatch: expected {expected_actual_order_id}, was {}\",\n                actual.order_id\n            );\n        }\n\n        if self.symbol != actual.symbol {\n            anyhow::bail!(\n                \"actual order symbol mismatch: expected {}, was {}\",\n                self.symbol,\n                actual.symbol\n            );\n        }\n\n        if self.side != actual.side {\n            anyhow::bail!(\n                \"actual order side mismatch: expected {:?}, was {:?}\",\n                self.side,\n                actual.side\n            );\n        }\n\n        let mut report = self.to_order_status_report(\n            account_id,\n            instrument_id,\n            price_precision,\n            size_precision,\n            ts_init,\n        )?;\n        let actual_report = actual.to_order_status_report(\n            account_id,\n            instrument_id,\n            price_precision,\n            size_precision,","sourceCodeStart":1617,"sourceCodeEnd":1653,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/models.rs#L1617-L1653","documentation":"Algo order reconciliation also asserts that the order side on the algo record matches the side of the matched actual order. A mismatch means Long/Short (or Buy/Sell) sides disagree, so the exchange records cannot describe the same order.","triggerScenarios":"Parsing an algo order update where self.side differs from actual.side, e.g. parent says Long but child order says Short.","commonSituations":"Hedge-mode payloads where position side and order side were conflated; incorrect fixture data; exchange data anomalies or wrong record pairing during reconciliation.","solutions":["Check hedge-mode vs one-way mode handling; ensure side mapping accounts for BinancePositionSide.","Re-fetch the algo order via REST to get a consistent pair.","Fix test fixtures so sides match."],"exampleFix":"// before\n// side: Long, actual side: Short\n// after\n// reconcile with correct side (both Long) via fresh REST snapshot","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"actual order side mismatch\") => {\n        tracing::error!(\"algo/actual side mismatch (check hedge mode): {e}\");\n    }\n    r => r?,\n}","preventionTips":["Ensure your hedge-mode configuration matches what was actually set on the exchange.","Check positionSide vs side handling when interpreting records.","Validate fixtures for side consistency."],"tags":["reconciliation","side","binance-futures","algo-orders"],"backgroundTag":"internal-invariant-violation","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"}