{"record":{"id":"05f2b50a283a8cd7","repo":"nautechsystems/nautilus_trader","slug":"no-pool-profiler-for-instrument-id-an-active-da","errorCode":null,"errorMessage":"No pool profiler for {instrument_id}; an active data subscription is required to quote the swap","messagePattern":"No pool profiler for (.+?); an active data subscription is required to quote the swap","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1236,"sourceCode":"                anyhow::anyhow!(\"slippage_bps parameter {value} exceeds the u32 range\")\n            })?,\n            None => self.transaction_limits.slippage_bps,\n        };\n\n        if slippage_bps > self.transaction_limits.max_slippage_bps {\n            anyhow::bail!(\n                \"Slippage {slippage_bps} bps exceeds the configured `max_slippage_bps` {}\",\n                self.transaction_limits.max_slippage_bps\n            );\n        }\n\n        let profiler = self\n            .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)","sourceCodeStart":1218,"sourceCodeEnd":1254,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/2114cf6f761429e0adb5ca9596fcd7b895b16011/crates/adapters/blockchain/src/execution/client.rs#L1218-L1254","documentation":"prepare_swap needs the local pool profiler from the cache to quote the swap, but cache.pool_profiler(instrument_id) returned None. The profiler is built by the blockchain data client's subscription pipeline, so absence means there is no active data subscription for that instrument: the execution client deliberately refuses to quote swaps it cannot price locally.","triggerScenarios":"submit_order for an instrument whose data feed was never subscribed (no request for that pool's events), a subscription that failed or was unsubscribed before the order, or an instrument_id that does not match the subscribed pool's ID format.","commonSituations":"Strategy submits before subscribe() completes in on_start; typos or venue mismatch in the instrument_id (e.g. WETH-USDC.UNISWAP-V3 vs the actual venue name); running the execution client without its data client counterpart.","solutions":["Subscribe to the instrument's data (deltas/quotes for the pool) and wait for the first events before submitting","Verify the instrument_id passed to submit_order exactly matches the subscribed instrument","Confirm the data client is registered and connected in the same NautilusTrader instance","Gate order submission on having seen at least one quote for the instrument"],"exampleFix":"# before: order submitted with no data subscription\nself.submit_order(self.order_factory.market(...))  # No pool profiler\n\n# after: subscribe first, wait for the first quote, then trade\nself.subscribe_quote(instrument_id)\n# ... in on_quote / after first callback:\nif self.cache.quote_tick(instrument_id) is not None:\n    self.submit_order(order)","handlingStrategy":"validation","validationCode":"# Gate submission on an active subscription for the instrument\ndef can_quote(self, instrument_id) -> bool:\n    tick = self.cache.quote_tick(instrument_id)  # non-None implies a live subscription produced data\n    return tick is not None\n\n# in strategy:\nassert self.can_quote(instrument_id), f'no data subscription for {instrument_id}'\nself.submit_order(order)","typeGuard":"def has_pool_data(cache, instrument_id) -> bool:\n    \"\"\"True once the instrument has produced at least one cached quote/delta.\"\"\"\n    return (cache.quote_tick(instrument_id) is not None\n            or cache.order_book_delta(instrument_id) is not None)","tryCatchPattern":null,"preventionTips":["Always run the blockchain data client alongside the execution client and subscribe to each pool before trading it","Drive order submission from data callbacks (on_quote_tick/on_deltas), not from timers, so subscriptions are provably live"],"tags":["blockchain","data-subscription","pool-profiler","swap","preconditions"],"backgroundTag":"missing-data-subscription","analyzedSha":"2114cf6f761429e0adb5ca9596fcd7b895b16011","analyzedAt":"2026-08-21T11:28:30.864Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}