{"record":{"id":"505308dfd8dcf070","repo":"nautechsystems/nautilus_trader","slug":"hypersync-parsing-of-initialize-event-is-not-defin","errorCode":null,"errorMessage":"HyperSync parsing of initialize event is not defined in this dex: {}:{}","messagePattern":"HyperSync parsing of initialize event is not defined in this dex: (.+?):(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/extended.rs","lineNumber":347,"sourceCode":"                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses an initialize event from a HyperSync log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have a HyperSync initialize event parser defined or if parsing fails.\n    pub fn parse_initialize_event_hypersync(\n        &self,\n        log: &HypersyncLog,\n    ) -> anyhow::Result<InitializeEvent> {\n        if let Some(parse_fn) = &self.parse_initialize_event_hypersync_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"HyperSync parsing of initialize event is not defined in this dex: {}:{}\",\n                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a collect event from a HyperSync log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have a HyperSync collect event parser defined or if parsing fails.\n    pub fn parse_collect_event_hypersync(\n        &self,\n        log: &HypersyncLog,\n    ) -> anyhow::Result<CollectEvent> {\n        if let Some(parse_fn) = &self.parse_collect_event_hypersync_fn {\n            parse_fn(self.dex.clone(), log)","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/extended.rs#L329-L365","documentation":"Raised by parse_initialize_event_hypersync when the DEX has no HyperSync parser registered for pool-initialize events (parse_initialize_event_hypersync_fn is None). The initialize event signals new pool creation; without a registered parser the adapter cannot decode the log and bails with chain:name. This is a declared-capability gap rather than a data error.","triggerScenarios":"Calling dex.parse_initialize_event_hypersync(&log) on a DEX constructed without an initialize-event HyperSync parser, e.g. a DEX type that does not track pool creation or whose factory events are unsupported over HyperSync.","commonSituations":"Subscribing a DEX to factory/initialize topic streams it cannot decode; forgetting to wire the initialize parser in a new DEX definition; running multi-DEX discovery where one DEX lacks pool-creation support; DEX forks registered from a generic template without event coverage.","solutions":["Register parse_initialize_event_hypersync_fn for this DEX at construction time.","Exclude the initialize topic from this DEX's HyperSync subscription/query filters so the parse path is never hit.","Verify the log actually belongs to this DEX's factory contract before parsing.","Handle the capability gap explicitly by checking parser presence and skipping unsupported events."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !dex_supports(dex, DexEvent::InitializeHypersync) { skip_log(); }","typeGuard":"fn has_hypersync_initialize_parser(dex: &Dex) -> bool { dex.parse_initialize_event_hypersync_fn.is_some() }","tryCatchPattern":"match dex.parse_initialize_event_hypersync(&log) {\n    Ok(evt) => handle_new_pool(evt),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => tracing::debug!(\"initialize not supported for this dex\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Wire factory/initialize parsers for every DEX that should track pool creation.","Keep HyperSync query topic filters in sync with registered parsers per DEX.","Test new DEX registrations against the full expected event matrix.","Log and skip unsupported events instead of failing the whole ingestion stream."],"tags":["dex","hypersync","event-parsing","pool-creation","rust"],"backgroundTag":"unsupported-operation","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"}