nautechsystems/nautilus_trader · error

RPC parsing of pool created event is not defined in this dex

Error message

RPC parsing of pool created event is not defined in this dex: {}:{}

What it means

Raised by parse_pool_created_event_rpc when no RPC parser for PoolCreated events (parse_pool_created_event_rpc_fn) is registered on the DEX. Unlike the HyperSync variants this takes an RpcLog; when the parser slot is None the method bails with chain:name. It means the adapter cannot decode factory pool-creation logs over the RPC transport.

Source

Thrown at crates/adapters/blockchain/src/exchanges/extended.rs:441

        } else {
            anyhow::bail!(
                "HyperSync parsing of CollectProtocol event is not defined in this dex: {}:{}",
                self.dex.chain,
                self.dex.name
            )
        }
    }

    /// Parses a pool creation event from an RPC log.
    ///
    /// # Errors
    ///
    /// Returns an error if the DEX does not have an RPC pool creation event parser defined or if parsing fails.
    pub fn parse_pool_created_event_rpc(&self, log: &RpcLog) -> anyhow::Result<PoolCreatedEvent> {
        if let Some(parse_fn) = &self.parse_pool_created_event_rpc_fn {
            parse_fn(log)
        } else {
            anyhow::bail!(
                "RPC parsing of pool created event is not defined in this dex: {}:{}",
                self.dex.chain,
                self.dex.name,
            )
        }
    }

    /// Parses a swap event from an RPC log.
    ///
    /// # Errors
    ///
    /// Returns an error if the DEX does not have an RPC swap event parser defined or if parsing fails.
    pub fn parse_swap_event_rpc(&self, log: &RpcLog) -> anyhow::Result<SwapEvent> {
        if let Some(parse_fn) = &self.parse_swap_event_rpc_fn {
            parse_fn(self.dex.clone(), log)
        } else {
            anyhow::bail!(
                "RPC parsing of swap event is not defined in this dex: {}:{}",

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Register parse_pool_created_event_rpc_fn for the DEX at construction.
  2. Use the HyperSync ingestion path (parse_initialize_event_hypersync) if the DEX only defines HyperSync parsers.
  3. Filter factory-created topics away from DEXs lacking RPC parser support.
  4. Verify the emitting address is this DEX's factory before parsing.
Defensive patterns

Strategy: try-catch

Validate before calling

if !dex_supports(dex, DexEvent::PoolCreatedRpc) { use_hypersync_discovery(dex)?; }

Type guard

fn has_rpc_pool_created_parser(dex: &Dex) -> bool { dex.parse_pool_created_event_rpc_fn.is_some() }

Try / catch

match dex.parse_pool_created_event_rpc(&log) {
    Ok(evt) => handle_new_pool(evt),
    Err(e) if e.to_string().contains("not defined in this dex") => tracing::debug!("RPC pool-created parsing unsupported; use HyperSync path"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling dex.parse_pool_created_event_rpc(&log) with a log fetched via eth_getLogs/RPC subscription for a DEX that never registered an RPC pool-creation parser.

Common situations: RPC-based pool discovery on DEXs that only support HyperSync ingestion; new DEX integrations missing the factory-event parser; forks with different factory event signatures where a generic template omitted the RPC parser.

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/a60dea968ece951c. Report an issue: GitHub.