{"record":{"id":"126a4df4282e34b8","repo":"nautechsystems/nautilus_trader","slug":"invalid-pool-address-failed-with-error","errorCode":null,"errorMessage":"Invalid pool address '{}' failed with error: {:?}","messagePattern":"Invalid pool address '(.+?)' failed with error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/client.rs","lineNumber":573,"sourceCode":"    ) -> anyhow::Result<()> {\n        match command {\n            DefiSubscribeCommand::Blocks(_cmd) => {\n                log::debug!(\"Processing subscribe blocks command\");\n\n                Self::subscribe_block_feed(core_client, BlockFeedOwner::Explicit).await?;\n\n                Ok(())\n            }\n            DefiSubscribeCommand::Pool(cmd) => {\n                log::debug!(\n                    \"Processing subscribe pool command for {}\",\n                    cmd.instrument_id\n                );\n\n                if let Ok((_, dex)) = cmd.instrument_id.venue.parse_dex() {\n                    let pool_address = validate_address(cmd.instrument_id.symbol.as_str())\n                        .map_err(|e| {\n                            anyhow::anyhow!(\n                                \"Invalid pool address '{}' failed with error: {:?}\",\n                                cmd.instrument_id,\n                                e\n                            )\n                        })?;\n\n                    // Subscribe to all pool event types\n                    core_client\n                        .subscription_manager\n                        .subscribe_swaps(dex, pool_address);\n                    core_client\n                        .subscription_manager\n                        .subscribe_burns(dex, pool_address);\n                    core_client\n                        .subscription_manager\n                        .subscribe_mints(dex, pool_address);\n                    core_client\n                        .subscription_manager","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/client.rs#L555-L591","documentation":"Thrown in `handle_subscribe_command` when the instrument's symbol cannot be parsed as a valid Ethereum address via `validate_address`. The validation requires a `0x` prefix, exactly 42 characters, valid hex, and a correct EIP-55 checksum. The full instrument_id is included in the message.","triggerScenarios":"Subscribing to pool data with `SubscribeCommand` where `instrument_id.symbol` is not a well-formed checksummed 0x address (e.g. a plain token symbol like `USDC` or an all-lowercase address).","commonSituations":"Using a ticker symbol instead of the pool contract address; copying an address without its checksum (all lowercase/uppercase); truncated or pasted-with-spaces addresses; building instrument IDs like `0x...-Pool` with extra suffixes in the symbol.","solutions":["Pass the pool contract address in EIP-55 checksummed form as the instrument symbol (e.g. `0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Ed`).","Re-checksum the address with a tool or `Address::parse_checksummed`/viem's `getAddress` before subscribing.","Verify the symbol is exactly 42 characters, starts with 0x, and contains no whitespace or suffix.","Confirm the address is the pool contract address, not a token or quote asset address."],"exampleFix":"// before\nlet id = InstrumentId::from(\"USDC/WETH-0xb4e16d0168e52d35cacd2c6185b44281ec28c9ed@Uniswap\");\n// after (checksummed pool address as symbol)\nlet id = InstrumentId::from(\"0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Ed@Uniswap\");","handlingStrategy":"validation","validationCode":"// Rust\nfn is_valid_pool_symbol(symbol: &str) -> bool {\n    symbol.starts_with(\"0x\")\n        && symbol.len() == 42\n        && symbol[2..].chars().all(|c| c.is_ascii_hexdigit())\n        && Address::parse_checksummed(symbol, None).is_ok()\n}","typeGuard":null,"tryCatchPattern":"match Address::parse_checksummed(symbol, None) {\n    Ok(addr) => subscribe(addr),\n    Err(e) => log::error!(\"Rejecting subscription: '{symbol}' is not a checksummed pool address: {e}\"),\n}","preventionTips":["Always store and transmit addresses in EIP-55 checksummed form.","Never use token tickers or names as instrument symbols for DEX pool subscriptions.","Trim whitespace and avoid concatenating suffixes into the symbol field.","Checksum-normalize addresses at system boundaries (config load, API input) once."],"tags":["ethereum","address-validation","checksum","subscribe"],"backgroundTag":"invalid-argument-format","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"}