{"record":{"id":"dad435e7d0754c42","repo":"nautechsystems/nautilus_trader","slug":"invalid-dex-name-case-insensitive-chain-dad435","errorCode":null,"errorMessage":"Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool syncing.","messagePattern":"Invalid DEX name '(.+?)' \\(case-insensitive\\)\\. Chain '(.+?)' is not supported for pool syncing\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/sync.rs","lineNumber":44,"sourceCode":"use nautilus_model::defi::chain::Chain;\n\nuse crate::opt::DatabaseConfig;\n\npub(crate) async fn run_sync_dex(\n    chain: String,\n    dex: String,\n    rpc_url: Option<String>,\n    database: DatabaseConfig,\n    reset: bool,\n    multicall_calls_per_rpc_request: Option<u32>,\n) -> anyhow::Result<()> {\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!(\"Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool syncing.\",dex, chain.name)\n        } else {\n            anyhow::anyhow!(\"Invalid DEX name '{}' (case-insensitive). Supported DEXes for chain '{}': {}\",dex,chain.name,supported_dexes.join(\", \"))\n        }\n    })?;\n\n    // Fail before connecting to the RPC/database when the DEX cannot discover pools from\n    // PoolCreated logs; without a parser sync-dex would otherwise find zero pools silently.\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    if !dex_extended.supports_pool_discovery() {\n        anyhow::bail!(\n            \"DEX '{dex_type}' on chain '{}' cannot be synced: missing a PoolCreated parser for pool discovery.\",\n            chain.name","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/sync.rs#L26-L62","documentation":"Thrown by run_sync_dex when the DEX name does not match any DEX registered for the resolved chain and the chain has no supported DEXes for pool syncing at all. Raised before any RPC or database connection is made.","triggerScenarios":"run_blockchain_command -> run_sync_dex with a --dex value failing find_dex_type_case_insensitive while get_supported_dexes_for_chain(chain.name) is empty (chain unsupported for pool syncing).","commonSituations":"Targeting a chain with no sync-capable DEX registry entries; typo in DEX name on an otherwise-unsupported chain; copying a sync command written for a different chain.","solutions":["Switch to a chain that supports pool syncing (non-empty supported DEX list).","Correct the DEX name; matching is case-insensitive so fix spelling.","List valid DEXes with get_supported_dexes_for_chain(chain.name) before running.","Register the DEX for the chain if it should be supported."],"exampleFix":"// before\nnautilusctl blockchain sync-dex --chain sepolia --dex uniswap-v2\n// after\nnautilusctl blockchain sync-dex --chain ethereum --dex uniswap-v2","handlingStrategy":"validation","validationCode":"let supported = get_supported_dexes_for_chain(chain.name);\nif supported.is_empty() {\n    eprintln!(\"chain '{}' not supported for pool syncing\", chain.name);\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the chain supports pool syncing before choosing a DEX.","Validate the DEX name case-insensitively against the per-chain list first.","Do not reuse sync commands across chains without rechecking the pairs.","Catch the anyhow error at the CLI boundary and show the actionable message."],"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-14T05:17:10.506Z"}