{"record":{"id":"b3eb8149df7934fd","repo":"nautechsystems/nautilus_trader","slug":"dex-dex-type-is-not-registered-on-chain-b3eb81","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/sync.rs","lineNumber":53,"sourceCode":"    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\n        );\n    }\n\n    let postgres_connect_options = get_postgres_connect_options(\n        database.host,\n        database.port,\n        database.username,\n        database.password,\n        database.database,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/sync.rs#L35-L71","documentation":"Thrown by run_sync_dex when the DEX type passes name matching but get_dex_extended(chain.name, dex_type) returns None, i.e. the DEX is not registered on that chain. The guard exists because without a registration supporting pool discovery (PoolCreated log parsing), sync would silently find zero pools.","triggerScenarios":"run_blockchain_command -> run_sync_dex with a (chain, dex_type) pair absent from the extended registry, or a registry entry lacking supports_pool_discovery following immediately after this check.","commonSituations":"A DEX registered for discovery on chain A but requested on chain B; partially added new DEX; configuration drift after a registry update; typos in variant names resolving to an unregistered entry.","solutions":["Confirm the DEX is registered on this chain via get_dex_extended(chain.name, dex_type).","Choose a chain where the DEX is registered, or a DEX registered on this chain.","Complete the registry entry (registration plus PoolCreated discovery support) if it should work.","Double-check the DEX variant name for typos that match a different, unregistered entry."],"exampleFix":"// before\nnautilusctl blockchain sync-dex --chain avalanche --dex uniswap-v3  // not registered\n// after\nnautilusctl blockchain sync-dex --chain avalanche --dex trader-joe","handlingStrategy":"validation","validationCode":"match get_dex_extended(chain.name, &dex_type) {\n    Some(ext) if ext.supports_pool_discovery() => { /* ok to sync */ }\n    Some(_) => eprintln!(\"DEX registered but does not support pool discovery on {}\", chain.name),\n    None => eprintln!(\"DEX '{}' not registered on {}\", dex_type, chain.name),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Call get_dex_extended(chain.name, dex_type) and check supports_pool_discovery() before syncing.","Verify the registration exists for the exact target chain.","Complete registry entries (discovery support) when onboarding new DEXes.","Fail preflight on missing registrations rather than syncing to zero pools silently."],"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-14T00:17:10.932Z"}