{"record":{"id":"3686fa8d228c9cc7","repo":"nautechsystems/nautilus_trader","slug":"unknown-pool-instrument-id-not-found-in-the-sha","errorCode":null,"errorMessage":"Unknown pool {instrument_id}; not found in the shared engine cache","messagePattern":"Unknown pool (.+?); not found in the shared engine cache","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":830,"sourceCode":"\n        if dex_type != DexType::UniswapV3 {\n            anyhow::bail!(\"Unsupported DEX type {dex_type}; only UniswapV3 is supported\");\n        }\n\n        let pool_identifier = PoolIdentifier::new_checked(instrument_id.symbol.as_str())?;\n        if !pool_identifier.is_address() {\n            anyhow::bail!(\n                \"Pool identifier {pool_identifier} is a pool ID; only address identifiers are supported\"\n            );\n        }\n\n        let pool = self\n            .core\n            .cache()\n            .pool(instrument_id)\n            .cloned()\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Unknown pool {instrument_id}; not found in the shared engine cache\"\n                )\n            })?;\n\n        if pool.token0.get_token_priority() == pool.token1.get_token_priority() {\n            anyhow::bail!(\n                \"Pool {instrument_id} tokens share a token priority; base and quote orientation is ambiguous\"\n            );\n        }\n\n        Ok(pool)\n    }\n\n    /// Authenticates every persisted signed transaction in this execution database.\n    ///\n    /// Run this while the execution client is disconnected. The check takes a stable table lock,\n    /// reads in bounded batches, and returns counts, deployment identity, key IDs, and database\n    /// roles with direct ownership or `SELECT` grants.","sourceCodeStart":812,"sourceCodeEnd":848,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L812-L848","documentation":"Pool resolution reads the shared engine cache for the Pool object associated with the instrument id. If the cache has no entry for that instrument, the client cannot proceed (it needs token0/token1 and pool state) and raises this error.","triggerScenarios":"Calling preflight, restore_swap_plan, or prepare_swap with an instrument_id whose pool was never loaded into the engine cache — e.g., no data subscription for the pool, cache cleared, or the instrument id is wrong.","commonSituations":"Bot started without subscribing to the pool's market data so the pool object was never cached; instrument id constructed with wrong venue/instrument symbol; engine restarted and cache not warmed before swap operations.","solutions":["Ensure the engine subscribes to / loads the pool into the cache before calling prepare_swap or preflight","Verify the instrument_id matches the pool instrument exactly (venue, symbol, tick size)","Warm the cache at startup (load pool instruments) prior to restoring swap plans"],"exampleFix":"// before\nclient.prepare_swap(instrument_id).await?; // pool never cached\n// after\nengine.cache().add_pool(pool); // or subscribe to the pool first\nclient.prepare_swap(instrument_id).await?;","handlingStrategy":"validation","validationCode":"if engine.cache().pool(instrument_id).is_none() {\n    return Err(format!(\"pool {} not cached; subscribe/load it first\", instrument_id));\n}","typeGuard":null,"tryCatchPattern":"match client.prepare_swap(instrument_id).await {\n    Err(e) if e.to_string().contains(\"not found in the shared engine cache\") => {\n        // warm the cache / fix instrument id, then retry once\n    }\n    other => other?,\n}","preventionTips":["Warm the cache with all pool instruments at startup before accepting swap commands","Subscribe to pool data so the cache stays populated","Validate instrument_id construction (venue/symbol) against the manifest"],"tags":["cache","state","blockchain","instrument"],"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"}