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 ensure_pool_analysis_supported when a DEX type passes name matching but get_dex_extended returns None, meaning the DEX is not registered on that chain. This fails fast instead of syncing and only failing deep inside profiling; a registration may also lack analysis parsers.

Source

Thrown at crates/cli/src/blockchain/analyze.rs:532

            anyhow::anyhow!(
                "Invalid DEX name '{}' (case-insensitive). Supported DEXes for chain '{}': {}",
                dex,
                chain.name,
                supported_dexes.join(", ")
            )
        }
    })?;

    ensure_pool_analysis_supported(chain, dex_type)?;

    Ok((chain.to_owned(), dex_type))
}

// A DEX can be registered for discovery yet lack the analysis parsers; fail here instead of
// syncing and only failing deep inside profiling.
fn ensure_pool_analysis_supported(chain: &Chain, dex_type: DexType) -> anyhow::Result<()> {
    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
        )
    })?;

    let missing = dex_extended.missing_pool_analysis_parsers();
    if !missing.is_empty() {
        let families = missing
            .iter()
            .map(ToString::to_string)
            .collect::<Vec<_>>()
            .join(", ");
        anyhow::bail!(
            "DEX '{dex_type}' on chain '{}' cannot be analyzed: missing pool-event parser(s) for {families}. \
             Pool analysis needs Initialize, Swap, Mint, Burn, and Collect parsers.",
            chain.name
        );
    }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the DEX is registered for this exact chain via get_dex_extended(chain.name, dex_type); the name match alone is not enough.
  2. Pick a chain on which the DEX is registered, or a DEX registered on this chain.
  3. Complete the registry entry for the DEX on the chain (including missing_pool_analysis_parsers coverage) if it should be supported.
  4. Check for typos or aliases in the DEX name that resolve to an unregistered variant.

Example fix

// before
ensure_pool_analysis_supported(&chain, DexType::UniswapV4) // not registered on this chain
// after
ensure_pool_analysis_supported(&chain, DexType::UniswapV3) // registered
Defensive patterns

Strategy: validation

Validate before calling

if get_dex_extended(chain.name, &dex_type).is_none() {
    return Err(format!("DEX '{}' is not registered on chain {}", dex_type, chain.name));
}
if let Some(ext) = get_dex_extended(chain.name, &dex_type) {
    let missing = ext.missing_pool_analysis_parsers();
    if !missing.is_empty() {
        return Err(format!("missing analysis parsers: {:?}", missing));
    }
}

Try / catch

match ensure_pool_analysis_supported(&chain, dex_type) {
    Ok(()) => { /* proceed */ }
    Err(e) => { eprintln!("{e:#}"); std::process::exit(2); } // fail fast before syncing/profiling
}

Prevention

When it happens

Trigger: Calling parse_chain_dex or ensure_pool_analysis_supported_rejects_dex_without_parsers with a (chain, dex_type) pair absent from the extended DEX registry, e.g. after partially registering a DEX for discovery but not analysis.

Common situations: A newly added DEX was registered for one chain but the code path targets another chain; configuration points at a DEX/chain combination removed or never added to the registry; a partially configured custom chain.

Related errors


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