{"record":{"id":"0d9f8ee2d4867ebe","repo":"nautechsystems/nautilus_trader","slug":"deployment-manifest-factory-does-not-match-the-reg","errorCode":null,"errorMessage":"Deployment manifest factory does not match the registered Uniswap V3 factory","messagePattern":"Deployment manifest factory does not match the registered Uniswap V3 factory","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":412,"sourceCode":"        anyhow::ensure!(\n            role_addresses(BlockchainContractRole::Router)? == configured_routers,\n            \"Deployment manifest router set does not match `router_addresses`\"\n        );\n        anyhow::ensure!(\n            singleton(BlockchainContractRole::WrappedNative, \"wrapped native\")? == weth,\n            \"Deployment manifest wrapped native contract does not match `weth_address`\"\n        );\n        let factory = singleton(BlockchainContractRole::Factory, \"factory\")?;\n        let registered_factory =\n            crate::exchanges::get_dex_extended(config.chain.name, &DexType::UniswapV3)\n                .map(|dex| dex.factory)\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"No registered Uniswap V3 deployment for chain {}\",\n                        config.chain.name\n                    )\n                })?;\n        anyhow::ensure!(\n            factory == registered_factory,\n            \"Deployment manifest factory does not match the registered Uniswap V3 factory\"\n        );\n        let quote_contract = singleton(BlockchainContractRole::Quote, \"quote\")?;\n\n        let mut token_decimals = HashMap::new();\n\n        for token in &manifest.tokens {\n            let address = Address::from_str(&token.address)\n                .map_err(|_| anyhow::anyhow!(\"Deployment manifest token address is invalid\"))?;\n            anyhow::ensure!(\n                token_decimals.insert(address, token.decimals).is_none(),\n                \"Deployment manifest contains a duplicate token identity\"\n            );\n        }\n        anyhow::ensure!(\n            token_decimals.contains_key(&weth),\n            \"Deployment manifest has no wrapped native token identity\"","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L394-L430","documentation":"Once the registered Uniswap V3 factory for the chain is found, `validate_manifest_contracts` compares it with the manifest's `Factory` singleton address via `anyhow::ensure!(factory == registered_factory, ...)`. This error means the manifest's factory does not equal the library's registered Uniswap V3 factory for that chain — i.e. the manifest describes a different deployment (another AMM or a fork) than the adapter is built to trade on.","triggerScenarios":"Client initialization where the manifest `Factory` role address differs from `get_dex_extended(chain, UniswapV3).factory`, e.g. the manifest is for Uniswap V2, SushiSwap, or a custom fork's factory while the config targets Uniswap V3.","commonSituations":"Pointing the manifest at a forked deployment (Sushi, PancakeSwap V3) while the client expects official Uniswap V3; using a manifest from a different chain; a registry update that changed the canonical factory address (e.g. after a migration) leaving an old manifest behind.","solutions":["Update the manifest's Factory address to the registered Uniswap V3 factory for the chain","Regenerate the deployment manifest from the Uniswap V3 deployment the registry expects","If a fork is intentional, configure/use the matching DEX type instead of UniswapV3"],"exampleFix":"// before: manifest factory 0xsushi... vs registered 0x1F98431c8aD98523631AE4a59f267346ea31F984\n// after\n{\"role\": \"Factory\", \"address\": \"0x1F98431c8aD98523631AE4a59f267346ea31F984\"}","handlingStrategy":"validation","validationCode":"let registered = get_dex_extended(config.chain.name, &DexType::UniswapV3).expect(\"uniswap v3 registered\").factory;\nlet manifest_factory = manifest.contracts.iter().find(|c| c.role == BlockchainContractRole::Factory)\n    .map(|c| Address::from_str(&c.address).unwrap());\nassert_eq!(manifest_factory, Some(registered), \"manifest factory is not the registered Uniswap V3 factory\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate manifests only from the DEX deployment type you intend to trade (UniswapV3, not forks)","Pin the expected factory address per chain in tests","When using a fork, configure the matching DEX type instead of forcing UniswapV3"],"tags":["rust","config","uniswap-v3","consistency"],"backgroundTag":"invalid-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}