nautechsystems/nautilus_trader · error

HyperSync parsing of burn event is not defined in this dex:

Error message

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

What it means

This error is raised by parse_burn_event_hypersync on a DEX adapter when no HyperSync-specific parser function (parse_burn_event_hypersync_fn) has been registered for that DEX. The library models DEX event parsing as optional per-DEX, per-transport capabilities, so calling a parse method whose parser slot is None bails with the DEX chain and name embedded. It signals a capability gap in the adapter configuration, not a malformed log.

Source

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

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

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

    /// Parses an initialize event from a HyperSync log.
    ///
    /// # Errors
    ///
    /// Returns an error if the DEX does not have a HyperSync initialize event parser defined or if parsing fails.
    pub fn parse_initialize_event_hypersync(
        &self,
        log: &HypersyncLog,
    ) -> anyhow::Result<InitializeEvent> {
        if let Some(parse_fn) = &self.parse_initialize_event_hypersync_fn {
            parse_fn(self.dex.clone(), log)

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Register a HyperSync burn event parser for this DEX when constructing it (set parse_burn_event_hypersync_fn in the DEX builder/definition).
  2. Check whether the DEX supports burn events at all; if not, filter burn-event logs out before dispatching to this DEX's parse_burn_event_hypersync.
  3. Inspect the log's address/topics to confirm it belongs to this DEX; a misrouted log from another DEX will hit a DEX with no parser.
  4. Fall back to the RPC parser (parse_burn_event_rpc) if the DEX defines one and RPC data is available.

Example fix

// before
let burn = dex.parse_burn_event_hypersync(&log)?; // panics into bail for unsupported dex
// after
if dex.supports_burn_event_hypersync() {
    let burn = dex.parse_burn_event_hypersync(&log)?;
} else {
    tracing::debug!(dex = %dex.name(), "skipping burn log: no HyperSync parser");
}
Defensive patterns

Strategy: try-catch

Validate before calling

fn dex_supports_burn_hypersync(dex: &Dex) -> bool { dex.parse_burn_event_hypersync_fn.is_some() } // or expose a supports_* predicate and check before calling

Type guard

fn has_hypersync_burn_parser(dex: &Dex) -> bool { dex.parse_burn_event_hypersync_fn.is_some() }

Try / catch

match dex.parse_burn_event_hypersync(&log) {
    Ok(evt) => handle(evt),
    Err(e) if e.to_string().contains("not defined in this dex") => tracing::debug!("dex lacks HyperSync burn parser, skipping"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling dex.parse_burn_event_hypersync(log) for a DEX whose builder never set a burn-event HyperSync parser, typically when processing HyperSync log streams via send_dex_event_log for a DEX that only defines RPC parsers or omits burn support entirely.

Common situations: Routing all chain logs to every registered DEX instead of filtering by supported events; adding a new DEX implementation that forgot to wire the HyperSync burn parser; using a DEX variant (e.g. a fork) that simply does not emit or support burn events; version drift where a DEX registration was updated on RPC but not HyperSync.

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