nautechsystems/nautilus_trader · error · anyhow::Error

DEX '{dex_type}' is not registered on chain '{}'

Error message

DEX '{dex_type}' is not registered on chain '{}'

What it means

Thrown by run_sync_dex when the DEX type passes name matching but get_dex_extended(chain.name, dex_type) returns None, i.e. the DEX is not registered on that chain. The guard exists because without a registration supporting pool discovery (PoolCreated log parsing), sync would silently find zero pools.

Source

Thrown at crates/cli/src/blockchain/sync.rs:53

    reset: bool,
    multicall_calls_per_rpc_request: Option<u32>,
) -> anyhow::Result<()> {
    let chain = Chain::from_chain_name(&chain)
        .ok_or_else(|| anyhow::anyhow!("Invalid chain name: {chain}"))?;

    let dex_type = find_dex_type_case_insensitive(&dex, chain).ok_or_else(|| {
        let supported_dexes = get_supported_dexes_for_chain(chain.name);
        if supported_dexes.is_empty() {
            anyhow::anyhow!("Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool syncing.",dex, chain.name)
        } else {
            anyhow::anyhow!("Invalid DEX name '{}' (case-insensitive). Supported DEXes for chain '{}': {}",dex,chain.name,supported_dexes.join(", "))
        }
    })?;

    // Fail before connecting to the RPC/database when the DEX cannot discover pools from
    // PoolCreated logs; without a parser sync-dex would otherwise find zero pools silently.
    let dex_extended = get_dex_extended(chain.name, &dex_type).ok_or_else(|| {
        anyhow::anyhow!(
            "DEX '{dex_type}' is not registered on chain '{}'",
            chain.name
        )
    })?;

    if !dex_extended.supports_pool_discovery() {
        anyhow::bail!(
            "DEX '{dex_type}' on chain '{}' cannot be synced: missing a PoolCreated parser for pool discovery.",
            chain.name
        );
    }

    let postgres_connect_options = get_postgres_connect_options(
        database.host,
        database.port,
        database.username,
        database.password,
        database.database,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Confirm the DEX is registered on this chain via get_dex_extended(chain.name, dex_type).
  2. Choose a chain where the DEX is registered, or a DEX registered on this chain.
  3. Complete the registry entry (registration plus PoolCreated discovery support) if it should work.
  4. Double-check the DEX variant name for typos that match a different, unregistered entry.

Example fix

// before
nautilusctl blockchain sync-dex --chain avalanche --dex uniswap-v3  // not registered
// after
nautilusctl blockchain sync-dex --chain avalanche --dex trader-joe
Defensive patterns

Strategy: validation

Validate before calling

match get_dex_extended(chain.name, &dex_type) {
    Some(ext) if ext.supports_pool_discovery() => { /* ok to sync */ }
    Some(_) => eprintln!("DEX registered but does not support pool discovery on {}", chain.name),
    None => eprintln!("DEX '{}' not registered on {}", dex_type, chain.name),
}

Prevention

When it happens

Trigger: run_blockchain_command -> run_sync_dex with a (chain, dex_type) pair absent from the extended registry, or a registry entry lacking supports_pool_discovery following immediately after this check.

Common situations: A DEX registered for discovery on chain A but requested on chain B; partially added new DEX; configuration drift after a registry update; typos in variant names resolving to an unregistered entry.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/b3eb8149df7934fd. Report an issue: GitHub.