{"record":{"id":"34802028d4d63e97","repo":"nautechsystems/nautilus_trader","slug":"invalid-field-precision-actual-expected-expe","errorCode":null,"errorMessage":"Invalid {field} precision {actual}, expected {expected} for {}","messagePattern":"Invalid (.+?) precision (.+?), expected (.+?) for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/matching_engine/mod.rs","lineNumber":1298,"sourceCode":"                instrument.id(),\n                instrument.price_precision(),\n                instrument.size_precision()\n            );\n        }\n\n        self.instrument = instrument;\n\n        if changed {\n            self.drop_incompatible_core_orders();\n        }\n\n        Ok(())\n    }\n\n    fn check_price_precision(&self, actual: u8, field: &str) -> anyhow::Result<()> {\n        let expected = self.instrument.price_precision();\n        if actual != expected {\n            anyhow::bail!(\n                \"Invalid {field} precision {actual}, expected {expected} for {}\",\n                self.instrument.id()\n            );\n        }\n        Ok(())\n    }\n\n    fn check_size_precision(&self, actual: u8, field: &str) -> anyhow::Result<()> {\n        let expected = self.instrument.size_precision();\n        if actual != expected {\n            anyhow::bail!(\n                \"Invalid {field} precision {actual}, expected {expected} for {}\",\n                self.instrument.id()\n            );\n        }\n        Ok(())\n    }\n","sourceCodeStart":1280,"sourceCodeEnd":1316,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/matching_engine/mod.rs#L1280-L1316","documentation":"Precision guard (check_price_precision) invoked when the matching engine's instrument definition is updated: fields must carry exactly the instrument's declared price precision; a mismatch would break price invariants and triggers dropping incompatible orders.","triggerScenarios":"Thrown at crates/execution/src/matching_engine/mod.rs:1298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align the field's precision with the updated instrument precision","Update the instrument definition consistently with the data being processed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}