nautechsystems/nautilus_trader · error

HyperSync parsing of collect event is not defined in this de

Error message

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

What it means

Raised by parse_collect_event_hypersync when the DEX lacks a HyperSync parser for collect events (position fee collection), i.e. parse_collect_event_hypersync_fn is None. The adapter cannot decode the log and bails with the DEX chain and name. Collect events are concentrated-liquidity (Uniswap v3-style) specific, so AMM DEXs without that model legitimately never register this parser.

Source

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

                self.dex.chain,
                self.dex.name
            )
        }
    }

    /// Parses a collect event from a HyperSync log.
    ///
    /// # Errors
    ///
    /// Returns an error if the DEX does not have a HyperSync collect event parser defined or if parsing fails.
    pub fn parse_collect_event_hypersync(
        &self,
        log: &HypersyncLog,
    ) -> anyhow::Result<CollectEvent> {
        if let Some(parse_fn) = &self.parse_collect_event_hypersync_fn {
            parse_fn(self.dex.clone(), log)
        } 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: {}:{}",

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Register the HyperSync collect event parser on this DEX if it supports concentrated liquidity.
  2. Filter collect-topic logs away from DEXs that do not support collect events before dispatch.
  3. Match logs to the correct DEX adapter by emitted contract address.
  4. Skip and log the event when the DEX declares no collect support instead of failing the stream.
Defensive patterns

Strategy: try-catch

Validate before calling

if !dex_supports(dex, DexEvent::CollectHypersync) { return Ok(()); }

Type guard

fn has_hypersync_collect_parser(dex: &Dex) -> bool { dex.parse_collect_event_hypersync_fn.is_some() }

Try / catch

match dex.parse_collect_event_hypersync(&log) {
    Ok(evt) => handle_collect(evt),
    Err(e) if e.to_string().contains("not defined in this dex") => tracing::debug!("collect unsupported on {}", dex.name()),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling dex.parse_collect_event_hypersync(&log), often from send_dex_event_log while streaming position-manager logs, for a DEX that never defined a HyperSync collect parser.

Common situations: Applying a v3-style event set to a v2-style DEX; a new DEX registration missing the collect parser; logs from a position manager routed to a DEX adapter that only handles swap/mint/burn; chain-specific forks without full event coverage.

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