{"record":{"id":"7c0e0330f79254e4","repo":"nautechsystems/nautilus_trader","slug":"rpc-parsing-of-collect-event-is-not-defined-in-thi","errorCode":null,"errorMessage":"RPC parsing of collect event is not defined in this dex: {}:{}","messagePattern":"RPC parsing of collect event is not defined in this dex: (.+?):(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/extended.rs","lineNumber":526,"sourceCode":"        } else {\n            anyhow::bail!(\n                \"RPC 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 an RPC log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have an RPC collect event parser defined or if parsing fails.\n    pub fn parse_collect_event_rpc(&self, log: &RpcLog) -> anyhow::Result<CollectEvent> {\n        if let Some(parse_fn) = &self.parse_collect_event_rpc_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"RPC parsing of collect event is not defined in this dex: {}:{}\",\n                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a flash event from an RPC log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have an RPC flash event parser defined or if parsing fails.\n    pub fn parse_flash_event_rpc(&self, log: &RpcLog) -> anyhow::Result<FlashEvent> {\n        if let Some(parse_fn) = &self.parse_flash_event_rpc_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"RPC parsing of flash event is not defined in this dex: {}:{}\",","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/extended.rs#L508-L544","documentation":"Raised by `DexExtended::parse_collect_event_rpc` when the DEX has no RPC collect-event parser registered (`parse_collect_event_rpc_fn` is `None`). Collect events (position fee collection in V3-style DEXes) must be opted into per adapter; this DEX does not provide an RPC log parser for them, so the call bails with the chain and DEX name.","triggerScenarios":"Calling `dex.parse_collect_event_rpc(&log)` on a `DexExtended` constructed without `parse_collect_event_rpc_fn` set — e.g. routing Collect logs from an RPC subscription to a DEX adapter that never registered a collect RPC parser.","commonSituations":"Replaying historical Collect logs via eth_getLogs/subscription for a DEX whose adapter only wires Hypersync parsing; copying a DEX setup from a minimal example that omits the collect parser; new chain support added before all event parsers were wired.","solutions":["Register the collect RPC parser on the DEX at construction time (`parse_collect_event_rpc_fn: Some(...)`).","Guard the call: only invoke `parse_collect_event_rpc` when the parser fn is present; otherwise skip the log and record the DEX/chain.","Filter Collect topic0 out of your RPC log subscription for this DEX if collect data is not required.","Check the adapter's registered parser list (or tests like the ones calling these parse functions) to confirm which events that DEX supports."],"exampleFix":"// before\nlet ev = dex.parse_collect_event_rpc(&log)?;\n// after\nmatch dex.parse_collect_event_rpc(&log) {\n    Ok(ev) => handle(ev),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => tracing::debug!(\"collect rpc parser unsupported for {}:{}\", dex.dex.chain, dex.dex.name),\n    Err(e) => return Err(e),\n}","handlingStrategy":"fallback","validationCode":"if dex.parse_collect_event_rpc_fn.is_none() {\n    tracing::debug!(\"collect rpc parsing unsupported for {}:{}\", dex.dex.chain, dex.dex.name);\n    return Ok(());\n}","typeGuard":"fn supports_collect_rpc(dex: &DexExtended) -> bool {\n    dex.parse_collect_event_rpc_fn.is_some()\n}","tryCatchPattern":"match dex.parse_collect_event_rpc(&log) {\n    Ok(ev) => handle_collect(ev),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => Ok(()),\n    Err(e) => Err(e),\n}","preventionTips":["Wire the collect RPC parser in every DEX constructor variant you build.","Filter Collect topic0 out of RPC subscriptions for DEXes without the parser.","Treat 'not defined in this dex' as a skip, not a hard failure, in batch ingestion.","Diff your log topic list against the parsers registered per DEX during boot."],"tags":["rust","anyhow","rpc","dex","event-parsing","unimplemented"],"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"}