{"record":{"id":"5b4c660684a85519","repo":"nautechsystems/nautilus_trader","slug":"hypersync-parsing-of-pool-created-event-is-not-def","errorCode":null,"errorMessage":"HyperSync parsing of pool created event is not defined in this dex: {}:{}","messagePattern":"HyperSync parsing of pool created event is not defined in this dex: (.+?):(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/extended.rs","lineNumber":276,"sourceCode":"        &mut self,\n        parse_fn: fn(SharedDex, &RpcLog) -> anyhow::Result<FeeProtocolCollectEvent>,\n    ) {\n        self.parse_fee_protocol_collect_event_rpc_fn = Some(parse_fn);\n    }\n\n    /// Parses a pool creation event from a HyperSync log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have a HyperSync pool creation event parser defined or if parsing fails.\n    pub fn parse_pool_created_event_hypersync(\n        &self,\n        log: HypersyncLog,\n    ) -> anyhow::Result<PoolCreatedEvent> {\n        if let Some(parse_fn) = &self.parse_pool_created_event_hypersync_fn {\n            parse_fn(log)\n        } else {\n            anyhow::bail!(\n                \"HyperSync parsing of pool created event is not defined in this dex: {}:{}\",\n                self.dex.chain,\n                self.dex.name,\n            )\n        }\n    }\n\n    /// Parses a swap event from a HyperSync log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have a HyperSync swap event parser defined or if parsing fails.\n    pub fn parse_swap_event_hypersync(&self, log: &HypersyncLog) -> anyhow::Result<SwapEvent> {\n        if let Some(parse_fn) = &self.parse_swap_event_hypersync_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"HyperSync parsing of swap event is not defined in this dex: {}:{}\",","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/extended.rs#L258-L294","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check whether the parser is defined (capability check) and fall back to RPC-based pool discovery for that DEX","Register a parse_pool_created_event_hypersync_fn in the DEX adapter if HyperSync support is intended","Restrict HyperSync bootstrap to DEXes known to support it (filter the DEX list)","Remove the DEX from HyperSync sync configuration until a parser exists"],"exampleFix":"// before: unconditional HyperSync parse\nlet event = dex.parse_pool_created_event_hypersync(log)?;\n// after: check capability and fall back\nif dex.supports_pool_created_hypersync() {\n    let event = dex.parse_pool_created_event_hypersync(log)?;\n} else {\n    discover_pool_via_rpc(&dex, log)?;\n}","handlingStrategy":"try-catch","validationCode":"if dex.parse_pool_created_event_hypersync_fn.is_none() {\n    tracing::debug!(\"no hypersync pool-created parser for {}\", dex.dex.name);\n    return Ok(None);\n}","typeGuard":"fn has_hypersync_pool_created_parser(dex: &DexExtended) -> bool {\n    dex.parse_pool_created_event_hypersync_fn.is_some()\n}","tryCatchPattern":"match dex.parse_pool_created_event_hypersync(&log) {\n    Ok(ev) => handle(ev),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => rpc_fallback_discovery(&dex, &log)?,\n    Err(e) => return Err(e),\n}","preventionTips":["Check parser capability before HyperSync-based discovery","Only include HyperSync-capable DEXes in bootstrap config","Set the parser fn in every DEX adapter constructor that claims HyperSync support"],"tags":["blockchain","hypersync","dex","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}