nautechsystems/nautilus_trader · error · anyhow::Error

Deployment manifest factory does not match the registered Un

Error message

Deployment manifest factory does not match the registered Uniswap V3 factory

What it means

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.

Source

Thrown at crates/adapters/blockchain/src/execution/client.rs:412

        anyhow::ensure!(
            role_addresses(BlockchainContractRole::Router)? == configured_routers,
            "Deployment manifest router set does not match `router_addresses`"
        );
        anyhow::ensure!(
            singleton(BlockchainContractRole::WrappedNative, "wrapped native")? == weth,
            "Deployment manifest wrapped native contract does not match `weth_address`"
        );
        let factory = singleton(BlockchainContractRole::Factory, "factory")?;
        let registered_factory =
            crate::exchanges::get_dex_extended(config.chain.name, &DexType::UniswapV3)
                .map(|dex| dex.factory)
                .ok_or_else(|| {
                    anyhow::anyhow!(
                        "No registered Uniswap V3 deployment for chain {}",
                        config.chain.name
                    )
                })?;
        anyhow::ensure!(
            factory == registered_factory,
            "Deployment manifest factory does not match the registered Uniswap V3 factory"
        );
        let quote_contract = singleton(BlockchainContractRole::Quote, "quote")?;

        let mut token_decimals = HashMap::new();

        for token in &manifest.tokens {
            let address = Address::from_str(&token.address)
                .map_err(|_| anyhow::anyhow!("Deployment manifest token address is invalid"))?;
            anyhow::ensure!(
                token_decimals.insert(address, token.decimals).is_none(),
                "Deployment manifest contains a duplicate token identity"
            );
        }
        anyhow::ensure!(
            token_decimals.contains_key(&weth),
            "Deployment manifest has no wrapped native token identity"

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Update the manifest's Factory address to the registered Uniswap V3 factory for the chain
  2. Regenerate the deployment manifest from the Uniswap V3 deployment the registry expects
  3. If a fork is intentional, configure/use the matching DEX type instead of UniswapV3

Example fix

// before: manifest factory 0xsushi... vs registered 0x1F98431c8aD98523631AE4a59f267346ea31F984
// after
{"role": "Factory", "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984"}
Defensive patterns

Strategy: validation

Validate before calling

let registered = get_dex_extended(config.chain.name, &DexType::UniswapV3).expect("uniswap v3 registered").factory;
let manifest_factory = manifest.contracts.iter().find(|c| c.role == BlockchainContractRole::Factory)
    .map(|c| Address::from_str(&c.address).unwrap());
assert_eq!(manifest_factory, Some(registered), "manifest factory is not the registered Uniswap V3 factory");

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/0d9f8ee2d4867ebe. Report an issue: GitHub.