{"record":{"id":"08fc50b9872a9678","repo":"nautechsystems/nautilus_trader","slug":"pool-profiler-for-instrument-id-has-processed-no","errorCode":null,"errorMessage":"Pool profiler for {instrument_id} has processed no events","messagePattern":"Pool profiler for (.+?) has processed no events","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1249,"sourceCode":"            .core\n            .cache()\n            .pool_profiler(&instrument_id)\n            .cloned()\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"No pool profiler for {instrument_id}; an active data subscription is required to quote the swap\"\n                )\n            })?;\n\n        if !profiler.is_initialized {\n            anyhow::bail!(\"Pool profiler for {instrument_id} is not initialized\");\n        }\n        let profiler_block = profiler\n            .last_processed_event\n            .as_ref()\n            .map(|position| position.number)\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"Pool profiler for {instrument_id} has processed no events\")\n            })?;\n\n        let zero_for_one = base_token.address == pool.token0.address;\n        let quote = profiler\n            .swap_exact_in(amount_in, zero_for_one, None)\n            .map_err(|e| anyhow::anyhow!(\"Swap quote failed for {instrument_id}: {e}\"))?;\n\n        let amount_filled = if zero_for_one {\n            quote.amount0\n        } else {\n            quote.amount1\n        };\n\n        if amount_filled != I256::from(amount_in) {\n            anyhow::bail!(\n                \"Local quote for {instrument_id} filled {amount_filled} of the {amount_in} order amount; pool liquidity cannot fill the order\"\n            );\n        }","sourceCodeStart":1231,"sourceCodeEnd":1267,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/2114cf6f761429e0adb5ca9596fcd7b895b16011/crates/adapters/blockchain/src/execution/client.rs#L1231-L1267","documentation":"The pool profiler for the instrument exists and is initialized, but last_processed_event is None, meaning the profiler has not yet ingested any pool events (Swap/Mint/Burn/etc.) and therefore has no liquidity state to quote against. The block number of the last processed event is also persisted into the swap plan, so quoting must stop here.","triggerScenarios":"submit_order immediately after subscribing: the subscription handshake completed (profiler created, is_initialized true) but the event backfill has processed zero events — a brand-new pool, an indexer still backfilling, or a quiet pool with no events in the replay window.","commonSituations":"Strategies firing on a timer at startup rather than on data arrival; low-activity pools where the first Mint/Swap event has not been observed yet; data client still replaying historical logs from the configured start block.","solutions":["Wait for the first pool event/quote for the instrument before submitting (drive submission from on_quote/on_deltas callbacks)","Verify the subscription start block/window actually covers pool activity; widen it if the pool has been quiet","For freshly created pools, wait until initial liquidity events have been ingested"],"exampleFix":"# before\nself.subscribe_quote(instrument_id)\nself.submit_order(order)  # immediately: has processed no events\n\n# after: gate on first data event\nself.subscribe_quote(instrument_id)\n\ndef on_quote_tick(self, tick):\n    if tick.instrument_id == self.instrument_id and not self._traded:\n        self._traded = True\n        self.submit_order(order)","handlingStrategy":"retry","validationCode":"# Only trade once the profiler has ingested events (first quote observed)\nassert self.cache.quote_tick(instrument_id) is not None, (\n    f'profiler for {instrument_id} has processed no events yet; wait for the first quote'\n)","typeGuard":"def pool_is_quotable(cache, instrument_id) -> bool:\n    \"\"\"A cached quote implies the pool profiler processed at least one event.\"\"\"\n    return cache.quote_tick(instrument_id) is not None","tryCatchPattern":null,"preventionTips":["Wait for the first data event per instrument after subscribing before enabling that instrument in the strategy","For quiet pools, configure a subscription start block that covers historical activity so the profiler backfills state"],"tags":["blockchain","pool-profiler","data-not-ready","swap","race-condition"],"backgroundTag":"data-not-ready","analyzedSha":"2114cf6f761429e0adb5ca9596fcd7b895b16011","analyzedAt":"2026-08-21T11:28:30.864Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}