{"record":{"id":"4c5fc6e594b5d332","repo":"nautechsystems/nautilus_trader","slug":"pool-pool-identifier-is-not-registered","errorCode":null,"errorMessage":"Pool {pool_identifier} is not registered","messagePattern":"Pool (.+?) is not registered","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/data/core.rs","lineNumber":2414,"sourceCode":"        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        }\n    }\n\n    /// Sends a data event to all subscribers through the data channel.\n    pub fn send_data(&self, data: DataEvent) {\n        if let Some(data_tx) = &self.data_tx {\n            log::debug!(\"Sending {data}\");\n\n            if let Err(e) = data_tx.send(data) {\n                log::error!(\"Failed to send data: {e}\");\n            }\n        } else {\n            log::error!(\"No data event channel for sending data\");\n        }\n    }\n\n    /// Disconnects all active connections and cleanup resources.\n    ///","sourceCodeStart":2396,"sourceCodeEnd":2432,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/core.rs#L2396-L2432","documentation":"get_pool is a public accessor that returns the SharedPool registered in the cache for the given PoolIdentifier, and bails when no pool with that identifier exists. Callers must ensure the pool was discovered/registered (e.g. via a PoolCreated event or explicit registration) before querying it.","triggerScenarios":"Calling get_pool (typically from sync_pool_events) with a PoolIdentifier whose pool was never registered in the cache — e.g. a swap/mint log arrives for a pool created before the client's discovery start block, or the identifier address has a checksum/format mismatch.","commonSituations":"Syncing events from before the DEX/pool registration start block; a pool address from config that was never discovered; address casing or checksum differences between the identifier and registration; the pool was evicted or the cache was reset.","solutions":["Ensure the pool is registered first (discovery sync / register call) before syncing its events","Set the discovery start block to cover all pools you will query","Normalize pool addresses (checksum/case) before constructing the PoolIdentifier","Check cache.get_pool with the same identifier interactively to confirm what is registered"],"exampleFix":"// before\nlet pool = data_client.get_pool(&pool_identifier)?;\n// after\nlet pool = match data_client.get_pool(&pool_identifier) {\n    Ok(pool) => pool,\n    Err(_) => {\n        data_client.register_pool(&pool_identifier).await?;\n        data_client.get_pool(&pool_identifier)?\n    }\n};","handlingStrategy":"validation","validationCode":"if client.get_pool(&pool_identifier).is_err() {\n    return Err(anyhow!(\"pool {pool_identifier} must be registered before use\"));\n}","typeGuard":"fn pool_registered(client: &DataClient, id: &PoolIdentifier) -> bool {\n    client.get_pool(id).is_ok()\n}","tryCatchPattern":"match client.get_pool(&pool_identifier) {\n    Ok(pool) => pool,\n    Err(_) => { client.register_pool(&pool_identifier).await?; client.get_pool(&pool_identifier)? }\n}","preventionTips":["Run pool discovery before event sync","Set discovery start blocks early enough to cover all pools","Normalize address casing/checksums when building PoolIdentifier"],"tags":["blockchain","pool","cache","not-found"],"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-14T05:17:10.506Z"}