{"record":{"id":"2991f625a51c4eae","repo":"nautechsystems/nautilus_trader","slug":"hypersync-parsing-of-collectprotocol-event-is-not","errorCode":null,"errorMessage":"HyperSync parsing of CollectProtocol event is not defined in this dex: {}:{}","messagePattern":"HyperSync parsing of CollectProtocol event is not defined in this dex: (.+?):(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/extended.rs","lineNumber":424,"sourceCode":"                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a `CollectProtocol` event from a HyperSync log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have a HyperSync `CollectProtocol` event parser defined or if parsing fails.\n    pub fn parse_fee_protocol_collect_event_hypersync(\n        &self,\n        log: &HypersyncLog,\n    ) -> anyhow::Result<FeeProtocolCollectEvent> {\n        if let Some(parse_fn) = &self.parse_fee_protocol_collect_event_hypersync_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"HyperSync parsing of CollectProtocol event is not defined in this dex: {}:{}\",\n                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a pool creation event from an RPC log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have an RPC pool creation event parser defined or if parsing fails.\n    pub fn parse_pool_created_event_rpc(&self, log: &RpcLog) -> anyhow::Result<PoolCreatedEvent> {\n        if let Some(parse_fn) = &self.parse_pool_created_event_rpc_fn {\n            parse_fn(log)\n        } else {\n            anyhow::bail!(\n                \"RPC parsing of pool created event is not defined in this dex: {}:{}\",","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/extended.rs#L406-L442","documentation":"Raised by parse_fee_protocol_collect_event_hypersync when the DEX lacks a HyperSync parser for the CollectProtocol event (parse_fee_protocol_collect_event_hypersync_fn is None). CollectProtocol logs protocol-fee collection by the factory owner/treasury; adapters that do not track protocol fee collection bail with chain:name instead of guessing a decode.","triggerScenarios":"Calling dex.parse_fee_protocol_collect_event_hypersync(&log), e.g. dispatched from send_dex_event_log while indexing treasury revenue logs, on a DEX without this parser registered.","commonSituations":"Indexing protocol revenue across many DEXs where some lack support; fork DEXs with different treasury event names/signatures; new DEX integration that only wired swap/mint/burn parsers.","solutions":["Register the CollectProtocol HyperSync parser for the DEX if protocol-fee collection is in scope.","Filter CollectProtocol topics out of queries for DEXs without support.","Route the log to the DEX adapter that actually owns the emitting contract.","Gracefully skip the event when parser support is absent."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !dex_supports(dex, DexEvent::CollectProtocolHypersync) { return Ok(()); }","typeGuard":"fn has_fee_protocol_collect_parser(dex: &Dex) -> bool { dex.parse_fee_protocol_collect_event_hypersync_fn.is_some() }","tryCatchPattern":"match dex.parse_fee_protocol_collect_event_hypersync(&log) {\n    Ok(evt) => handle_protocol_collect(evt),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => tracing::debug!(\"CollectProtocol unsupported on {}\", dex.name()),\n    Err(e) => return Err(e),\n}","preventionTips":["Register treasury/protocol-fee parsers only where the DEX emits CollectProtocol.","Match logs to owning DEX adapters by contract address before parsing.","Keep an explicit capability matrix for optional v3 events (collect, fee protocol, flash).","Avoid failing entire ingestion batches on unsupported optional events."],"tags":["dex","hypersync","event-parsing","protocol-fees","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"}