{"record":{"id":"f4fa8a9952a3591e","repo":"nautechsystems/nautilus_trader","slug":"dex-dex-type-on-chain-cannot-be-analyzed","errorCode":null,"errorMessage":"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.","messagePattern":"DEX '(.+?)' on chain '(.+?)' cannot be analyzed: missing pool-event parser\\(s\\) for (.+?)\\. Pool analysis needs Initialize, Swap, Mint, Burn, and Collect parsers\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":545,"sourceCode":"\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    }\n\n    Ok(())\n}\n\nfn rpc_http_url(chain: &Chain, rpc_url: Option<String>) -> anyhow::Result<String> {\n    rpc_url\n        .or_else(|| check_infura_rpc_provider(&chain.name))\n        .or_else(|| std::env::var(\"RPC_HTTP_URL\").ok())\n        .ok_or_else(|| {\n            anyhow::anyhow!(\n                \"No RPC URL provided for {}. Set --rpc-url, INFURA_API_KEY, or RPC_HTTP_URL\",\n                chain.name\n            )","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L527-L563","documentation":"Pool analysis requires event parsers for all five pool-event families: Initialize, Swap, Mint, Burn, and Collect. ensure_pool_analysis_supported checks the registry for the given DEX type on the chain and bails listing exactly which families are missing, because analysis would produce incomplete/incorrect results without them.","triggerScenarios":"Calling ensure_pool_analysis_supported (via parse_chain_dex) with a DEX type whose parser registrations on that chain are incomplete — e.g. a custom DEX registered with only Swap and Initialize parsers.","commonSituations":"Using a newly added or custom DEX adapter before all parsers are registered; a chain where the DEX's Collect/Mint events are not yet implemented; typo in --dex-type selecting the wrong DEX entry.","solutions":["Register the missing event parser family/families for the DEX on that chain before analysis (names are listed in the error)","Use a DEX type that has full parser coverage for the target chain","If you do not need full event coverage, use a lighter analysis command instead of pool analysis","Upgrade the CLI/adapter package — newer versions may ship the missing parsers"],"exampleFix":"// before\n// registry: only Initialize + Swap parsers for dex_type \"mydex\"\nanalyze --dex-type mydex ...\n// after\nregistry.register(\"mydex\", chain, MintParser::new(...));\nregistry.register(\"mydex\", chain, BurnParser::new(...));\nregistry.register(\"mydex\", chain, CollectParser::new(...));","handlingStrategy":"validation","validationCode":"REQUIRED_FAMILIES = {\"Initialize\", \"Swap\", \"Mint\", \"Burn\", \"Collect\"}\ndef check_dex_parsers(dex_type, chain, registry):\n    have = registry.registered_event_families(dex_type, chain)\n    missing = REQUIRED_FAMILIES - have\n    if missing:\n        raise ValueError(f\"{dex_type} on {chain}: missing parsers {sorted(missing)}\")","typeGuard":null,"tryCatchPattern":"try:\n    ensure_pool_analysis_supported(dex_type, chain)\nexcept ValueError as e:\n    print(e)  # lists exact missing parser families","preventionTips":["Register all five event parsers (Initialize, Swap, Mint, Burn, Collect) for every custom DEX","Prefer officially supported DEX types on chains with full adapter coverage","Run a parser-registry self-check at CLI startup for the selected chain/DEX","Keep adapter packages up to date so new parser families ship automatically"],"tags":["cli","blockchain","dex","parsers"],"backgroundTag":"missing-dependency","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"}