Skip to main content

sol_shred_sdk/grpc/
types.rs

1//! Event type filtering used by raw shred transaction parsing.
2//!
3//! Migrated from sol-parser-sdk `grpc::types` without the Yellowstone/gRPC
4//! subscription types.
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7pub enum Protocol {
8    PumpFun,
9    PumpSwap,
10    PumpFees,
11    RaydiumLaunchlab,
12    RaydiumCpmm,
13    RaydiumClmm,
14    RaydiumAmmV4,
15    OrcaWhirlpool,
16    MeteoraPools,
17    MeteoraDammV2,
18    MeteoraDlmm,
19    MeteoraDbc,
20}
21
22#[derive(Debug, Clone, Copy, PartialEq, Eq)]
23#[non_exhaustive]
24pub enum EventType {
25    // Block events
26    BlockMeta,
27
28    // RaydiumLaunchlab events
29    RaydiumLaunchlabTrade,
30    RaydiumLaunchlabPoolCreate,
31    RaydiumLaunchlabMigrateAmm,
32
33    // PumpFun events
34    PumpFunTrade,         // All trade events (backward compatible)
35    PumpFunBuy,           // Buy events only (filter by ix_name)
36    PumpFunSell,          // Sell events only (filter by ix_name)
37    PumpFunBuyExactSolIn, // BuyExactSolIn events only (filter by ix_name)
38    PumpFunCreate,
39    PumpFunCreateV2, // SPL-22 / Mayhem create
40    PumpFunComplete,
41    PumpFunMigrate,
42    /// Pump fees(`pfeeUx...`,`idls/pump_fees.json` Program data events)
43    PumpFeesCreateFeeSharingConfig,
44    PumpFeesInitializeFeeConfig,
45    PumpFeesResetFeeSharingConfig,
46    PumpFeesRevokeFeeSharingAuthority,
47    PumpFeesTransferFeeSharingAuthority,
48    PumpFeesUpdateAdmin,
49    PumpFeesUpdateFeeConfig,
50    PumpFeesUpdateFeeShares,
51    PumpFeesUpsertFeeTiers,
52    /// Pump.fun:`migrateBondingCurveCreatorEvent`
53    PumpFunMigrateBondingCurveCreator,
54
55    // PumpSwap events
56    PumpSwapTrade,
57    PumpSwapBuy,
58    PumpSwapSell,
59    PumpSwapCreatePool,
60    PumpSwapLiquidityAdded,
61    PumpSwapLiquidityRemoved,
62    // PumpSwapPoolUpdated,
63    // PumpSwapFeesClaimed,
64
65    // Raydium CPMM events
66    RaydiumCpmmSwap,
67    RaydiumCpmmDeposit,
68    RaydiumCpmmWithdraw,
69    RaydiumCpmmInitialize,
70
71    // Raydium CLMM events
72    RaydiumClmmSwap,
73    RaydiumClmmCreatePool,
74    RaydiumClmmOpenPosition,
75    RaydiumClmmClosePosition,
76    RaydiumClmmIncreaseLiquidity,
77    RaydiumClmmDecreaseLiquidity,
78    RaydiumClmmLiquidityChange,
79    RaydiumClmmConfigChange,
80    RaydiumClmmCreatePersonalPosition,
81    RaydiumClmmLiquidityCalculate,
82    RaydiumClmmOpenLimitOrder,
83    RaydiumClmmIncreaseLimitOrder,
84    RaydiumClmmDecreaseLimitOrder,
85    RaydiumClmmSettleLimitOrder,
86    RaydiumClmmUpdateRewardInfos,
87    RaydiumClmmOpenPositionWithTokenExtNft,
88    RaydiumClmmCollectFee,
89
90    // Raydium AMM V4 events
91    RaydiumAmmV4Swap,
92    RaydiumAmmV4Deposit,
93    RaydiumAmmV4Withdraw,
94    RaydiumAmmV4Initialize2,
95    RaydiumAmmV4WithdrawPnl,
96
97    // Orca Whirlpool events
98    OrcaWhirlpoolSwap,
99    OrcaWhirlpoolLiquidityIncreased,
100    OrcaWhirlpoolLiquidityDecreased,
101    OrcaWhirlpoolPoolInitialized,
102
103    // Meteora events
104    MeteoraPoolsSwap,
105    MeteoraPoolsAddLiquidity,
106    MeteoraPoolsRemoveLiquidity,
107    MeteoraPoolsBootstrapLiquidity,
108    MeteoraPoolsPoolCreated,
109    MeteoraPoolsSetPoolFees,
110
111    // Meteora DAMM V2 events
112    MeteoraDammV2Swap,
113    MeteoraDammV2AddLiquidity,
114    MeteoraDammV2RemoveLiquidity,
115    MeteoraDammV2InitializePool,
116    MeteoraDammV2CreatePosition,
117    MeteoraDammV2ClosePosition,
118    // MeteoraDammV2ClaimPositionFee,
119    // MeteoraDammV2InitializeReward,
120    // MeteoraDammV2FundReward,
121    // MeteoraDammV2ClaimReward,
122
123    // Meteora DBC events
124    MeteoraDbcSwap,
125    MeteoraDbcInitializePool,
126    MeteoraDbcCurveComplete,
127
128    // Meteora DLMM events
129    MeteoraDlmmSwap,
130    MeteoraDlmmAddLiquidity,
131    MeteoraDlmmRemoveLiquidity,
132    MeteoraDlmmInitializePool,
133    MeteoraDlmmInitializeBinArray,
134    MeteoraDlmmCreatePosition,
135    MeteoraDlmmClosePosition,
136    MeteoraDlmmClaimFee,
137
138    // Account events
139    TokenAccount,
140    TokenInfo,
141    NonceAccount,
142    AccountPumpFunGlobal,
143    AccountPumpFunBondingCurve,
144    AccountPumpFunFeeConfig,
145    AccountPumpFunSharingConfig,
146    AccountPumpFunGlobalVolumeAccumulator,
147    AccountPumpFunUserVolumeAccumulator,
148
149    AccountPumpSwapGlobalConfig,
150    AccountPumpSwapPool,
151    AccountRaydiumClmmAmmConfig,
152    AccountRaydiumClmmPoolState,
153    AccountRaydiumClmmTickArrayState,
154    AccountRaydiumCpmmAmmConfig,
155    AccountRaydiumCpmmPoolState,
156    AccountOrcaWhirlpool,
157    AccountOrcaPosition,
158    AccountOrcaTickArray,
159    AccountOrcaFeeTier,
160    AccountOrcaWhirlpoolsConfig,
161}
162
163#[derive(Debug, Clone)]
164pub struct EventTypeFilter {
165    pub include_only: Option<Vec<EventType>>,
166    pub exclude_types: Option<Vec<EventType>>,
167}
168
169impl EventTypeFilter {
170    pub fn include_only(types: Vec<EventType>) -> Self {
171        Self {
172            include_only: Some(types),
173            exclude_types: None,
174        }
175    }
176
177    pub fn exclude_types(types: Vec<EventType>) -> Self {
178        Self {
179            include_only: None,
180            exclude_types: Some(types),
181        }
182    }
183
184    #[inline]
185    fn includes_any(&self, event_types: &[EventType]) -> bool {
186        event_types
187            .iter()
188            .any(|event_type| self.should_include(*event_type))
189    }
190
191    pub fn should_include(&self, event_type: EventType) -> bool {
192        if let Some(ref include_only) = self.include_only {
193            // Direct match
194            if include_only.contains(&event_type) {
195                return true;
196            }
197            if matches!(
198                event_type,
199                EventType::PumpFunBuy | EventType::PumpFunSell | EventType::PumpFunBuyExactSolIn
200            ) {
201                if pumpfun_trade_filter_is_generic(include_only) {
202                    return true;
203                }
204                if event_type == EventType::PumpFunBuyExactSolIn
205                    && pumpfun_buy_filter_is_generic(include_only)
206                {
207                    return true;
208                }
209                return false;
210            }
211            if is_pumpfun_create_family(event_type) {
212                return include_only.iter().any(|t| is_pumpfun_create_family(*t));
213            }
214            if matches!(event_type, EventType::PumpSwapBuy | EventType::PumpSwapSell) {
215                return include_only.contains(&EventType::PumpSwapTrade);
216            }
217            return false;
218        }
219
220        if let Some(ref exclude_types) = self.exclude_types {
221            if exclude_types.contains(&event_type) {
222                return false;
223            }
224            if matches!(
225                event_type,
226                EventType::PumpFunBuy | EventType::PumpFunSell | EventType::PumpFunBuyExactSolIn
227            ) && exclude_types.contains(&EventType::PumpFunTrade)
228            {
229                return false;
230            }
231            if event_type == EventType::PumpFunBuyExactSolIn
232                && exclude_types.contains(&EventType::PumpFunBuy)
233            {
234                return false;
235            }
236            if is_pumpfun_create_family(event_type)
237                && exclude_types.iter().any(|t| is_pumpfun_create_family(*t))
238            {
239                return false;
240            }
241            if matches!(event_type, EventType::PumpSwapBuy | EventType::PumpSwapSell)
242                && exclude_types.contains(&EventType::PumpSwapTrade)
243            {
244                return false;
245            }
246            return true;
247        }
248
249        true
250    }
251
252    pub fn should_include_dex_event(&self, event: &crate::core::events::DexEvent) -> bool {
253        let Some(event_type) = event_type_from_dex_event(event) else {
254            return true;
255        };
256        self.should_include(event_type)
257    }
258
259    #[inline]
260    pub fn includes_block_meta(&self) -> bool {
261        if let Some(ref include_only) = self.include_only {
262            return include_only.contains(&EventType::BlockMeta);
263        }
264        false
265    }
266
267    #[inline]
268    pub fn normalize_dex_event(
269        &self,
270        event: crate::core::events::DexEvent,
271    ) -> crate::core::events::DexEvent {
272        use crate::core::events::DexEvent;
273
274        let Some(ref include_only) = self.include_only else {
275            return event;
276        };
277        if pumpfun_trade_filter_is_generic(include_only) {
278            return match event {
279                DexEvent::PumpFunBuy(t)
280                | DexEvent::PumpFunSell(t)
281                | DexEvent::PumpFunBuyExactSolIn(t) => DexEvent::PumpFunTrade(t),
282                other => other,
283            };
284        }
285        if pumpfun_buy_filter_is_generic(include_only) {
286            return match event {
287                DexEvent::PumpFunBuyExactSolIn(t) => DexEvent::PumpFunBuy(t),
288                other => other,
289            };
290        }
291
292        event
293    }
294
295    #[inline]
296    pub fn includes_pumpfun(&self) -> bool {
297        self.includes_any(&[
298            EventType::PumpFunTrade,
299            EventType::PumpFunBuy,
300            EventType::PumpFunSell,
301            EventType::PumpFunBuyExactSolIn,
302            EventType::PumpFunCreate,
303            EventType::PumpFunCreateV2,
304            EventType::PumpFunComplete,
305            EventType::PumpFunMigrate,
306            EventType::PumpFunMigrateBondingCurveCreator,
307        ])
308    }
309
310    #[inline]
311    pub fn includes_meteora_damm_v2(&self) -> bool {
312        self.includes_any(&[
313            EventType::MeteoraDammV2Swap,
314            EventType::MeteoraDammV2AddLiquidity,
315            EventType::MeteoraDammV2CreatePosition,
316            EventType::MeteoraDammV2ClosePosition,
317            EventType::MeteoraDammV2InitializePool,
318            EventType::MeteoraDammV2RemoveLiquidity,
319        ])
320    }
321
322    #[inline]
323    pub fn includes_pump_fees(&self) -> bool {
324        self.includes_any(&[
325            EventType::PumpFeesCreateFeeSharingConfig,
326            EventType::PumpFeesInitializeFeeConfig,
327            EventType::PumpFeesResetFeeSharingConfig,
328            EventType::PumpFeesRevokeFeeSharingAuthority,
329            EventType::PumpFeesTransferFeeSharingAuthority,
330            EventType::PumpFeesUpdateAdmin,
331            EventType::PumpFeesUpdateFeeConfig,
332            EventType::PumpFeesUpdateFeeShares,
333            EventType::PumpFeesUpsertFeeTiers,
334        ])
335    }
336
337    /// Check if PumpSwap protocol events are included in the filter
338    #[inline]
339    pub fn includes_pumpswap(&self) -> bool {
340        self.includes_any(&[
341            EventType::PumpSwapTrade,
342            EventType::PumpSwapBuy,
343            EventType::PumpSwapSell,
344            EventType::PumpSwapCreatePool,
345            EventType::PumpSwapLiquidityAdded,
346            EventType::PumpSwapLiquidityRemoved,
347        ])
348    }
349
350    /// Check if Raydium LaunchLab events are included in the filter.
351    #[inline]
352    pub fn includes_raydium_launchlab(&self) -> bool {
353        self.includes_any(&[
354            EventType::RaydiumLaunchlabTrade,
355            EventType::RaydiumLaunchlabPoolCreate,
356            EventType::RaydiumLaunchlabMigrateAmm,
357        ])
358    }
359
360    #[inline]
361    pub fn includes_raydium_cpmm(&self) -> bool {
362        self.includes_any(&[
363            EventType::RaydiumCpmmSwap,
364            EventType::RaydiumCpmmDeposit,
365            EventType::RaydiumCpmmWithdraw,
366            EventType::RaydiumCpmmInitialize,
367        ])
368    }
369
370    #[inline]
371    pub fn includes_raydium_clmm(&self) -> bool {
372        self.includes_any(&[
373            EventType::RaydiumClmmSwap,
374            EventType::RaydiumClmmCreatePool,
375            EventType::RaydiumClmmOpenPosition,
376            EventType::RaydiumClmmClosePosition,
377            EventType::RaydiumClmmIncreaseLiquidity,
378            EventType::RaydiumClmmDecreaseLiquidity,
379            EventType::RaydiumClmmLiquidityChange,
380            EventType::RaydiumClmmConfigChange,
381            EventType::RaydiumClmmCreatePersonalPosition,
382            EventType::RaydiumClmmLiquidityCalculate,
383            EventType::RaydiumClmmOpenLimitOrder,
384            EventType::RaydiumClmmIncreaseLimitOrder,
385            EventType::RaydiumClmmDecreaseLimitOrder,
386            EventType::RaydiumClmmSettleLimitOrder,
387            EventType::RaydiumClmmUpdateRewardInfos,
388            EventType::RaydiumClmmOpenPositionWithTokenExtNft,
389            EventType::RaydiumClmmCollectFee,
390        ])
391    }
392
393    #[inline]
394    pub fn includes_raydium_amm_v4(&self) -> bool {
395        self.includes_any(&[
396            EventType::RaydiumAmmV4Swap,
397            EventType::RaydiumAmmV4Deposit,
398            EventType::RaydiumAmmV4Withdraw,
399            EventType::RaydiumAmmV4Initialize2,
400            EventType::RaydiumAmmV4WithdrawPnl,
401        ])
402    }
403
404    #[inline]
405    pub fn includes_orca_whirlpool(&self) -> bool {
406        self.includes_any(&[
407            EventType::OrcaWhirlpoolSwap,
408            EventType::OrcaWhirlpoolLiquidityIncreased,
409            EventType::OrcaWhirlpoolLiquidityDecreased,
410            EventType::OrcaWhirlpoolPoolInitialized,
411        ])
412    }
413
414    #[inline]
415    pub fn includes_meteora_pools(&self) -> bool {
416        self.includes_any(&[
417            EventType::MeteoraPoolsSwap,
418            EventType::MeteoraPoolsAddLiquidity,
419            EventType::MeteoraPoolsRemoveLiquidity,
420            EventType::MeteoraPoolsBootstrapLiquidity,
421            EventType::MeteoraPoolsPoolCreated,
422            EventType::MeteoraPoolsSetPoolFees,
423        ])
424    }
425
426    #[inline]
427    pub fn includes_meteora_dlmm(&self) -> bool {
428        self.includes_any(&[
429            EventType::MeteoraDlmmSwap,
430            EventType::MeteoraDlmmAddLiquidity,
431            EventType::MeteoraDlmmRemoveLiquidity,
432            EventType::MeteoraDlmmInitializePool,
433            EventType::MeteoraDlmmInitializeBinArray,
434            EventType::MeteoraDlmmCreatePosition,
435            EventType::MeteoraDlmmClosePosition,
436            EventType::MeteoraDlmmClaimFee,
437        ])
438    }
439
440    #[inline]
441    pub fn includes_meteora_dbc(&self) -> bool {
442        self.includes_any(&[
443            EventType::MeteoraDbcSwap,
444            EventType::MeteoraDbcInitializePool,
445            EventType::MeteoraDbcCurveComplete,
446        ])
447    }
448}
449
450#[inline]
451fn pumpfun_trade_filter_is_generic(include_only: &[EventType]) -> bool {
452    include_only.contains(&EventType::PumpFunTrade)
453        && !include_only.iter().any(|t| {
454            matches!(
455                t,
456                EventType::PumpFunBuy | EventType::PumpFunSell | EventType::PumpFunBuyExactSolIn
457            )
458        })
459}
460
461#[inline]
462fn pumpfun_buy_filter_is_generic(include_only: &[EventType]) -> bool {
463    include_only.contains(&EventType::PumpFunBuy)
464        && !include_only.contains(&EventType::PumpFunBuyExactSolIn)
465}
466
467#[inline]
468fn is_pumpfun_create_family(event_type: EventType) -> bool {
469    matches!(
470        event_type,
471        EventType::PumpFunCreate | EventType::PumpFunCreateV2
472    )
473}
474
475#[inline]
476pub fn event_type_from_dex_event(event: &crate::core::events::DexEvent) -> Option<EventType> {
477    use crate::core::events::DexEvent;
478    match event {
479        DexEvent::PumpFunCreate(_) => Some(EventType::PumpFunCreate),
480        DexEvent::PumpFunCreateV2(_) => Some(EventType::PumpFunCreateV2),
481        DexEvent::PumpFunTrade(_) => Some(EventType::PumpFunTrade),
482        DexEvent::PumpFunBuy(_) => Some(EventType::PumpFunBuy),
483        DexEvent::PumpFunSell(_) => Some(EventType::PumpFunSell),
484        DexEvent::PumpFunBuyExactSolIn(_) => Some(EventType::PumpFunBuyExactSolIn),
485        DexEvent::PumpFunMigrate(_) => Some(EventType::PumpFunMigrate),
486        DexEvent::PumpFeesCreateFeeSharingConfig(_) => {
487            Some(EventType::PumpFeesCreateFeeSharingConfig)
488        }
489        DexEvent::PumpFeesInitializeFeeConfig(_) => Some(EventType::PumpFeesInitializeFeeConfig),
490        DexEvent::PumpFeesResetFeeSharingConfig(_) => {
491            Some(EventType::PumpFeesResetFeeSharingConfig)
492        }
493        DexEvent::PumpFeesRevokeFeeSharingAuthority(_) => {
494            Some(EventType::PumpFeesRevokeFeeSharingAuthority)
495        }
496        DexEvent::PumpFeesTransferFeeSharingAuthority(_) => {
497            Some(EventType::PumpFeesTransferFeeSharingAuthority)
498        }
499        DexEvent::PumpFeesUpdateAdmin(_) => Some(EventType::PumpFeesUpdateAdmin),
500        DexEvent::PumpFeesUpdateFeeConfig(_) => Some(EventType::PumpFeesUpdateFeeConfig),
501        DexEvent::PumpFeesUpdateFeeShares(_) => Some(EventType::PumpFeesUpdateFeeShares),
502        DexEvent::PumpFeesUpsertFeeTiers(_) => Some(EventType::PumpFeesUpsertFeeTiers),
503        DexEvent::PumpFunMigrateBondingCurveCreator(_) => {
504            Some(EventType::PumpFunMigrateBondingCurveCreator)
505        }
506        DexEvent::PumpFunGlobalAccount(_) => Some(EventType::AccountPumpFunGlobal),
507        DexEvent::PumpFunBondingCurveAccount(_) => Some(EventType::AccountPumpFunBondingCurve),
508        DexEvent::PumpFunFeeConfigAccount(_) => Some(EventType::AccountPumpFunFeeConfig),
509        DexEvent::PumpFunSharingConfigAccount(_) => Some(EventType::AccountPumpFunSharingConfig),
510        DexEvent::PumpFunGlobalVolumeAccumulatorAccount(_) => {
511            Some(EventType::AccountPumpFunGlobalVolumeAccumulator)
512        }
513        DexEvent::PumpFunUserVolumeAccumulatorAccount(_) => {
514            Some(EventType::AccountPumpFunUserVolumeAccumulator)
515        }
516        DexEvent::PumpSwapTrade(_) => Some(EventType::PumpSwapTrade),
517        DexEvent::PumpSwapBuy(_) => Some(EventType::PumpSwapBuy),
518        DexEvent::PumpSwapSell(_) => Some(EventType::PumpSwapSell),
519        DexEvent::PumpSwapCreatePool(_) => Some(EventType::PumpSwapCreatePool),
520        DexEvent::PumpSwapLiquidityAdded(_) => Some(EventType::PumpSwapLiquidityAdded),
521        DexEvent::PumpSwapLiquidityRemoved(_) => Some(EventType::PumpSwapLiquidityRemoved),
522        DexEvent::MeteoraDammV2Swap(_) => Some(EventType::MeteoraDammV2Swap),
523        DexEvent::MeteoraDammV2CreatePosition(_) => Some(EventType::MeteoraDammV2CreatePosition),
524        DexEvent::MeteoraDammV2ClosePosition(_) => Some(EventType::MeteoraDammV2ClosePosition),
525        DexEvent::MeteoraDammV2AddLiquidity(_) => Some(EventType::MeteoraDammV2AddLiquidity),
526        DexEvent::MeteoraDammV2RemoveLiquidity(_) => Some(EventType::MeteoraDammV2RemoveLiquidity),
527        DexEvent::MeteoraDammV2InitializePool(_) => Some(EventType::MeteoraDammV2InitializePool),
528        DexEvent::MeteoraDbcSwap(_) => Some(EventType::MeteoraDbcSwap),
529        DexEvent::MeteoraDbcInitializePool(_) => Some(EventType::MeteoraDbcInitializePool),
530        DexEvent::MeteoraDbcCurveComplete(_) => Some(EventType::MeteoraDbcCurveComplete),
531        DexEvent::RaydiumLaunchlabTrade(_) => Some(EventType::RaydiumLaunchlabTrade),
532        DexEvent::RaydiumLaunchlabPoolCreate(_) => Some(EventType::RaydiumLaunchlabPoolCreate),
533        DexEvent::RaydiumLaunchlabMigrateAmm(_) => Some(EventType::RaydiumLaunchlabMigrateAmm),
534        DexEvent::RaydiumClmmSwap(_) => Some(EventType::RaydiumClmmSwap),
535        DexEvent::RaydiumClmmCreatePool(_) => Some(EventType::RaydiumClmmCreatePool),
536        DexEvent::RaydiumClmmOpenPosition(_) => Some(EventType::RaydiumClmmOpenPosition),
537        DexEvent::RaydiumClmmOpenPositionWithTokenExtNft(_) => {
538            Some(EventType::RaydiumClmmOpenPositionWithTokenExtNft)
539        }
540        DexEvent::RaydiumClmmClosePosition(_) => Some(EventType::RaydiumClmmClosePosition),
541        DexEvent::RaydiumClmmIncreaseLiquidity(_) => Some(EventType::RaydiumClmmIncreaseLiquidity),
542        DexEvent::RaydiumClmmDecreaseLiquidity(_) => Some(EventType::RaydiumClmmDecreaseLiquidity),
543        DexEvent::RaydiumClmmLiquidityChange(_) => Some(EventType::RaydiumClmmLiquidityChange),
544        DexEvent::RaydiumClmmConfigChange(_) => Some(EventType::RaydiumClmmConfigChange),
545        DexEvent::RaydiumClmmCreatePersonalPosition(_) => {
546            Some(EventType::RaydiumClmmCreatePersonalPosition)
547        }
548        DexEvent::RaydiumClmmLiquidityCalculate(_) => {
549            Some(EventType::RaydiumClmmLiquidityCalculate)
550        }
551        DexEvent::RaydiumClmmOpenLimitOrder(_) => Some(EventType::RaydiumClmmOpenLimitOrder),
552        DexEvent::RaydiumClmmIncreaseLimitOrder(_) => {
553            Some(EventType::RaydiumClmmIncreaseLimitOrder)
554        }
555        DexEvent::RaydiumClmmDecreaseLimitOrder(_) => {
556            Some(EventType::RaydiumClmmDecreaseLimitOrder)
557        }
558        DexEvent::RaydiumClmmSettleLimitOrder(_) => Some(EventType::RaydiumClmmSettleLimitOrder),
559        DexEvent::RaydiumClmmUpdateRewardInfos(_) => Some(EventType::RaydiumClmmUpdateRewardInfos),
560        DexEvent::RaydiumClmmCollectFee(_) => Some(EventType::RaydiumClmmCollectFee),
561        DexEvent::RaydiumClmmAmmConfigAccount(_) => Some(EventType::AccountRaydiumClmmAmmConfig),
562        DexEvent::RaydiumClmmPoolStateAccount(_) => Some(EventType::AccountRaydiumClmmPoolState),
563        DexEvent::RaydiumClmmTickArrayStateAccount(_) => {
564            Some(EventType::AccountRaydiumClmmTickArrayState)
565        }
566        DexEvent::RaydiumCpmmSwap(_) => Some(EventType::RaydiumCpmmSwap),
567        DexEvent::RaydiumCpmmDeposit(_) => Some(EventType::RaydiumCpmmDeposit),
568        DexEvent::RaydiumCpmmWithdraw(_) => Some(EventType::RaydiumCpmmWithdraw),
569        DexEvent::RaydiumCpmmInitialize(_) => Some(EventType::RaydiumCpmmInitialize),
570        DexEvent::RaydiumCpmmAmmConfigAccount(_) => Some(EventType::AccountRaydiumCpmmAmmConfig),
571        DexEvent::RaydiumCpmmPoolStateAccount(_) => Some(EventType::AccountRaydiumCpmmPoolState),
572        DexEvent::RaydiumAmmV4Swap(_) => Some(EventType::RaydiumAmmV4Swap),
573        DexEvent::RaydiumAmmV4Deposit(_) => Some(EventType::RaydiumAmmV4Deposit),
574        DexEvent::RaydiumAmmV4Initialize2(_) => Some(EventType::RaydiumAmmV4Initialize2),
575        DexEvent::RaydiumAmmV4Withdraw(_) => Some(EventType::RaydiumAmmV4Withdraw),
576        DexEvent::RaydiumAmmV4WithdrawPnl(_) => Some(EventType::RaydiumAmmV4WithdrawPnl),
577        DexEvent::OrcaWhirlpoolSwap(_) => Some(EventType::OrcaWhirlpoolSwap),
578        DexEvent::OrcaWhirlpoolLiquidityIncreased(_) => {
579            Some(EventType::OrcaWhirlpoolLiquidityIncreased)
580        }
581        DexEvent::OrcaWhirlpoolLiquidityDecreased(_) => {
582            Some(EventType::OrcaWhirlpoolLiquidityDecreased)
583        }
584        DexEvent::OrcaWhirlpoolPoolInitialized(_) => Some(EventType::OrcaWhirlpoolPoolInitialized),
585        DexEvent::OrcaWhirlpoolAccount(_) => Some(EventType::AccountOrcaWhirlpool),
586        DexEvent::OrcaPositionAccount(_) => Some(EventType::AccountOrcaPosition),
587        DexEvent::OrcaTickArrayAccount(_) => Some(EventType::AccountOrcaTickArray),
588        DexEvent::OrcaFeeTierAccount(_) => Some(EventType::AccountOrcaFeeTier),
589        DexEvent::OrcaWhirlpoolsConfigAccount(_) => Some(EventType::AccountOrcaWhirlpoolsConfig),
590        DexEvent::MeteoraPoolsSwap(_) => Some(EventType::MeteoraPoolsSwap),
591        DexEvent::MeteoraPoolsAddLiquidity(_) => Some(EventType::MeteoraPoolsAddLiquidity),
592        DexEvent::MeteoraPoolsRemoveLiquidity(_) => Some(EventType::MeteoraPoolsRemoveLiquidity),
593        DexEvent::MeteoraPoolsBootstrapLiquidity(_) => {
594            Some(EventType::MeteoraPoolsBootstrapLiquidity)
595        }
596        DexEvent::MeteoraPoolsPoolCreated(_) => Some(EventType::MeteoraPoolsPoolCreated),
597        DexEvent::MeteoraPoolsSetPoolFees(_) => Some(EventType::MeteoraPoolsSetPoolFees),
598        DexEvent::MeteoraDlmmSwap(_) => Some(EventType::MeteoraDlmmSwap),
599        DexEvent::MeteoraDlmmAddLiquidity(_) => Some(EventType::MeteoraDlmmAddLiquidity),
600        DexEvent::MeteoraDlmmRemoveLiquidity(_) => Some(EventType::MeteoraDlmmRemoveLiquidity),
601        DexEvent::MeteoraDlmmInitializePool(_) => Some(EventType::MeteoraDlmmInitializePool),
602        DexEvent::MeteoraDlmmInitializeBinArray(_) => {
603            Some(EventType::MeteoraDlmmInitializeBinArray)
604        }
605        DexEvent::MeteoraDlmmCreatePosition(_) => Some(EventType::MeteoraDlmmCreatePosition),
606        DexEvent::MeteoraDlmmClosePosition(_) => Some(EventType::MeteoraDlmmClosePosition),
607        DexEvent::MeteoraDlmmClaimFee(_) => Some(EventType::MeteoraDlmmClaimFee),
608        DexEvent::TokenAccount(_) => Some(EventType::TokenAccount),
609        DexEvent::TokenInfo(_) => Some(EventType::TokenInfo),
610        DexEvent::NonceAccount(_) => Some(EventType::NonceAccount),
611        DexEvent::PumpSwapGlobalConfigAccount(_) => Some(EventType::AccountPumpSwapGlobalConfig),
612        DexEvent::PumpSwapPoolAccount(_) => Some(EventType::AccountPumpSwapPool),
613        DexEvent::BlockMeta(_) => Some(EventType::BlockMeta),
614        DexEvent::Error(_) => None,
615    }
616}