nautechsystems/nautilus_trader · error

Invalid pool address: {}

Error message

Invalid pool address: {}

What it means

Thrown in `handle_unsubscribe_command` when the pool address in an unsubscribe (all pool events) command fails `validate_address`. The symbol portion of the instrument_id must be a valid checksummed Ethereum address to be converted into an `Address`.

Source

Thrown at crates/adapters/blockchain/src/data/client.rs:757

    ) -> anyhow::Result<()> {
        match command {
            DefiUnsubscribeCommand::Blocks(_cmd) => {
                log::debug!("Processing unsubscribe blocks command");

                Self::unsubscribe_block_feed(core_client, BlockFeedOwner::Explicit).await?;

                Ok(())
            }
            DefiUnsubscribeCommand::Pool(cmd) => {
                log::debug!(
                    "Processing unsubscribe pool command for {}",
                    cmd.instrument_id
                );

                if let Ok((_, dex)) = cmd.instrument_id.venue.parse_dex() {
                    let pool_address = validate_address(cmd.instrument_id.symbol.as_str())
                        .map_err(|_| {
                            anyhow::anyhow!("Invalid pool address: {}", cmd.instrument_id)
                        })?;

                    // Unsubscribe from all pool event types
                    core_client
                        .subscription_manager
                        .unsubscribe_swaps(dex, pool_address);
                    core_client
                        .subscription_manager
                        .unsubscribe_burns(dex, pool_address);
                    core_client
                        .subscription_manager
                        .unsubscribe_mints(dex, pool_address);
                    core_client
                        .subscription_manager
                        .unsubscribe_collects(dex, pool_address);
                    core_client
                        .subscription_manager
                        .unsubscribe_flashes(dex, pool_address);

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Pass the same checksummed pool address used at subscribe time into the unsubscribe command.
  2. Fix the address casing/length/hex before unsubscribing.
  3. Validate the address client-side before sending the command.
  4. Check that the instrument_id was constructed in `symbol@venue` form with the address as the symbol.

Example fix

// before
InstrumentId::from("0xb4e16d0168e52d35cacd2c6185b44281ec28c9ed@Uniswap")
// after
InstrumentId::from("0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Ed@Uniswap")
Defensive patterns

Strategy: validation

Validate before calling

// Rust
if !Address::parse_checksummed(symbol, None).is_ok() {
    anyhow::bail!("unsubscribe skipped: '{symbol}' is not a checksummed pool address");
}

Try / catch

match Address::parse_checksummed(symbol, None) {
    Ok(addr) => unsubscribe_all_pool_events(dex, addr),
    Err(e) => log::warn!("Skipping unsubscribe for '{instrument_id}': {e}"),
}

Prevention

When it happens

Trigger: Unsubscribing from all pool events with a command whose `instrument_id.symbol` is not a checksummed 0x address.

Common situations: Unsubscribe requests built from stale or hand-edited subscription state; symbols that were normalized to lowercase somewhere in the pipeline; placeholder addresses in config files.

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/672a9bdc67b4900e. Report an issue: GitHub.