{"record":{"id":"9d149cc38a7d1e83","repo":"nautechsystems/nautilus_trader","slug":"dex-dex-type-is-not-registered-on-chain","errorCode":null,"errorMessage":"DEX '{dex_type}' is not registered on chain '{}'","messagePattern":"DEX '(.+?)' is not registered on chain '(.+?)'","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":532,"sourceCode":"            anyhow::anyhow!(\n                \"Invalid DEX name '{}' (case-insensitive). Supported DEXes for chain '{}': {}\",\n                dex,\n                chain.name,\n                supported_dexes.join(\", \")\n            )\n        }\n    })?;\n\n    ensure_pool_analysis_supported(chain, dex_type)?;\n\n    Ok((chain.to_owned(), dex_type))\n}\n\n// A DEX can be registered for discovery yet lack the analysis parsers; fail here instead of\n// syncing and only failing deep inside profiling.\nfn ensure_pool_analysis_supported(chain: &Chain, dex_type: DexType) -> anyhow::Result<()> {\n    let dex_extended = get_dex_extended(chain.name, &dex_type).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"DEX '{dex_type}' is not registered on chain '{}'\",\n            chain.name\n        )\n    })?;\n\n    let missing = dex_extended.missing_pool_analysis_parsers();\n    if !missing.is_empty() {\n        let families = missing\n            .iter()\n            .map(ToString::to_string)\n            .collect::<Vec<_>>()\n            .join(\", \");\n        anyhow::bail!(\n            \"DEX '{dex_type}' on chain '{}' cannot be analyzed: missing pool-event parser(s) for {families}. \\\n             Pool analysis needs Initialize, Swap, Mint, Burn, and Collect parsers.\",\n            chain.name\n        );\n    }","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L514-L550","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the DEX is registered for this exact chain via get_dex_extended(chain.name, dex_type); the name match alone is not enough.","Pick a chain on which the DEX is registered, or a DEX registered on this chain.","Complete the registry entry for the DEX on the chain (including missing_pool_analysis_parsers coverage) if it should be supported.","Check for typos or aliases in the DEX name that resolve to an unregistered variant."],"exampleFix":"// before\nensure_pool_analysis_supported(&chain, DexType::UniswapV4) // not registered on this chain\n// after\nensure_pool_analysis_supported(&chain, DexType::UniswapV3) // registered","handlingStrategy":"validation","validationCode":"if get_dex_extended(chain.name, &dex_type).is_none() {\n    return Err(format!(\"DEX '{}' is not registered on chain {}\", dex_type, chain.name));\n}\nif let Some(ext) = get_dex_extended(chain.name, &dex_type) {\n    let missing = ext.missing_pool_analysis_parsers();\n    if !missing.is_empty() {\n        return Err(format!(\"missing analysis parsers: {:?}\", missing));\n    }\n}","typeGuard":null,"tryCatchPattern":"match ensure_pool_analysis_supported(&chain, dex_type) {\n    Ok(()) => { /* proceed */ }\n    Err(e) => { eprintln!(\"{e:#}\"); std::process::exit(2); } // fail fast before syncing/profiling\n}","preventionTips":["Verify get_dex_extended(chain.name, dex_type) returns Some before analysis.","Remember name matching success does not imply registration; check per-chain.","After adding a DEX, register it for every chain you intend to analyze.","Surface missing_pool_analysis_parsers at startup rather than mid-profiling."],"tags":["cli","registry","configuration"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}