{"record":{"id":"6b98f4a26752c946","repo":"nautechsystems/nautilus_trader","slug":"rpc-parsing-of-setfeeprotocol-event-is-not-defined","errorCode":null,"errorMessage":"RPC parsing of SetFeeProtocol event is not defined in this dex: {}:{}","messagePattern":"RPC parsing of SetFeeProtocol event is not defined in this dex: (.+?):(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/exchanges/extended.rs","lineNumber":563,"sourceCode":"                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a `SetFeeProtocol` event from an RPC log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have an RPC `SetFeeProtocol` event parser defined or if parsing fails.\n    pub fn parse_fee_protocol_update_event_rpc(\n        &self,\n        log: &RpcLog,\n    ) -> anyhow::Result<FeeProtocolUpdateEvent> {\n        if let Some(parse_fn) = &self.parse_fee_protocol_update_event_rpc_fn {\n            parse_fn(self.dex.clone(), log)\n        } else {\n            anyhow::bail!(\n                \"RPC parsing of SetFeeProtocol event is not defined in this dex: {}:{}\",\n                self.dex.chain,\n                self.dex.name\n            )\n        }\n    }\n\n    /// Parses a `CollectProtocol` event from an RPC log.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the DEX does not have an RPC `CollectProtocol` event parser defined or if parsing fails.\n    pub fn parse_fee_protocol_collect_event_rpc(\n        &self,\n        log: &RpcLog,\n    ) -> anyhow::Result<FeeProtocolCollectEvent> {\n        if let Some(parse_fn) = &self.parse_fee_protocol_collect_event_rpc_fn {\n            parse_fn(self.dex.clone(), log)","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/exchanges/extended.rs#L545-L581","documentation":"Raised by `DexExtended::parse_fee_protocol_update_event_rpc` when the DEX has no RPC parser registered for the SetFeeProtocol event (`parse_fee_protocol_update_event_rpc_fn` is `None`). Fee-protocol updates are PancakeSwap-V3-specific; adapters for DEXes that never emit this event (or that only support Hypersync parsing of it) leave the optional fn unset, and this method bails with chain and DEX name.","triggerScenarios":"Calling `dex.parse_fee_protocol_update_event_rpc(&log)` on a DEX such as a Uniswap V3 deployment (which has no SetFeeProtocol event) or a PancakeSwap V3 instance constructed without the fee-protocol RPC parser wired.","commonSituations":"Subscribing to SetFeeProtocol topic0 globally and dispatching every matching log to whichever DEX owns the pool address, including DEXes that don't support the event; using a Uniswap V3 adapter for a PancakeSwap V3 pool; partial adapter wiring on a newly added chain.","solutions":["Register the SetFeeProtocol RPC parser via `parse_fee_protocol_update_event_rpc_fn: Some(parsing::pancakeswap_v3::fee_protocol_update::parse_fee_protocol_update_event_rpc)` for DEXes that emit the event.","Only dispatch SetFeeProtocol logs to DEX adapters that declare fee-protocol support; check the optional fn first.","Match the pool address to the correct adapter (PancakeSwap V3 adapter for PancakeSwap pools, not the Uniswap V3 adapter).","If the event is irrelevant for the DEX, filter the topic0 out before dispatch and treat the log as ignorable rather than an error."],"exampleFix":"// before\nlet ev = dex.parse_fee_protocol_update_event_rpc(&log)?; // bails for non-PancakeSwap dexes\n// after\nif let Some(ev) = dex\n    .parse_fee_protocol_update_event_rpc(&log)\n    .ok()\n    .filter(|_| dex.parse_fee_protocol_update_event_rpc_fn.is_some())\n{\n    handle(ev);\n}","handlingStrategy":"validation","validationCode":"// dispatch SetFeeProtocol logs only to adapters that support them\nif dex.parse_fee_protocol_update_event_rpc_fn.is_some()\n    && log.topics.first().map(String::as_str) == Some(SET_FEE_PROTOCOL_TOPIC)\n{\n    let ev = dex.parse_fee_protocol_update_event_rpc(&log)?;\n}","typeGuard":"fn supports_fee_protocol_update_rpc(dex: &DexExtended) -> bool {\n    dex.parse_fee_protocol_update_event_rpc_fn.is_some()\n}","tryCatchPattern":"match dex.parse_fee_protocol_update_event_rpc(&log) {\n    Ok(ev) => handle(ev),\n    Err(e) if e.to_string().contains(\"not defined in this dex\") => {\n        tracing::trace!(\"fee protocol update unsupported, skipping\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Route pool events by DEX adapter type: PancakeSwap V3 pools go to the PancakeSwap adapter, Uniswap V3 pools to the Uniswap adapter.","Register the fee-protocol RPC parser wherever you also register the hypersync variant.","Filter SetFeeProtocol topic0 at the query level for chains/DEXes where it exists.","Add a capability table (chain, dex) -> supported events and assert against it."],"tags":["rust","anyhow","rpc","dex","event-parsing","unimplemented","pancakeswap-v3"],"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"}