nautechsystems/nautilus_trader · error

HyperSync parsing of pool created event is not defined in th

Error message

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

What it means

DexExtended::parse_pool_created_event_hypersync dispatches to the per-DEX HyperSync pool-created parser stored in parse_pool_created_event_hypersync_fn, and bails when that function pointer was never set. The DEX adapter simply does not define HyperSync parsing for pool-created events.

Source

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

        &mut self,
        parse_fn: fn(SharedDex, &RpcLog) -> anyhow::Result<FeeProtocolCollectEvent>,
    ) {
        self.parse_fee_protocol_collect_event_rpc_fn = Some(parse_fn);
    }

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

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

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check whether the parser is defined (capability check) and fall back to RPC-based pool discovery for that DEX
  2. Register a parse_pool_created_event_hypersync_fn in the DEX adapter if HyperSync support is intended
  3. Restrict HyperSync bootstrap to DEXes known to support it (filter the DEX list)
  4. Remove the DEX from HyperSync sync configuration until a parser exists

Example fix

// before: unconditional HyperSync parse
let event = dex.parse_pool_created_event_hypersync(log)?;
// after: check capability and fall back
if dex.supports_pool_created_hypersync() {
    let event = dex.parse_pool_created_event_hypersync(log)?;
} else {
    discover_pool_via_rpc(&dex, log)?;
}
Defensive patterns

Strategy: try-catch

Validate before calling

if dex.parse_pool_created_event_hypersync_fn.is_none() {
    tracing::debug!("no hypersync pool-created parser for {}", dex.dex.name);
    return Ok(None);
}

Type guard

fn has_hypersync_pool_created_parser(dex: &DexExtended) -> bool {
    dex.parse_pool_created_event_hypersync_fn.is_some()
}

Try / catch

match dex.parse_pool_created_event_hypersync(&log) {
    Ok(ev) => handle(ev),
    Err(e) if e.to_string().contains("not defined in this dex") => rpc_fallback_discovery(&dex, &log)?,
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling parse_pool_created_event_hypersync on a DexExtended constructed without a pool-created HyperSync parser (e.g. a DEX that only supports RPC-based discovery, or a parser registration omitted in its constructor).

Common situations: Using HyperSync bootstrap for a DEX whose adapter only implements RPC discovery; a newly added DEX adapter missing the HyperSync parser wiring; calling the HyperSync path unconditionally instead of checking capability first.

Related errors


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