{"record":{"id":"5a579df96976f58d","repo":"nautechsystems/nautilus_trader","slug":"invalid-pool-flash-address","errorCode":null,"errorMessage":"Invalid pool flash address: {}","messagePattern":"Invalid pool flash address: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/client.rs","lineNumber":886,"sourceCode":"                } else {\n                    anyhow::bail!(\n                        \"Invalid venue {}, expected Blockchain DEX format\",\n                        cmd.instrument_id.venue\n                    )\n                }\n\n                Ok(())\n            }\n            DefiUnsubscribeCommand::PoolFlashEvents(cmd) => {\n                log::debug!(\n                    \"Processing unsubscribe pool flash 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(|_| {\n                            anyhow::anyhow!(\"Invalid pool flash address: {}\", cmd.instrument_id)\n                        })?;\n                    core_client\n                        .subscription_manager\n                        .unsubscribe_flashes(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(())\n            }\n        }\n    }\n","sourceCodeStart":868,"sourceCodeEnd":904,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/client.rs#L868-L904","documentation":"Thrown in handle_unsubscribe_command when the symbol portion of a BlockchainDataInstrumentId cannot be validated as an Ethereum address. The adapter treats the instrument symbol as a pool contract address and uses validate_address (checksum/hex format check) before calling unsubscribe_flashes; any malformed symbol aborts the unsubscribe with this anyhow error wrapping the full instrument id.","triggerScenarios":"Calling data_client.unsubscribe() (handle_unsubscribe_command path) with an instrument id whose venue parses as a DEX (e.g. 'ETH/UNI-V3@BASE') but whose symbol is not a valid 0x-hex 20-byte address — wrong checksum casing, truncated address, or a human-readable ticker instead of a contract address.","commonSituations":"Config files using venue-style symbols like 'USDC/WETH' instead of a pool contract address; addresses copied without the 0x prefix or with wrong EIP-55 checksum; lowercased addresses when the validator enforces checksums.","solutions":["Pass the pool's contract address as the instrument symbol, e.g. '0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640', not a ticker pair.","Verify the address format: 0x + 40 hex chars with correct EIP-55 checksum, using the same validate_address helper or a checksum tool.","Confirm the instrument id was built by the same adapter that created the subscription (venue must still parse_dex successfully).","Check for truncated or whitespace-padded addresses in config files or instrument id strings."],"exampleFix":"// before\nlet instrument_id = InstrumentId::from(\"USDC/WETH.UNI-V3@BASE\");\ndata_client.unsubscribe(instrument_id);\n\n// after\nlet instrument_id = InstrumentId::from(\n    \"0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640.UNI-V3@BASE\",\n);","handlingStrategy":"validation","validationCode":"fn is_valid_pool_symbol(instrument_id: &InstrumentId) -> bool {\n    let s = instrument_id.symbol.as_str();\n    s.starts_with(\"0x\") && s.len() == 42 && s[2..].chars().all(|c| c.is_ascii_hexdigit())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use contract addresses as instrument symbols for DEX flash subscriptions, never ticker pairs","Checksum addresses (EIP-55) at configuration load time","Build instrument ids via the adapter's own factory helpers"],"tags":["blockchain","address-validation","unsubscribe"],"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-14T00:17:10.932Z"}