{"record":{"id":"4ee1fdc3c8766bf3","repo":"nautechsystems/nautilus_trader","slug":"invalid-dex-name-case-insensitive-chain","errorCode":null,"errorMessage":"Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool analysis.","messagePattern":"Invalid DEX name '(.+?)' \\(case-insensitive\\)\\. Chain '(.+?)' is not supported for pool analysis\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":509,"sourceCode":"        .use_hypersync_for_live_data(true)\n        .postgres_cache_database_config(postgres_connect_options)\n        .build();\n    let cancellation_token = tokio_util::sync::CancellationToken::new();\n    let mut data_client = BlockchainDataClientCore::new(config, None, None, cancellation_token);\n    data_client.initialize_cache_database().await;\n    data_client.cache.initialize_chain().await;\n\n    Ok(data_client)\n}\n\nfn parse_chain_dex(chain: &str, dex: &str) -> anyhow::Result<(Chain, DexType)> {\n    let chain = Chain::from_chain_name(chain)\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid chain name: {chain}\"))?;\n\n    let dex_type = find_dex_type_case_insensitive(dex, chain).ok_or_else(|| {\n        let supported_dexes = get_supported_dexes_for_chain(chain.name);\n        if supported_dexes.is_empty() {\n            anyhow::anyhow!(\n                \"Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool analysis.\",\n                dex, chain.name\n            )\n        } else {\n            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","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L491-L527","documentation":"Thrown by parse_chain_dex in the nautilusctl blockchain analyze commands when the --dex argument does not match any DEX registered for the given chain, and the chain itself has no supported DEXes for pool analysis. It is a user-input validation error raised before any network or database work begins.","triggerScenarios":"Running `run_analyze_pool` or `run_analyze_pools` with a DEX name that is misspelled, wrongly cased beyond the case-insensitive match, or valid on some other chain but not the selected one, while get_supported_dexes_for_chain(chain.name) returns an empty list (the chain is not supported for pool analysis at all).","commonSituations":"Typing a DEX alias not in the registry (e.g. 'pancake' instead of 'pancakeswap-v2'); selecting a testnet/custom chain that has no pool-analysis support; copying a command from docs for a different chain.","solutions":["Check the chain name first: if it is not supported for pool analysis, pick a supported chain via Chain::from_chain_name.","Run the command with a valid DEX name; matching is case-insensitive so fix spelling against the supported list.","Call get_supported_dexes_for_chain(chain.name) or consult CLI help to list valid DEXes for the chain.","Verify the registry (get_dex_extended / supported DEX tables) actually includes the DEX for this chain; if it should, add a registration entry."],"exampleFix":"// before\nnautilusctl blockchain analyze-pool --chain base-sepia --dex uniswap-v3\n// error: chain not supported\n// after\nnautilusctl blockchain analyze-pool --chain base --dex uniswap-v3","handlingStrategy":"validation","validationCode":"let supported = get_supported_dexes_for_chain(chain.name);\nif supported.is_empty() {\n    return Err(format!(\"chain '{}' is not supported for pool analysis\", chain.name));\n}\nif !supported.iter().any(|d| d.eq_ignore_ascii_case(dex)) {\n    return Err(format!(\"dex '{}' not in [{}]\", dex, supported.join(\", \")));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call get_supported_dexes_for_chain(chain.name) before invoking and validate the DEX name case-insensitively.","Validate the chain first; an unsupported chain is the root cause in this branch.","Use CLI tab-completion or help output rather than hand-typed DEX names.","Keep chain/DEX pairs in scripts as constants copied from a verified working command."],"tags":["cli","validation","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}