nautechsystems/nautilus_trader · error

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

Error message

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

What it means

Raised by parse_flash_event_hypersync when no HyperSync flash-event parser (parse_flash_event_hypersync_fn) is registered on the DEX. Flash-loan/flash-swap events are optional capabilities; when the parser slot is None the method bails with chain:name. It indicates the DEX adapter was never taught to decode flash events over HyperSync.

Source

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

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

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

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

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Register a flash event HyperSync parser for the DEX if it supports flash loans/swaps.
  2. Remove flash topics from this DEX's HyperSync log queries when unsupported.
  3. Verify the emitting contract before routing the log to this adapter.
  4. Treat missing parser as 'not supported' and skip the log gracefully.
Defensive patterns

Strategy: try-catch

Validate before calling

if !dex_supports(dex, DexEvent::FlashHypersync) { skip_log(); }

Type guard

fn has_hypersync_flash_parser(dex: &Dex) -> bool { dex.parse_flash_event_hypersync_fn.is_some() }

Try / catch

match dex.parse_flash_event_hypersync(&log) {
    Ok(evt) => handle_flash(evt),
    Err(e) if e.to_string().contains("not defined in this dex") => tracing::debug!("flash events unsupported on this dex"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling dex.parse_flash_event_hypersync(&log) (e.g. via send_dex_event_log dispatch) on a DEX without flash event support, such as a v2-style AMM or a fork that omits flash callbacks.

Common situations: Subscribing to flash topic logs across all DEXs; a DEX registration template that omitted flash parsing; analysing MEV/flash-loan activity on a DEX that does not emit these events; incomplete fork support.

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