{"record":{"id":"f4e62543dbb267fb","repo":"nautechsystems/nautilus_trader","slug":"persisted-pool-pool-address-does-not-match-resto","errorCode":null,"errorMessage":"Persisted pool {pool_address} does not match restored pool {}","messagePattern":"Persisted pool (.+?) does not match restored pool (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1069,"sourceCode":"            \"Persisted swap trader does not match restored order\"\n        );\n        anyhow::ensure!(\n            intent.strategy_id.as_deref() == Some(order.strategy_id().as_str()),\n            \"Persisted swap strategy does not match restored order\"\n        );\n        anyhow::ensure!(\n            intent.account_id.as_deref() == Some(self.core.account_id.as_str()),\n            \"Persisted swap account does not match execution client account\"\n        );\n\n        let pool = self.resolve_pool(&instrument_id)?;\n        let pool_address = Address::from_str(\n            intent\n                .pool_address\n                .as_deref()\n                .ok_or_else(|| anyhow::anyhow!(\"Persisted swap intent has no pool address\"))?,\n        )?;\n        anyhow::ensure!(\n            pool.address == pool_address,\n            \"Persisted pool {pool_address} does not match restored pool {}\",\n            pool.address\n        );\n        let amount_in = U256::from_str(\n            intent\n                .amount_in\n                .as_deref()\n                .ok_or_else(|| anyhow::anyhow!(\"Persisted swap intent has no input amount\"))?,\n        )?;\n        let fee = U24::try_from(\n            pool.fee\n                .ok_or_else(|| anyhow::anyhow!(\"Restored pool {instrument_id} has no fee\"))?,\n        )?;\n        let quote_token = pool.get_quote_token();\n        let quote_currency = Currency::new_checked(\n            &quote_token.symbol,\n            quote_token.decimals,","sourceCodeStart":1051,"sourceCodeEnd":1087,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1051-L1087","documentation":"After parsing the persisted pool_address, restore_swap_plan resolves the pool for the intent's instrument via resolve_pool and compares its on-chain address with the persisted one. If the registered/restored pool for that instrument has a different address than what the intent was prepared against, the client aborts reconciliation. This guarantees the swap is replayed against exactly the pool it was originally created for, guarding against instrument remapping to a different pool contract.","triggerScenarios":"reconcile_unresolved_execution or build_execution_verification_migration calls restore_swap_plan on an intent whose persisted pool_address differs from the address of the pool resolved for intent.instrument_id. Occurs when the instrument's pool registration changed between persisting and restoring (different DEX/pool configured), or the intent belongs to a different chain/fork with a same-instrument but different pool.","commonSituations":"Changing the pool/instrument definition (e.g. new pool deployment, different fee tier) while an old swap intent was still pending; pointing the node at a different chain or forked network with different contract addresses; loading another environment's database.","solutions":["Restore the original pool/instrument registration so resolve_pool returns the pool address stored in the intent.","Resolve or cancel the pending intent before changing pool configuration, then re-issue the trade.","Verify chain_id and network configuration match the environment where the intent was persisted.","Inspect the intent row and current instrument definition to confirm which is stale, and fix the stale side."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let pool = client.resolve_pool(&instrument_id)?;\nif pool.address != intent_pool_address {\n    eprintln!(\"pool for {instrument_id} changed since intent was written; restore original registration or cancel the intent\");\n}","typeGuard":"fn pool_matches(pool: &Pool, persisted: Address) -> bool {\n    pool.address == persisted\n}","tryCatchPattern":null,"preventionTips":["Do not change pool/instrument definitions while swap intents are pending","Pin chain_id and contract addresses per environment; never share DBs across networks","Record and compare factory/pool addresses when migrating deployments","Resolve pending intents before re-registering instruments"],"tags":["persistence","address-mismatch","uniswap-v3","reconciliation"],"backgroundTag":"checksum-mismatch","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"}