nautechsystems/nautilus_trader · error

Fetching on-chain snapshot for Dex protocol {} is not suppor

Error message

Fetching on-chain snapshot for Dex protocol {} is not supported yet.

What it means

Fetching an on-chain pool snapshot requires a pool contract read ABI for the DEX protocol. Only UniswapV3 and PancakeSwapV3 pools are supported (with per-DEX feeProtocol encodings); any other DEX reaching get_on_chain_snapshot_at_position fails with this bail.

Source

Thrown at crates/adapters/blockchain/src/data/core.rs:2072

                    .copied(),
            )?;
            let on_chain_snapshot = self
                .univ3_pool
                .fetch_snapshot(
                    &profiler.pool.address,
                    profiler.pool.instrument_id,
                    profiler.get_active_tick_values().as_slice(),
                    &profiler.get_all_position_keys(),
                    block_position,
                    timestamp, // ts_event
                    timestamp, // ts_init (same block timestamp)
                    fee_protocol_encoding,
                )
                .await?;

            Ok(on_chain_snapshot)
        } else {
            anyhow::bail!(
                "Fetching on-chain snapshot for Dex protocol {} is not supported yet.",
                profiler.pool.dex.name
            )
        }
    }

    fn validate_rpc_snapshot_topology(
        profiler: &PoolProfiler,
        snapshot: &PoolSnapshot,
    ) -> anyhow::Result<()> {
        let tick_spacing = i32::try_from(
            profiler
                .pool
                .tick_spacing
                .context("pool tick spacing is not set")?,
        )?;
        let expected_positions: AHashMap<_, _> = profiler
            .get_all_positions()

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Add the DEX to the `matches!` list and a corresponding FeeProtocolEncoding arm in get_on_chain_snapshot_at_position if it shares the Uniswap V3 pool read ABI.
  2. Use a sync path that does not require on-chain snapshots (event-replay-only) for unsupported DEX protocols.
  3. Confirm the pool was created with the intended DEX type; a mislabeled DEX name in registration can route a V3 pool into the unsupported branch.

Example fix

// before
if matches!(profiler.pool.dex.name, DexType::UniswapV3 | DexType::PancakeSwapV3) {
// after
if matches!(profiler.pool.dex.name, DexType::UniswapV3 | DexType::PancakeSwapV3 | DexType::MyV3Fork) {
    let fee_protocol_encoding = match profiler.pool.dex.name {
        DexType::PancakeSwapV3 => FeeProtocolEncoding::PancakeSwapV3BasisPoints,
        _ => FeeProtocolEncoding::UniswapV3Packed,
    };
Defensive patterns

Strategy: fallback

Validate before calling

const SUPPORTED_SNAPSHOT_DEXES: &[DexType] = &[DexType::UniswapV3, DexType::PancakeSwapV3];
if !SUPPORTED_SNAPSHOT_DEXES.contains(&pool.dex.name) {
    // use event-replay-only validation instead of on-chain snapshot
}

Type guard

fn supports_on_chain_snapshot(dex_name: DexType) -> bool {
    matches!(dex_name, DexType::UniswapV3 | DexType::PancakeSwapV3)
}

Try / catch

match data.get_on_chain_snapshot(&profiler).await {
    Err(e) if e.to_string().contains("is not supported yet") => {
        // fall back to replay-only snapshot validation
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling get_on_chain_snapshot (e.g. via check_snapshot_validity) or construct_pool_profiler_from_hypersync_rpc for a pool whose `pool.dex.name` is anything other than DexType::UniswapV3 or DexType::PancakeSwapV3.

Common situations: Registering a new V3-fork DEX (e.g. another Uniswap V3 deployment) without adding its arm to the match in get_on_chain_snapshot_at_position; pointing the bootstrap flow at a DEX that has no on-chain snapshot reader implemented.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/f9b4bcbd4d733d96. Report an issue: GitHub.