nautechsystems/nautilus_trader · error · anyhow::Error
Invalid pool fee collect address: {}
Error message
Invalid pool fee collect address: {} What it means
Thrown in `handle_subscribe_command` when the pool address given for a fee-collect (collect-fees) subscription fails `validate_address`. The symbol of the instrument_id must be a valid, checksummed 0x Ethereum address.
Source
Thrown at crates/adapters/blockchain/src/data/client.rs:685
} else {
anyhow::bail!(
"Invalid venue {}, expected Blockchain DEX format",
cmd.instrument_id.venue
)
}
Ok(())
}
DefiSubscribeCommand::PoolFeeCollects(cmd) => {
log::debug!(
"Processing subscribe pool fee collects command for address: {}",
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 fee collect address: {}",
cmd.instrument_id
)
})?;
core_client
.subscription_manager
.subscribe_collects(dex, pool_address);
Self::update_rpc_pool_event_subscriptions(core_client, dex).await?;
Self::update_hypersync_pool_event_stream(core_client, dex).await?;
} else {
anyhow::bail!(
"Invalid venue {}, expected Blockchain DEX format",
cmd.instrument_id.venue
)
}
Ok(())
}View on GitHub (pinned to 18893faf8b)
Solutions
- Provide the pool contract address in EIP-55 checksummed format as the symbol.
- Recompute the checksum casing for the address before subscribing.
- Double-check you are using the pool address, not a related contract (position manager, factory).
- Trim whitespace and any venue suffix from the address string.
Example fix
// before "factory-0x1f98431c8ad98523631ae4a59f267346ea31f984" // after "0x1F98431c8aD98523631AE4a59f267346ea31F984"
Defensive patterns
Strategy: validation
Validate before calling
// Rust
let addr = Address::from_str(symbol)
.ok()
.filter(|_| Address::parse_checksummed(symbol, None).is_ok())
.ok_or_else(|| anyhow!("'{symbol}' is not a checksummed pool address"))?; Try / catch
match Address::parse_checksummed(symbol, None) {
Ok(addr) => subscribe_fee_collect(dex, addr),
Err(e) => return Err(anyhow!("fee-collect subscribe rejected for '{symbol}': {e}")),
} Prevention
- Beware tools that lowercase JSON/spreadsheet data — re-checksum after any round-trip.
- Use the pool address, not the factory or position manager address.
- Validate addresses at config load time with a startup assertion.
- Document that instrument symbols for DEX data must be checksummed pool addresses.
When it happens
Trigger: A pool fee-collect subscribe command whose `instrument_id.symbol` lacks the 0x prefix, has the wrong length, contains non-hex characters, or fails EIP-55 checksum verification.
Common situations: Address case mangled by spreadsheet/JSON round-trips that lowercased it; typos producing invalid hex; using a position manager or NFT address rather than the pool address.
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
- Invalid pool address '{}' failed with error: {:?}
- Invalid pool swap address: {}
- Invalid pool flash subscribe address: {}
- Invalid pool swap address '{}' failed with error: {:?}
- Invalid pool address: {}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/ce31551b110de789.
Report an issue: GitHub.