{"record":{"id":"2b22f870637cb1ca","repo":"nautechsystems/nautilus_trader","slug":"invalid-pool-swap-address-failed-with-error","errorCode":null,"errorMessage":"Invalid pool swap address '{}' failed with error: {:?}","messagePattern":"Invalid pool swap address '(.+?)' failed with error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/client.rs","lineNumber":628,"sourceCode":"                } else {\n                    anyhow::bail!(\n                        \"Invalid venue {}, expected Blockchain DEX format\",\n                        cmd.instrument_id.venue\n                    )\n                }\n\n                Ok(())\n            }\n            DefiSubscribeCommand::PoolSwaps(cmd) => {\n                log::debug!(\n                    \"Processing subscribe pool swaps 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 swap address '{}' failed with error: {:?}\",\n                                cmd.instrument_id,\n                                e\n                            )\n                        })?;\n                    core_client\n                        .subscription_manager\n                        .subscribe_swaps(dex, pool_address);\n                    Self::update_rpc_pool_event_subscriptions(core_client, dex).await?;\n                    Self::update_hypersync_pool_event_stream(core_client, dex).await?;\n                } else {\n                    anyhow::bail!(\n                        \"Invalid venue {}, expected Blockchain DEX format\",\n                        cmd.instrument_id.venue\n                    )\n                }\n\n                Ok(())","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/client.rs#L610-L646","documentation":"Thrown in `handle_subscribe_command` when the symbol of a pool-swaps subscribe command fails `validate_address` (missing 0x prefix, wrong length, invalid hex, or bad EIP-55 checksum). It aborts the swap subscription for that instrument_id.","triggerScenarios":"Issuing a PoolSwaps subscribe command whose `instrument_id.symbol` is not a checksummed 42-character 0x pool address.","commonSituations":"Lowercase addresses copied from block explorers; symbol fields populated with token names; addresses built programmatically without checksum encoding.","solutions":["Supply the pool address in checksummed form as the instrument symbol before subscribing to swaps.","Run the address through checksum validation (`Address::parse_checksummed`) or an equivalent checker first.","Ensure no surrounding whitespace/characters are concatenated into the symbol.","Verify the correct DEX pool contract address for the venue being used."],"exampleFix":"// before\n\"0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640\".to_string()\n// after\n\"0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640\".to_string()","handlingStrategy":"validation","validationCode":"// Rust\nlet addr = Address::parse_checksummed(symbol, None)\n    .context(\"symbol must be an EIP-55 checksummed pool address\")?;","typeGuard":null,"tryCatchPattern":"if let Err(e) = Address::parse_checksummed(symbol, None) {\n    return Err(anyhow::anyhow!(\"swap subscribe aborted: invalid pool address '{symbol}': {e}\"));\n}","preventionTips":["Normalize addresses to checksum form when received from any source (explorer URLs are lowercase).","Add a unit test asserting every instrument symbol in your config passes Address::parse_checksummed.","Ensure serialization round-trips preserve address casing.","Verify you are using the pool contract, not a token contract."],"tags":["ethereum","address-validation","checksum","swap-subscription"],"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"}