{"record":{"id":"1e6bced0717cb996","repo":"nautechsystems/nautilus_trader","slug":"dex-dex-id-is-not-registered-in-the-data-client","errorCode":null,"errorMessage":"DEX {dex_id} is not registered in the data client","messagePattern":"DEX (.+?) is not registered in the data client","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/core.rs","lineNumber":2397,"sourceCode":"                \"No database available, skipping event replay for pool {}\",\n                pool.instrument_id\n            );\n        }\n\n        Ok(())\n    }\n\n    /// Determines the starting block for syncing operations.\n    fn determine_from_block(&self) -> u64 {\n        self.config\n            .from_block\n            .unwrap_or_else(|| self.cache.min_dex_creation_block().unwrap_or(0))\n    }\n\n    /// Retrieves extended DEX information for a registered DEX.\n    fn get_dex_extended(&self, dex_id: &DexType) -> anyhow::Result<&DexExtended> {\n        if !self.cache.get_registered_dexes().contains(dex_id) {\n            anyhow::bail!(\"DEX {dex_id} is not registered in the data client\");\n        }\n\n        match get_dex_extended(self.chain.name, dex_id) {\n            Some(dex) => Ok(dex),\n            None => anyhow::bail!(\"Dex {dex_id} doesn't exist for chain {}\", self.chain.name),\n        }\n    }\n\n    /// Retrieves a pool from the cache by its address.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the pool is not registered in the cache.\n    pub fn get_pool(&self, pool_identifier: &PoolIdentifier) -> anyhow::Result<&SharedPool> {\n        match self.cache.get_pool(pool_identifier) {\n            Some(pool) => Ok(pool),\n            None => anyhow::bail!(\"Pool {pool_identifier} is not registered\"),\n        }","sourceCodeStart":2379,"sourceCodeEnd":2415,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/core.rs#L2379-L2415","documentation":"get_dex_extended first verifies that the requested DexType is present in the data client's registered DEX set and bails if not. This means the DEX was never registered with the client before use. Registration is a prerequisite for syncing pool events or building pool profilers for that DEX.","triggerScenarios":"Calling sync_pool_events, sync_exchange_pools, register_dex, construct_pool_profiler_from_hypersync_rpc (or triggering the related tests) with a DexType that was never added via the client's DEX registration path.","commonSituations":"Config lists a DEX the bootstrap never registered; typo in the DEX name in config; DEX registration for that chain was skipped or failed earlier; running a pool sync for a DEX supported on another chain but not registered on this one.","solutions":["Register the DEX with the data client before syncing (call the register_dex/bootstrap path for it)","Check config DEX names against the supported/registered DEX list for this chain","Inspect cache.get_registered_dexes() output to see what is actually registered","Fix startup ordering so DEX registration completes before pool event sync begins"],"exampleFix":"// before\ndata_client.sync_pool_events(dex_id, ...).await?;\n// after\nif !data_client.get_registered_dexes().contains(&dex_id) {\n    data_client.register_dex(dex_id).await?;\n}\ndata_client.sync_pool_events(dex_id, ...).await?;","handlingStrategy":"validation","validationCode":"if !client.get_registered_dexes().contains(&dex_id) {\n    return Err(anyhow!(\"dex {dex_id} must be registered before use\"));\n}","typeGuard":"fn is_registered(client: &DataClient, dex_id: &DexType) -> bool {\n    client.get_registered_dexes().contains(dex_id)\n}","tryCatchPattern":"match client.sync_pool_events(&dex_id, ...) {\n    Err(e) if e.to_string().contains(\"not registered\") => {\n        client.register_dex(&dex_id).await?;\n        client.sync_pool_events(&dex_id, ...).await?\n    }\n    other => other?,\n}","preventionTips":["Register all configured DEXes during client bootstrap","Validate config DEX names against the registered list at startup","Log the registered DEX set when a sync fails"],"tags":["blockchain","dex","registration","config"],"backgroundTag":"entity-not-found","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"}