{"record":{"id":"a9e88d168a5faac1","repo":"nautechsystems/nautilus_trader","slug":"pool-pool-identifier-not-found-in-cache","errorCode":null,"errorMessage":"Pool {pool_identifier} not found in cache","messagePattern":"Pool (.+?) not found in cache","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":314,"sourceCode":"        // Sync once up to the final checkpoint, honoring reset/from_block. Each checkpoint then\n        // bootstraps incrementally from the previous checkpoint's snapshot, so one pass produces\n        // every snapshot.\n        data_client\n            .sync_pool_events(\n                &dex_type,\n                pool_identifier,\n                from_block,\n                Some(last_checkpoint),\n                reset,\n            )\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to sync pool events: {e}\"))?;\n    }\n\n    let pool = data_client\n        .cache\n        .get_pool(&pool_identifier)\n        .ok_or_else(|| anyhow::anyhow!(\"Pool {pool_identifier} not found in cache\"))?\n        .clone();\n\n    let mut outcomes = Vec::with_capacity(checkpoints.len());\n    let mut rpc_profiler = None;\n\n    for checkpoint in checkpoints {\n        log::info!(\"Profiling pool {pool_identifier} to checkpoint block {checkpoint}\");\n        let (profiler, already_valid) = bootstrap_profiler_for_checkpoint(\n            data_client,\n            &pool,\n            checkpoint,\n            snapshot_from_rpc,\n            &mut rpc_profiler,\n        )\n        .await?;\n        let snapshot = profiler.extract_snapshot()?;\n        let snapshot_block_position = snapshot.block_position.clone();\n        let positions = snapshot.positions.len();","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L296-L332","documentation":"After syncing events, `analyze_pool_with_client` fetches the pool from the data client's in-memory cache (`cache.get_pool`). If the pool is absent after registration+sync, the code raises this error because analysis cannot proceed without the pool object.","triggerScenarios":"Running pool analysis where, despite registration succeeding, `cache.get_pool(&pool_identifier)` returns `None` — registration partially completed, sync produced no state that materializes the pool, or the identifier string mismatches the checksummed form used as the cache key.","commonSituations":"Passing a lowercase pool address while the cache stores the checksummed one (or vice versa); a sync that silently stored no pool events; analyzing a pool contract that isn't actually the given DEX type.","solutions":["Check the pool address matches exactly (case/checksum) the one used during registration.","Verify the pool exists on-chain for the configured chain and DEX type.","Re-run with a fresh database/cache state (`--reset` on sync) to rebuild the pool entry.","Inspect whether registration logged warnings indicating the pool failed to materialize."],"exampleFix":"// before\n--pool 0x123abc...  (lowercase)\n// after\n--pool 0x123AbC...  (checksummed as registered in cache)","handlingStrategy":"validation","validationCode":"// after sync, before analysis:\nif data_client.cache.get_pool(&pool_identifier).is_none() {\n    anyhow::bail!(\"pool {} missing after sync; check address/DEX match\", pool_identifier);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact (checksummed) pool address everywhere.","Confirm the pool contract matches the declared DEX type before analysis."],"tags":["blockchain","cache","resource-not-found","cli"],"backgroundTag":"resource-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"}