nautechsystems/nautilus_trader · error · anyhow::Error

Deployment manifest pool address is invalid

Error message

Deployment manifest pool address is invalid

What it means

Each pool entry in the deployment manifest carries an address string that must parse as a valid Ethereum address via Address::from_str. If parsing fails (malformed hex, wrong length, invalid characters), validation aborts with this error.

Source

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

                    && token_decimals.contains_key(&token_in)
                    && token_decimals.contains_key(&token_out),
                "Allowed token pair {token_in} -> {token_out} is not fully pinned by the deployment manifest"
            );
        }

        for limit in config.quote_spend_limits.as_deref().unwrap_or_default() {
            let spend_token = validate_address(&limit.spend_token)?;
            anyhow::ensure!(
                token_decimals.get(&spend_token) == Some(&limit.spend_token_decimals),
                "Quote spend limit decimals do not match the deployment manifest"
            );
        }

        let pool_contracts = role_addresses(BlockchainContractRole::Pool)?;

        for pool in &manifest.pools {
            let pool_address = Address::from_str(&pool.address)
                .map_err(|_| anyhow::anyhow!("Deployment manifest pool address is invalid"))?;
            let pool_factory = Address::from_str(&pool.factory)
                .map_err(|_| anyhow::anyhow!("Deployment manifest pool factory is invalid"))?;
            let pool_quote = Address::from_str(&pool.quote_contract).map_err(|_| {
                anyhow::anyhow!("Deployment manifest pool quote contract is invalid")
            })?;
            anyhow::ensure!(
                pool_contracts.contains(&pool_address)
                    && pool_factory == factory
                    && pool_quote == quote_contract,
                "Deployment manifest pool does not use the pinned pool, factory, and quote identities"
            );
        }
        Ok(())
    }

    async fn fetch_native_currency_balance(&self) -> anyhow::Result<Money> {
        let balance_u256 = self
            .http_rpc_client

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Correct the pool.address string in the deployment manifest to a valid 20-byte hex address
  2. Copy the address directly from the deployment artifacts rather than hand-typing
  3. Validate the address offline (checksum tool) before editing the manifest

Example fix

// before
address = "0x1234" // too short
// after
address = "0x1234567890abcdef1234567890abcdef12345678"
Defensive patterns

Strategy: validation

Validate before calling

fn is_valid_address(s: &str) -> bool {
    s.len() == 42 && s.starts_with("0x") && s[2..].chars().all(|c| c.is_ascii_hexdigit())
}
assert!(is_valid_address(&pool.address));

Prevention

When it happens

Trigger: Calling preflight/validate_manifest_contracts where a manifest.pools[].address string fails Address::from_str parsing.

Common situations: Typo in the manifest (missing characters, whitespace, non-hex chars); address written with an unsupported prefix or wrong length; hand-edited manifest corruption.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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