{"record":{"id":"8c1537c33006d205","repo":"nautechsystems/nautilus_trader","slug":"dex-dex-type-on-chain-cannot-be-synced-m","errorCode":null,"errorMessage":"DEX '{dex_type}' on chain '{}' cannot be synced: missing a PoolCreated parser for pool discovery.","messagePattern":"DEX '(.+?)' on chain '(.+?)' cannot be synced: missing a PoolCreated parser for pool discovery\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/sync.rs","lineNumber":60,"sourceCode":"        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,\n    );\n    // Get RPC HTTP URL: CLI arg, Infura provider, OR RPC_HTTP_URL env var\n    let rpc_http_url = 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!(","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/sync.rs#L42-L78","documentation":"`run_sync_dex` syncs a DEX's pools by replaying PoolCreated events. Before starting, it checks `supports_pool_discovery()` on the registered DEX; if no PoolCreated parser is implemented for that DEX/chain, pool discovery is impossible and the sync is aborted with this bail instead of silently producing zero pools.","triggerScenarios":"Calling `blockchain sync` (or `run_sync_dex` via `run_blockchain_command`) for a DEX type that is registered on the chain but lacks a PoolCreated event parser implementation.","commonSituations":"Adding a new DEX integration before implementing its discovery parser; typo'd or newly-added `dex_type` value mapped to a stub; a chain config that registers an unsupported DEX variant.","solutions":["Implement the PoolCreated parser for the DEX and register it so `supports_pool_discovery()` returns true","Choose a different `--dex` value that already supports pool discovery","Seed pools for that DEX by another means (manual registration/import) instead of event-based sync","Verify the dex_type string matches a fully implemented integration"],"exampleFix":"// before\n// no PoolCreated parser registered for DexKind::MyDex\n// after\nimpl PoolCreatedParser for MyDexParser { /* decode PoolCreated event */ }\nregistry.register_parser(DexKind::MyDex, MyDexParser);","handlingStrategy":"validation","validationCode":"if !dex_extended.supports_pool_discovery() {\n    eprintln!(\"DEX {:?} has no PoolCreated parser; choose another DEX or implement the parser\", dex_type);\n}","typeGuard":null,"tryCatchPattern":"match run_sync_dex(&chain, dex_type).await {\n    Err(e) if e.to_string().contains(\"PoolCreated\") => eprintln!(\"sync unsupported for this DEX: {e}\"),\n    other => other?,\n}","preventionTips":["Confirm the DEX integration is complete before syncing","Check registered parsers for the dex_type value","Seed pools manually for DEXes without discovery support"],"tags":["blockchain","dex","sync","missing-feature"],"backgroundTag":"feature-not-enabled","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"}