1use serde::{Deserialize, Serialize};
7use solana_sdk::{pubkey::Pubkey, signature::Signature};
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct EventMetadata {
12 pub signature: Signature,
13 pub slot: u64,
14 pub tx_index: u64, pub block_time_us: i64,
16 pub grpc_recv_us: i64,
17}
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct BlockMetaEvent {
22 pub metadata: EventMetadata,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct BonkPoolCreateEvent {
28 pub metadata: EventMetadata,
29 pub base_mint_param: BaseMintParam,
30 pub pool_state: Pubkey,
31 pub creator: Pubkey,
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct BaseMintParam {
36 pub symbol: String,
37 pub name: String,
38 pub uri: String,
39 pub decimals: u8,
40}
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
44pub struct BonkTradeEvent {
45 pub metadata: EventMetadata,
46 pub pool_state: Pubkey,
48 pub user: Pubkey,
49 pub amount_in: u64,
50 pub amount_out: u64,
51 pub is_buy: bool,
52 pub trade_direction: TradeDirection,
53 pub exact_in: bool,
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
57pub enum TradeDirection {
58 Buy,
59 Sell,
60}
61
62#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct BonkMigrateAmmEvent {
65 pub metadata: EventMetadata,
66 pub old_pool: Pubkey,
67 pub new_pool: Pubkey,
68 pub user: Pubkey,
69 pub liquidity_amount: u64,
70}
71
72#[derive(Debug, Clone, Serialize, Deserialize)]
78pub struct PumpFunTradeEvent {
79 pub metadata: EventMetadata,
80
81 pub mint: Pubkey,
83 pub sol_amount: u64,
84 pub token_amount: u64,
85 pub is_buy: bool,
86 pub is_created_buy: bool,
87 pub user: Pubkey,
88 pub timestamp: i64,
89 pub virtual_sol_reserves: u64,
90 pub virtual_token_reserves: u64,
91 pub real_sol_reserves: u64,
92 pub real_token_reserves: u64,
93 pub fee_recipient: Pubkey,
94 pub fee_basis_points: u64,
95 pub fee: u64,
96 pub creator: Pubkey,
97 pub creator_fee_basis_points: u64,
98 pub creator_fee: u64,
99 pub track_volume: bool,
100 pub total_unclaimed_tokens: u64,
101 pub total_claimed_tokens: u64,
102 pub current_sol_volume: u64,
103 pub last_update_timestamp: i64,
104
105 }
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119pub struct PumpFunCompleteTokenEvent {
120 pub metadata: EventMetadata,
121 pub user: Pubkey,
122 pub mint: Pubkey,
123 pub bonding_curve: Pubkey,
124 pub timestamp: i64,
125}
126
127#[derive(Debug, Clone, Serialize, Deserialize)]
129pub struct PumpFunMigrateEvent {
130 pub metadata: EventMetadata,
131 pub user: Pubkey,
132 pub mint: Pubkey,
133 pub mint_amount: u64,
134 pub sol_amount: u64,
135 pub pool_migration_fee: u64,
136 pub bonding_curve: Pubkey,
137 pub timestamp: i64,
138 pub pool: Pubkey,
139 }
154
155#[derive(Debug, Clone, Serialize, Deserialize)]
157pub struct PumpFunCreateTokenEvent {
158 pub metadata: EventMetadata,
159 pub name: String,
161 pub symbol: String,
162 pub uri: String,
163 pub mint: Pubkey,
164 pub bonding_curve: Pubkey,
165 pub user: Pubkey,
166 pub creator: Pubkey,
167 pub timestamp: i64,
168 pub virtual_token_reserves: u64,
169 pub virtual_sol_reserves: u64,
170 pub real_token_reserves: u64,
171 pub token_total_supply: u64,
172}
173
174#[derive(Debug, Clone, Serialize, Deserialize)]
176pub struct PumpSwapBuyEvent {
177 pub metadata: EventMetadata,
178 pub pool_id: Pubkey,
179 pub user: Pubkey,
180 pub token_mint: Pubkey,
181 pub sol_amount: u64,
182 pub token_amount: u64,
183 pub price: u64,
184 pub slippage: u16,
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
189pub struct PumpSwapSellEvent {
190 pub metadata: EventMetadata,
191 pub pool_id: Pubkey,
192 pub user: Pubkey,
193 pub token_mint: Pubkey,
194 pub token_amount: u64,
195 pub sol_amount: u64,
196 pub price: u64,
197 pub slippage: u16,
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202pub struct PumpSwapCreatePoolEvent {
203 pub metadata: EventMetadata,
204 pub pool_id: Pubkey,
205 pub creator: Pubkey,
206 pub token_mint: Pubkey,
207 pub initial_sol_amount: u64,
208 pub initial_token_amount: u64,
209 pub fee_rate: u16,
210}
211
212#[derive(Debug, Clone, Serialize, Deserialize)]
214pub struct PumpSwapPoolCreated {
215 pub metadata: EventMetadata,
216 pub pool_account: Pubkey,
217 pub token_a_mint: Pubkey,
218 pub token_b_mint: Pubkey,
219 pub token_a_vault: Pubkey,
220 pub token_b_vault: Pubkey,
221 pub lp_mint: Pubkey,
222 pub creator: Pubkey,
223 pub authority: Pubkey,
224 pub initial_token_a_amount: u64,
225 pub initial_token_b_amount: u64,
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230pub struct PumpSwapTrade {
231 pub metadata: EventMetadata,
232 pub pool_account: Pubkey,
233 pub user: Pubkey,
234 pub user_token_in_account: Pubkey,
235 pub user_token_out_account: Pubkey,
236 pub pool_token_in_vault: Pubkey,
237 pub pool_token_out_vault: Pubkey,
238 pub token_in_mint: Pubkey,
239 pub token_out_mint: Pubkey,
240 pub amount_in: u64,
241 pub minimum_amount_out: u64,
242 pub is_token_a_to_b: bool,
243}
244
245#[derive(Debug, Clone, Serialize, Deserialize)]
247pub struct PumpSwapLiquidityAdded {
248 pub metadata: EventMetadata,
249 pub pool_account: Pubkey,
250 pub user: Pubkey,
251 pub user_token_a_account: Pubkey,
252 pub user_token_b_account: Pubkey,
253 pub user_lp_token_account: Pubkey,
254 pub pool_token_a_vault: Pubkey,
255 pub pool_token_b_vault: Pubkey,
256 pub lp_mint: Pubkey,
257 pub token_a_mint: Pubkey,
258 pub token_b_mint: Pubkey,
259 pub max_token_a_amount: u64,
260 pub max_token_b_amount: u64,
261 pub min_lp_tokens: u64,
262}
263
264#[derive(Debug, Clone, Serialize, Deserialize)]
266pub struct PumpSwapLiquidityRemoved {
267 pub metadata: EventMetadata,
268 pub pool_account: Pubkey,
269 pub user: Pubkey,
270 pub user_token_a_account: Pubkey,
271 pub user_token_b_account: Pubkey,
272 pub user_lp_token_account: Pubkey,
273 pub pool_token_a_vault: Pubkey,
274 pub pool_token_b_vault: Pubkey,
275 pub lp_mint: Pubkey,
276 pub token_a_mint: Pubkey,
277 pub token_b_mint: Pubkey,
278 pub lp_tokens_to_burn: u64,
279 pub min_token_a_amount: u64,
280 pub min_token_b_amount: u64,
281}
282
283#[derive(Debug, Clone, Serialize, Deserialize)]
285pub struct PumpSwapPoolUpdated {
286 pub metadata: EventMetadata,
287 pub pool_account: Pubkey,
288 pub authority: Pubkey,
289 pub admin: Pubkey,
290 pub new_fee_rate: u64,
291}
292
293#[derive(Debug, Clone, Serialize, Deserialize)]
295pub struct PumpSwapFeesClaimed {
296 pub metadata: EventMetadata,
297 pub pool_account: Pubkey,
298 pub authority: Pubkey,
299 pub admin: Pubkey,
300 pub admin_token_a_account: Pubkey,
301 pub admin_token_b_account: Pubkey,
302 pub pool_fee_vault: Pubkey,
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307pub struct PumpSwapDepositEvent {
308 pub metadata: EventMetadata,
309 pub pool: Pubkey,
310 pub user: Pubkey,
311 pub amount: u64,
312}
313
314#[derive(Debug, Clone, Serialize, Deserialize)]
316pub struct PumpSwapWithdrawEvent {
317 pub metadata: EventMetadata,
318 pub pool: Pubkey,
319 pub user: Pubkey,
320 pub amount: u64,
321}
322
323#[derive(Debug, Clone, Serialize, Deserialize)]
325pub struct RaydiumCpmmSwapEvent {
326 pub metadata: EventMetadata,
327
328 pub pool_id: Pubkey,
330 pub input_vault_before: u64,
331 pub output_vault_before: u64,
332 pub input_amount: u64,
333 pub output_amount: u64,
334 pub input_transfer_fee: u64,
335 pub output_transfer_fee: u64,
336 pub base_input: bool,
337
338 }
354
355#[derive(Debug, Clone, Serialize, Deserialize)]
357pub struct RaydiumCpmmDepositEvent {
358 pub metadata: EventMetadata,
359 pub pool: Pubkey,
360 pub user: Pubkey,
361 pub lp_token_amount: u64,
362 pub token0_amount: u64,
363 pub token1_amount: u64,
364}
365
366#[derive(Debug, Clone, Serialize, Deserialize)]
368pub struct RaydiumCpmmInitializeEvent {
369 pub metadata: EventMetadata,
370 pub pool: Pubkey,
371 pub creator: Pubkey,
372 pub init_amount0: u64,
373 pub init_amount1: u64,
374}
375
376#[derive(Debug, Clone, Serialize, Deserialize)]
378pub struct RaydiumCpmmWithdrawEvent {
379 pub metadata: EventMetadata,
380 pub pool: Pubkey,
381 pub user: Pubkey,
382 pub lp_token_amount: u64,
383 pub token0_amount: u64,
384 pub token1_amount: u64,
385}
386
387#[derive(Debug, Clone, Serialize, Deserialize)]
389pub struct RaydiumClmmSwapEvent {
390 pub metadata: EventMetadata,
391
392 pub pool_state: Pubkey,
394 pub sender: Pubkey,
395 pub token_account_0: Pubkey,
396 pub token_account_1: Pubkey,
397 pub amount_0: u64,
398 pub transfer_fee_0: u64,
399 pub amount_1: u64,
400 pub transfer_fee_1: u64,
401 pub zero_for_one: bool,
402 pub sqrt_price_x64: u128,
403 pub liquidity: u128,
404 pub tick: i32,
405
406 }
415
416#[derive(Debug, Clone, Serialize, Deserialize)]
418pub struct RaydiumClmmClosePositionEvent {
419 pub metadata: EventMetadata,
420 pub pool: Pubkey,
421 pub user: Pubkey,
422 pub position_nft_mint: Pubkey,
423}
424
425#[derive(Debug, Clone, Serialize, Deserialize)]
427pub struct RaydiumClmmDecreaseLiquidityEvent {
428 pub metadata: EventMetadata,
429 pub pool: Pubkey,
430 pub user: Pubkey,
431 pub liquidity: u128,
432 pub amount0_min: u64,
433 pub amount1_min: u64,
434}
435
436#[derive(Debug, Clone, Serialize, Deserialize)]
438pub struct RaydiumClmmCollectFeeEvent {
439 pub metadata: EventMetadata,
440 pub pool_state: Pubkey,
441 pub position_nft_mint: Pubkey,
442 pub amount_0: u64,
443 pub amount_1: u64,
444}
445
446#[derive(Debug, Clone, Serialize, Deserialize)]
448pub struct RaydiumClmmCreatePoolEvent {
449 pub metadata: EventMetadata,
450 pub pool: Pubkey,
451 pub creator: Pubkey,
452 pub sqrt_price_x64: u128,
453 pub open_time: u64,
454}
455
456#[derive(Debug, Clone, Serialize, Deserialize)]
458pub struct RaydiumClmmIncreaseLiquidityEvent {
459 pub metadata: EventMetadata,
460 pub pool: Pubkey,
461 pub user: Pubkey,
462 pub liquidity: u128,
463 pub amount0_max: u64,
464 pub amount1_max: u64,
465}
466
467#[derive(Debug, Clone, Serialize, Deserialize)]
469pub struct RaydiumClmmOpenPositionWithTokenExtNftEvent {
470 pub metadata: EventMetadata,
471 pub pool: Pubkey,
472 pub user: Pubkey,
473 pub position_nft_mint: Pubkey,
474 pub tick_lower_index: i32,
475 pub tick_upper_index: i32,
476 pub liquidity: u128,
477}
478
479#[derive(Debug, Clone, Serialize, Deserialize)]
481pub struct RaydiumClmmOpenPositionEvent {
482 pub metadata: EventMetadata,
483 pub pool: Pubkey,
484 pub user: Pubkey,
485 pub position_nft_mint: Pubkey,
486 pub tick_lower_index: i32,
487 pub tick_upper_index: i32,
488 pub liquidity: u128,
489}
490
491#[derive(Debug, Clone, Serialize, Deserialize)]
493pub struct RaydiumAmmDepositEvent {
494 pub metadata: EventMetadata,
495 pub amm_id: Pubkey,
496 pub user: Pubkey,
497 pub max_coin_amount: u64,
498 pub max_pc_amount: u64,
499}
500
501#[derive(Debug, Clone, Serialize, Deserialize)]
503pub struct RaydiumAmmInitializeAltEvent {
504 pub metadata: EventMetadata,
505 pub amm_id: Pubkey,
506 pub creator: Pubkey,
507 pub nonce: u8,
508 pub open_time: u64,
509}
510
511#[derive(Debug, Clone, Serialize, Deserialize)]
513pub struct RaydiumAmmWithdrawEvent {
514 pub metadata: EventMetadata,
515 pub amm_id: Pubkey,
516 pub user: Pubkey,
517 pub pool_coin_amount: u64,
518}
519
520#[derive(Debug, Clone, Serialize, Deserialize)]
522pub struct RaydiumAmmWithdrawPnlEvent {
523 pub metadata: EventMetadata,
524 pub amm_id: Pubkey,
525 pub user: Pubkey,
526}
527
528#[derive(Debug, Clone, Serialize, Deserialize)]
532pub struct RaydiumAmmV4SwapEvent {
533 pub metadata: EventMetadata,
534 pub amount_in: u64,
536 pub minimum_amount_out: u64,
537 pub max_amount_in: u64,
539 pub amount_out: u64,
540
541 pub token_program: Pubkey,
542 pub amm: Pubkey,
543 pub amm_authority: Pubkey,
544 pub amm_open_orders: Pubkey,
545 pub amm_target_orders: Option<Pubkey>,
546 pub pool_coin_token_account: Pubkey,
547 pub pool_pc_token_account: Pubkey,
548 pub serum_program: Pubkey,
549 pub serum_market: Pubkey,
550 pub serum_bids: Pubkey,
551 pub serum_asks: Pubkey,
552 pub serum_event_queue: Pubkey,
553 pub serum_coin_vault_account: Pubkey,
554 pub serum_pc_vault_account: Pubkey,
555 pub serum_vault_signer: Pubkey,
556 pub user_source_token_account: Pubkey,
557 pub user_destination_token_account: Pubkey,
558 pub user_source_owner: Pubkey,
559}
560
561#[derive(Debug, Clone, Serialize, Deserialize)]
563pub struct RaydiumAmmV4DepositEvent {
564 pub metadata: EventMetadata,
565 pub max_coin_amount: u64,
566 pub max_pc_amount: u64,
567 pub base_side: u64,
568
569 pub token_program: Pubkey,
570 pub amm: Pubkey,
571 pub amm_authority: Pubkey,
572 pub amm_open_orders: Pubkey,
573 pub amm_target_orders: Pubkey,
574 pub lp_mint_address: Pubkey,
575 pub pool_coin_token_account: Pubkey,
576 pub pool_pc_token_account: Pubkey,
577 pub serum_market: Pubkey,
578 pub user_coin_token_account: Pubkey,
579 pub user_pc_token_account: Pubkey,
580 pub user_lp_token_account: Pubkey,
581 pub user_owner: Pubkey,
582 pub serum_event_queue: Pubkey,
583}
584
585#[derive(Debug, Clone, Serialize, Deserialize)]
587pub struct RaydiumAmmV4Initialize2Event {
588 pub metadata: EventMetadata,
589 pub nonce: u8,
590 pub open_time: u64,
591 pub init_pc_amount: u64,
592 pub init_coin_amount: u64,
593
594 pub token_program: Pubkey,
595 pub spl_associated_token_account: Pubkey,
596 pub system_program: Pubkey,
597 pub rent: Pubkey,
598 pub amm: Pubkey,
599 pub amm_authority: Pubkey,
600 pub amm_open_orders: Pubkey,
601 pub lp_mint: Pubkey,
602 pub coin_mint: Pubkey,
603 pub pc_mint: Pubkey,
604 pub pool_coin_token_account: Pubkey,
605 pub pool_pc_token_account: Pubkey,
606 pub pool_withdraw_queue: Pubkey,
607 pub amm_target_orders: Pubkey,
608 pub pool_temp_lp: Pubkey,
609 pub serum_program: Pubkey,
610 pub serum_market: Pubkey,
611 pub user_wallet: Pubkey,
612 pub user_token_coin: Pubkey,
613 pub user_token_pc: Pubkey,
614 pub user_lp_token_account: Pubkey,
615}
616
617#[derive(Debug, Clone, Serialize, Deserialize)]
619pub struct RaydiumAmmV4WithdrawEvent {
620 pub metadata: EventMetadata,
621 pub amount: u64,
622
623 pub token_program: Pubkey,
624 pub amm: Pubkey,
625 pub amm_authority: Pubkey,
626 pub amm_open_orders: Pubkey,
627 pub amm_target_orders: Pubkey,
628 pub lp_mint_address: Pubkey,
629 pub pool_coin_token_account: Pubkey,
630 pub pool_pc_token_account: Pubkey,
631 pub pool_withdraw_queue: Pubkey,
632 pub pool_temp_lp_token_account: Pubkey,
633 pub serum_program: Pubkey,
634 pub serum_market: Pubkey,
635 pub serum_coin_vault_account: Pubkey,
636 pub serum_pc_vault_account: Pubkey,
637 pub serum_vault_signer: Pubkey,
638 pub user_lp_token_account: Pubkey,
639 pub user_coin_token_account: Pubkey,
640 pub user_pc_token_account: Pubkey,
641 pub user_owner: Pubkey,
642 pub serum_event_queue: Pubkey,
643 pub serum_bids: Pubkey,
644 pub serum_asks: Pubkey,
645}
646
647#[derive(Debug, Clone, Serialize, Deserialize)]
649pub struct RaydiumAmmV4WithdrawPnlEvent {
650 pub metadata: EventMetadata,
651
652 pub token_program: Pubkey,
653 pub amm: Pubkey,
654 pub amm_config: Pubkey,
655 pub amm_authority: Pubkey,
656 pub amm_open_orders: Pubkey,
657 pub pool_coin_token_account: Pubkey,
658 pub pool_pc_token_account: Pubkey,
659 pub coin_pnl_token_account: Pubkey,
660 pub pc_pnl_token_account: Pubkey,
661 pub pnl_owner: Pubkey,
662 pub amm_target_orders: Pubkey,
663 pub serum_program: Pubkey,
664 pub serum_market: Pubkey,
665 pub serum_event_queue: Pubkey,
666 pub serum_coin_vault_account: Pubkey,
667 pub serum_pc_vault_account: Pubkey,
668 pub serum_vault_signer: Pubkey,
669}
670
671#[derive(Debug, Clone, Serialize, Deserialize)]
675pub struct BonkPoolStateAccountEvent {
676 pub metadata: EventMetadata,
677 pub pubkey: Pubkey,
678 pub pool_state: BonkPoolState,
679}
680
681#[derive(Debug, Clone, Serialize, Deserialize)]
682pub struct BonkPoolState {
683 pub creator: Pubkey,
684 pub base_mint: Pubkey,
685 pub quote_mint: Pubkey,
686 pub virtual_base: u64,
687 pub virtual_quote: u64,
688 pub real_base: u64,
689 pub real_quote: u64,
690}
691
692#[derive(Debug, Clone, Serialize, Deserialize)]
694pub struct BonkGlobalConfigAccountEvent {
695 pub metadata: EventMetadata,
696 pub pubkey: Pubkey,
697 pub global_config: BonkGlobalConfig,
698}
699
700#[derive(Debug, Clone, Serialize, Deserialize)]
701pub struct BonkGlobalConfig {
702 pub protocol_fee_rate: u64,
703 pub trade_fee_rate: u64,
704 pub migration_fee_rate: u64,
705}
706
707#[derive(Debug, Clone, Serialize, Deserialize)]
709pub struct BonkPlatformConfigAccountEvent {
710 pub metadata: EventMetadata,
711 pub pubkey: Pubkey,
712 pub platform_config: BonkPlatformConfig,
713}
714
715#[derive(Debug, Clone, Serialize, Deserialize)]
716pub struct BonkPlatformConfig {
717 pub fee_recipient: Pubkey,
718 pub fee_rate: u64,
719}
720
721#[derive(Debug, Clone, Serialize, Deserialize)]
723pub struct PumpSwapGlobalConfigAccountEvent {
724 pub metadata: EventMetadata,
725 pub pubkey: Pubkey,
726 pub global_config: PumpSwapGlobalConfig,
727}
728
729#[derive(Debug, Clone, Serialize, Deserialize)]
730pub struct PumpSwapGlobalConfig {
731 pub fee_recipient: Pubkey,
732 pub fee_rate: u64,
733}
734
735#[derive(Debug, Clone, Serialize, Deserialize)]
737pub struct PumpSwapPoolAccountEvent {
738 pub metadata: EventMetadata,
739 pub pubkey: Pubkey,
740 pub pool: PumpSwapPool,
741}
742
743#[derive(Debug, Clone, Serialize, Deserialize)]
744pub struct PumpSwapPool {
745 pub base_mint: Pubkey,
746 pub quote_mint: Pubkey,
747 pub base_reserves: u64,
748 pub quote_reserves: u64,
749}
750
751#[derive(Debug, Clone, Serialize, Deserialize)]
753pub struct PumpFunBondingCurveAccountEvent {
754 pub metadata: EventMetadata,
755 pub pubkey: Pubkey,
756 pub bonding_curve: PumpFunBondingCurve,
757}
758
759#[derive(Debug, Clone, Serialize, Deserialize)]
760pub struct PumpFunBondingCurve {
761 pub virtual_token_reserves: u64,
762 pub virtual_sol_reserves: u64,
763 pub real_token_reserves: u64,
764 pub real_sol_reserves: u64,
765 pub token_total_supply: u64,
766 pub complete: bool,
767}
768
769#[derive(Debug, Clone, Serialize, Deserialize)]
771pub struct PumpFunGlobalAccountEvent {
772 pub metadata: EventMetadata,
773 pub pubkey: Pubkey,
774 pub global: PumpFunGlobal,
775}
776
777#[derive(Debug, Clone, Serialize, Deserialize)]
778pub struct PumpFunGlobal {
779 pub discriminator: u64,
780 pub initialized: bool,
781 pub authority: Pubkey,
782 pub fee_recipient: Pubkey,
783 pub initial_virtual_token_reserves: u64,
784 pub initial_virtual_sol_reserves: u64,
785 pub initial_real_token_reserves: u64,
786 pub token_total_supply: u64,
787 pub fee_basis_points: u64,
788}
789
790#[derive(Debug, Clone, Serialize, Deserialize)]
792pub struct RaydiumAmmAmmInfoAccountEvent {
793 pub metadata: EventMetadata,
794 pub pubkey: Pubkey,
795 pub amm_info: RaydiumAmmInfo,
796}
797
798#[derive(Debug, Clone, Serialize, Deserialize)]
799pub struct RaydiumAmmInfo {
800 pub status: u64,
801 pub nonce: u64,
802 pub order_num: u64,
803 pub depth: u64,
804 pub coin_decimals: u64,
805 pub pc_decimals: u64,
806 pub state: u64,
807 pub reset_flag: u64,
808 pub min_size: u64,
809 pub vol_max_cut_ratio: u64,
810 pub amount_wave_ratio: u64,
811 pub coin_lot_size: u64,
812 pub pc_lot_size: u64,
813 pub min_price_multiplier: u64,
814 pub max_price_multiplier: u64,
815 pub sys_decimal_value: u64,
816}
817
818#[derive(Debug, Clone, Serialize, Deserialize)]
820pub struct RaydiumClmmAmmConfigAccountEvent {
821 pub metadata: EventMetadata,
822 pub pubkey: Pubkey,
823 pub amm_config: RaydiumClmmAmmConfig,
824}
825
826#[derive(Debug, Clone, Serialize, Deserialize)]
827pub struct RaydiumClmmAmmConfig {
828 pub bump: u8,
829 pub index: u16,
830 pub owner: Pubkey,
831 pub protocol_fee_rate: u32,
832 pub trade_fee_rate: u32,
833 pub tick_spacing: u16,
834 pub fund_fee_rate: u32,
835 pub fund_owner: Pubkey,
836}
837
838#[derive(Debug, Clone, Serialize, Deserialize)]
840pub struct RaydiumClmmPoolStateAccountEvent {
841 pub metadata: EventMetadata,
842 pub pubkey: Pubkey,
843 pub pool_state: RaydiumClmmPoolState,
844}
845
846#[derive(Debug, Clone, Serialize, Deserialize)]
847pub struct RaydiumClmmPoolState {
848 pub bump: [u8; 1],
849 pub amm_config: Pubkey,
850 pub owner: Pubkey,
851 pub token_mint0: Pubkey,
852 pub token_mint1: Pubkey,
853 pub token_vault0: Pubkey,
854 pub token_vault1: Pubkey,
855 pub observation_key: Pubkey,
856 pub mint_decimals0: u8,
857 pub mint_decimals1: u8,
858 pub tick_spacing: u16,
859 pub liquidity: u128,
860 pub sqrt_price_x64: u128,
861 pub tick_current: i32,
862}
863
864#[derive(Debug, Clone, Serialize, Deserialize)]
866pub struct RaydiumClmmTickArrayStateAccountEvent {
867 pub metadata: EventMetadata,
868 pub pubkey: Pubkey,
869 pub tick_array_state: RaydiumClmmTickArrayState,
870}
871
872#[derive(Debug, Clone, Serialize, Deserialize)]
873pub struct RaydiumClmmTickArrayState {
874 pub discriminator: u64,
875 pub pool_id: Pubkey,
876 pub start_tick_index: i32,
877 pub ticks: Vec<Tick>,
878 pub initialized_tick_count: u8,
879}
880
881#[derive(Debug, Clone, Serialize, Deserialize)]
882pub struct Tick {
883 pub tick: i32,
884 pub liquidity_net: i128,
885 pub liquidity_gross: u128,
886 pub fee_growth_outside_0_x64: u128,
887 pub fee_growth_outside_1_x64: u128,
888 pub reward_growths_outside_x64: [u128; 3],
889}
890
891#[derive(Debug, Clone, Serialize, Deserialize)]
893pub struct RaydiumCpmmAmmConfigAccountEvent {
894 pub metadata: EventMetadata,
895 pub pubkey: Pubkey,
896 pub amm_config: RaydiumCpmmAmmConfig,
897}
898
899#[derive(Debug, Clone, Serialize, Deserialize)]
900pub struct RaydiumCpmmAmmConfig {
901 pub bump: u8,
902 pub disable_create_pool: bool,
903 pub index: u16,
904 pub trade_fee_rate: u64,
905 pub protocol_fee_rate: u64,
906 pub fund_fee_rate: u64,
907 pub create_pool_fee: u64,
908 pub protocol_owner: Pubkey,
909 pub fund_owner: Pubkey,
910}
911
912#[derive(Debug, Clone, Serialize, Deserialize)]
914pub struct RaydiumCpmmPoolStateAccountEvent {
915 pub metadata: EventMetadata,
916 pub pubkey: Pubkey,
917 pub pool_state: RaydiumCpmmPoolState,
918}
919
920#[derive(Debug, Clone, Serialize, Deserialize)]
921pub struct RaydiumCpmmPoolState {
922 pub amm_config: Pubkey,
923 pub pool_creator: Pubkey,
924 pub token0_vault: Pubkey,
925 pub token1_vault: Pubkey,
926 pub lp_mint: Pubkey,
927 pub token0_mint: Pubkey,
928 pub token1_mint: Pubkey,
929 pub token0_program: Pubkey,
930 pub token1_program: Pubkey,
931 pub auth_bump: u8,
932 pub status: u8,
933 pub lp_mint_decimals: u8,
934 pub mint0_decimals: u8,
935 pub mint1_decimals: u8,
936 pub lp_supply: u64,
937 pub protocol_fees_token0: u64,
938 pub protocol_fees_token1: u64,
939 pub fund_fees_token0: u64,
940 pub fund_fees_token1: u64,
941 pub open_time: u64,
942}
943
944#[derive(Debug, Clone, Serialize, Deserialize)]
946pub struct TokenAccountEvent {
947 pub metadata: EventMetadata,
948 pub pubkey: Pubkey,
949 pub owner: Pubkey,
950 pub mint: Pubkey,
951 pub amount: u64,
952 pub delegate: Option<Pubkey>,
953 pub state: u8,
954 pub is_native: Option<u64>,
955 pub delegated_amount: u64,
956 pub close_authority: Option<Pubkey>,
957}
958
959#[derive(Debug, Clone, Serialize, Deserialize)]
961pub struct NonceAccountEvent {
962 pub metadata: EventMetadata,
963 pub pubkey: Pubkey,
964 pub authority: Pubkey,
965 pub nonce: String,
966 pub fee_calculator: FeeCalculator,
967}
968
969#[derive(Debug, Clone, Serialize, Deserialize)]
970pub struct FeeCalculator {
971 pub lamports_per_signature: u64,
972}
973
974#[derive(Debug, Clone, Serialize, Deserialize)]
976pub struct TokenInfoEvent {
977 pub metadata: EventMetadata,
978 pub mint: Pubkey,
979 pub name: String,
980 pub symbol: String,
981 pub decimals: u8,
982 pub supply: u64,
983}
984
985#[derive(Debug, Clone, Serialize, Deserialize)]
989pub struct OrcaWhirlpoolSwapEvent {
990 pub metadata: EventMetadata,
991
992 pub whirlpool: Pubkey,
994 pub a_to_b: bool,
995 pub pre_sqrt_price: u128,
996 pub post_sqrt_price: u128,
997 pub input_amount: u64,
998 pub output_amount: u64,
999 pub input_transfer_fee: u64,
1000 pub output_transfer_fee: u64,
1001 pub lp_fee: u64,
1002 pub protocol_fee: u64,
1003
1004 }
1020
1021#[derive(Debug, Clone, Serialize, Deserialize)]
1023pub struct OrcaWhirlpoolLiquidityIncreasedEvent {
1024 pub metadata: EventMetadata,
1025 pub whirlpool: Pubkey,
1026 pub position: Pubkey,
1027 pub tick_lower_index: i32,
1028 pub tick_upper_index: i32,
1029 pub liquidity: u128,
1030 pub token_a_amount: u64,
1031 pub token_b_amount: u64,
1032 pub token_a_transfer_fee: u64,
1033 pub token_b_transfer_fee: u64,
1034}
1035
1036#[derive(Debug, Clone, Serialize, Deserialize)]
1038pub struct OrcaWhirlpoolLiquidityDecreasedEvent {
1039 pub metadata: EventMetadata,
1040 pub whirlpool: Pubkey,
1041 pub position: Pubkey,
1042 pub tick_lower_index: i32,
1043 pub tick_upper_index: i32,
1044 pub liquidity: u128,
1045 pub token_a_amount: u64,
1046 pub token_b_amount: u64,
1047 pub token_a_transfer_fee: u64,
1048 pub token_b_transfer_fee: u64,
1049}
1050
1051#[derive(Debug, Clone, Serialize, Deserialize)]
1053pub struct OrcaWhirlpoolPoolInitializedEvent {
1054 pub metadata: EventMetadata,
1055 pub whirlpool: Pubkey,
1056 pub whirlpools_config: Pubkey,
1057 pub token_mint_a: Pubkey,
1058 pub token_mint_b: Pubkey,
1059 pub tick_spacing: u16,
1060 pub token_program_a: Pubkey,
1061 pub token_program_b: Pubkey,
1062 pub decimals_a: u8,
1063 pub decimals_b: u8,
1064 pub initial_sqrt_price: u128,
1065}
1066
1067#[derive(Debug, Clone, Serialize, Deserialize)]
1071pub struct MeteoraPoolsSwapEvent {
1072 pub metadata: EventMetadata,
1073 pub in_amount: u64,
1074 pub out_amount: u64,
1075 pub trade_fee: u64,
1076 pub admin_fee: u64, pub host_fee: u64,
1078}
1079
1080#[derive(Debug, Clone, Serialize, Deserialize)]
1082pub struct MeteoraPoolsAddLiquidityEvent {
1083 pub metadata: EventMetadata,
1084 pub lp_mint_amount: u64,
1085 pub token_a_amount: u64,
1086 pub token_b_amount: u64,
1087}
1088
1089#[derive(Debug, Clone, Serialize, Deserialize)]
1091pub struct MeteoraPoolsRemoveLiquidityEvent {
1092 pub metadata: EventMetadata,
1093 pub lp_unmint_amount: u64,
1094 pub token_a_out_amount: u64,
1095 pub token_b_out_amount: u64,
1096}
1097
1098#[derive(Debug, Clone, Serialize, Deserialize)]
1100pub struct MeteoraPoolsBootstrapLiquidityEvent {
1101 pub metadata: EventMetadata,
1102 pub lp_mint_amount: u64,
1103 pub token_a_amount: u64,
1104 pub token_b_amount: u64,
1105 pub pool: Pubkey,
1106}
1107
1108#[derive(Debug, Clone, Serialize, Deserialize)]
1110pub struct MeteoraPoolsPoolCreatedEvent {
1111 pub metadata: EventMetadata,
1112 pub lp_mint: Pubkey,
1113 pub token_a_mint: Pubkey,
1114 pub token_b_mint: Pubkey,
1115 pub pool_type: u8,
1116 pub pool: Pubkey,
1117}
1118
1119#[derive(Debug, Clone, Serialize, Deserialize)]
1121pub struct MeteoraPoolsSetPoolFeesEvent {
1122 pub metadata: EventMetadata,
1123 pub trade_fee_numerator: u64,
1124 pub trade_fee_denominator: u64,
1125 pub owner_trade_fee_numerator: u64, pub owner_trade_fee_denominator: u64, pub pool: Pubkey,
1128}
1129
1130#[derive(Debug, Clone, Serialize, Deserialize)]
1134pub struct MeteoraDammV2SwapEvent {
1135 pub metadata: EventMetadata,
1136 pub lb_pair: Pubkey,
1138 pub from: Pubkey,
1139 pub start_bin_id: i32,
1140 pub end_bin_id: i32,
1141 pub amount_in: u64,
1142 pub amount_out: u64,
1143 pub swap_for_y: bool,
1144 pub fee: u64,
1145 pub protocol_fee: u64,
1146 pub fee_bps: u128,
1147 pub host_fee: u64,
1148}
1149
1150#[derive(Debug, Clone, Serialize, Deserialize)]
1152pub struct MeteoraDammV2AddLiquidityEvent {
1153 pub metadata: EventMetadata,
1154 pub lb_pair: Pubkey,
1155 pub from: Pubkey,
1156 pub position: Pubkey,
1157 pub amounts: [u64; 2],
1158 pub active_bin_id: i32,
1159}
1160
1161#[derive(Debug, Clone, Serialize, Deserialize)]
1163pub struct MeteoraDammV2RemoveLiquidityEvent {
1164 pub metadata: EventMetadata,
1165 pub lb_pair: Pubkey,
1166 pub from: Pubkey,
1167 pub position: Pubkey,
1168 pub amounts: [u64; 2],
1169 pub active_bin_id: i32,
1170}
1171
1172#[derive(Debug, Clone, Serialize, Deserialize)]
1174pub struct MeteoraDammV2InitializePoolEvent {
1175 pub metadata: EventMetadata,
1176 pub lb_pair: Pubkey,
1177 pub bin_step: u16,
1178 pub token_x: Pubkey,
1179 pub token_y: Pubkey,
1180}
1181
1182#[derive(Debug, Clone, Serialize, Deserialize)]
1184pub struct MeteoraDammV2CreatePositionEvent {
1185 pub metadata: EventMetadata,
1186 pub lb_pair: Pubkey,
1187 pub position: Pubkey,
1188 pub owner: Pubkey,
1189}
1190
1191#[derive(Debug, Clone, Serialize, Deserialize)]
1193pub struct MeteoraDammV2ClosePositionEvent {
1194 pub metadata: EventMetadata,
1195 pub position: Pubkey,
1196 pub owner: Pubkey,
1197}
1198
1199#[derive(Debug, Clone, Serialize, Deserialize)]
1201pub struct MeteoraDammV2ClaimPositionFeeEvent {
1202 pub metadata: EventMetadata,
1203 pub lb_pair: Pubkey,
1204 pub position: Pubkey,
1205 pub owner: Pubkey,
1206 pub fee_x: u64,
1207 pub fee_y: u64,
1208}
1209
1210#[derive(Debug, Clone, Serialize, Deserialize)]
1212pub struct MeteoraDammV2InitializeRewardEvent {
1213 pub metadata: EventMetadata,
1214 pub lb_pair: Pubkey,
1215 pub reward_mint: Pubkey,
1216 pub funder: Pubkey,
1217 pub reward_index: u64,
1218 pub reward_duration: u64,
1219}
1220
1221#[derive(Debug, Clone, Serialize, Deserialize)]
1223pub struct MeteoraDammV2FundRewardEvent {
1224 pub metadata: EventMetadata,
1225 pub lb_pair: Pubkey,
1226 pub funder: Pubkey,
1227 pub reward_index: u64,
1228 pub amount: u64,
1229}
1230
1231#[derive(Debug, Clone, Serialize, Deserialize)]
1233pub struct MeteoraDammV2ClaimRewardEvent {
1234 pub metadata: EventMetadata,
1235 pub lb_pair: Pubkey,
1236 pub position: Pubkey,
1237 pub owner: Pubkey,
1238 pub reward_index: u64,
1239 pub total_reward: u64,
1240}
1241
1242#[derive(Debug, Clone, Serialize, Deserialize)]
1244pub struct MeteoraDlmmSwapEvent {
1245 pub metadata: EventMetadata,
1246 pub pool: Pubkey, pub from: Pubkey,
1248 pub start_bin_id: i32,
1249 pub end_bin_id: i32,
1250 pub amount_in: u64,
1251 pub amount_out: u64,
1252 pub swap_for_y: bool,
1253 pub fee: u64,
1254 pub protocol_fee: u64,
1255 pub fee_bps: u128, pub host_fee: u64,
1257}
1258
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1261pub struct MeteoraDlmmAddLiquidityEvent {
1262 pub metadata: EventMetadata,
1263 pub pool: Pubkey, pub from: Pubkey,
1265 pub position: Pubkey, pub amounts: [u64; 2], pub active_bin_id: i32, }
1269
1270#[derive(Debug, Clone, Serialize, Deserialize)]
1272pub struct MeteoraDlmmRemoveLiquidityEvent {
1273 pub metadata: EventMetadata,
1274 pub pool: Pubkey, pub from: Pubkey,
1276 pub position: Pubkey, pub amounts: [u64; 2], pub active_bin_id: i32, }
1280
1281#[derive(Debug, Clone, Serialize, Deserialize)]
1283pub struct MeteoraDlmmInitializePoolEvent {
1284 pub metadata: EventMetadata,
1285 pub pool: Pubkey,
1286 pub creator: Pubkey,
1287 pub active_bin_id: i32,
1288 pub bin_step: u16,
1289}
1290
1291#[derive(Debug, Clone, Serialize, Deserialize)]
1293pub struct MeteoraDlmmInitializeBinArrayEvent {
1294 pub metadata: EventMetadata,
1295 pub pool: Pubkey,
1296 pub bin_array: Pubkey,
1297 pub index: i64,
1298}
1299
1300#[derive(Debug, Clone, Serialize, Deserialize)]
1302pub struct MeteoraDlmmCreatePositionEvent {
1303 pub metadata: EventMetadata,
1304 pub pool: Pubkey,
1305 pub position: Pubkey,
1306 pub owner: Pubkey,
1307 pub lower_bin_id: i32,
1308 pub width: u32,
1309}
1310
1311#[derive(Debug, Clone, Serialize, Deserialize)]
1313pub struct MeteoraDlmmClosePositionEvent {
1314 pub metadata: EventMetadata,
1315 pub pool: Pubkey,
1316 pub position: Pubkey,
1317 pub owner: Pubkey,
1318}
1319
1320#[derive(Debug, Clone, Serialize, Deserialize)]
1322pub struct MeteoraDlmmClaimFeeEvent {
1323 pub metadata: EventMetadata,
1324 pub pool: Pubkey,
1325 pub position: Pubkey,
1326 pub owner: Pubkey,
1327 pub fee_x: u64,
1328 pub fee_y: u64,
1329}
1330
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1335pub enum DexEvent {
1336 PumpFunCreate(PumpFunCreateTokenEvent),
1338 PumpFunTrade(PumpFunTradeEvent),
1339 PumpFunComplete(PumpFunCompleteTokenEvent),
1340 PumpFunMigrate(PumpFunMigrateEvent),
1341
1342 BonkTrade(BonkTradeEvent),
1344 BonkPoolCreate(BonkPoolCreateEvent),
1345 BonkMigrateAmm(BonkMigrateAmmEvent),
1346
1347 PumpSwapBuy(PumpSwapBuyEvent),
1349 PumpSwapSell(PumpSwapSellEvent),
1350 PumpSwapCreatePool(PumpSwapCreatePoolEvent),
1351 PumpSwapPoolCreated(PumpSwapPoolCreated),
1352 PumpSwapTrade(PumpSwapTrade),
1353 PumpSwapLiquidityAdded(PumpSwapLiquidityAdded),
1354 PumpSwapLiquidityRemoved(PumpSwapLiquidityRemoved),
1355 PumpSwapPoolUpdated(PumpSwapPoolUpdated),
1356 PumpSwapFeesClaimed(PumpSwapFeesClaimed),
1357
1358 RaydiumClmmSwap(RaydiumClmmSwapEvent),
1360 RaydiumClmmCreatePool(RaydiumClmmCreatePoolEvent),
1361 RaydiumClmmOpenPosition(RaydiumClmmOpenPositionEvent),
1362 RaydiumClmmOpenPositionWithTokenExtNft(RaydiumClmmOpenPositionWithTokenExtNftEvent),
1363 RaydiumClmmClosePosition(RaydiumClmmClosePositionEvent),
1364 RaydiumClmmIncreaseLiquidity(RaydiumClmmIncreaseLiquidityEvent),
1365 RaydiumClmmDecreaseLiquidity(RaydiumClmmDecreaseLiquidityEvent),
1366 RaydiumClmmCollectFee(RaydiumClmmCollectFeeEvent),
1367
1368 RaydiumCpmmSwap(RaydiumCpmmSwapEvent),
1370 RaydiumCpmmDeposit(RaydiumCpmmDepositEvent),
1371 RaydiumCpmmWithdraw(RaydiumCpmmWithdrawEvent),
1372 RaydiumCpmmInitialize(RaydiumCpmmInitializeEvent),
1373
1374 RaydiumAmmV4Swap(RaydiumAmmV4SwapEvent),
1376 RaydiumAmmV4Deposit(RaydiumAmmV4DepositEvent),
1377 RaydiumAmmV4Initialize2(RaydiumAmmV4Initialize2Event),
1378 RaydiumAmmV4Withdraw(RaydiumAmmV4WithdrawEvent),
1379 RaydiumAmmV4WithdrawPnl(RaydiumAmmV4WithdrawPnlEvent),
1380
1381 OrcaWhirlpoolSwap(OrcaWhirlpoolSwapEvent),
1383 OrcaWhirlpoolLiquidityIncreased(OrcaWhirlpoolLiquidityIncreasedEvent),
1384 OrcaWhirlpoolLiquidityDecreased(OrcaWhirlpoolLiquidityDecreasedEvent),
1385 OrcaWhirlpoolPoolInitialized(OrcaWhirlpoolPoolInitializedEvent),
1386
1387 MeteoraPoolsSwap(MeteoraPoolsSwapEvent),
1389 MeteoraPoolsAddLiquidity(MeteoraPoolsAddLiquidityEvent),
1390 MeteoraPoolsRemoveLiquidity(MeteoraPoolsRemoveLiquidityEvent),
1391 MeteoraPoolsBootstrapLiquidity(MeteoraPoolsBootstrapLiquidityEvent),
1392 MeteoraPoolsPoolCreated(MeteoraPoolsPoolCreatedEvent),
1393 MeteoraPoolsSetPoolFees(MeteoraPoolsSetPoolFeesEvent),
1394
1395 MeteoraDammV2Swap(MeteoraDammV2SwapEvent),
1397 MeteoraDammV2AddLiquidity(MeteoraDammV2AddLiquidityEvent),
1398 MeteoraDammV2RemoveLiquidity(MeteoraDammV2RemoveLiquidityEvent),
1399 MeteoraDammV2InitializePool(MeteoraDammV2InitializePoolEvent),
1400 MeteoraDammV2CreatePosition(MeteoraDammV2CreatePositionEvent),
1401 MeteoraDammV2ClosePosition(MeteoraDammV2ClosePositionEvent),
1402 MeteoraDammV2ClaimPositionFee(MeteoraDammV2ClaimPositionFeeEvent),
1403 MeteoraDammV2InitializeReward(MeteoraDammV2InitializeRewardEvent),
1404 MeteoraDammV2FundReward(MeteoraDammV2FundRewardEvent),
1405 MeteoraDammV2ClaimReward(MeteoraDammV2ClaimRewardEvent),
1406
1407 MeteoraDlmmSwap(MeteoraDlmmSwapEvent),
1409 MeteoraDlmmAddLiquidity(MeteoraDlmmAddLiquidityEvent),
1410 MeteoraDlmmRemoveLiquidity(MeteoraDlmmRemoveLiquidityEvent),
1411 MeteoraDlmmInitializePool(MeteoraDlmmInitializePoolEvent),
1412 MeteoraDlmmInitializeBinArray(MeteoraDlmmInitializeBinArrayEvent),
1413 MeteoraDlmmCreatePosition(MeteoraDlmmCreatePositionEvent),
1414 MeteoraDlmmClosePosition(MeteoraDlmmClosePositionEvent),
1415 MeteoraDlmmClaimFee(MeteoraDlmmClaimFeeEvent),
1416
1417 TokenAccount(TokenAccountEvent),
1419 NonceAccount(NonceAccountEvent),
1420
1421 BlockMeta(BlockMetaEvent),
1423
1424 TokenInfo(TokenInfoEvent),
1426
1427 Error(String),
1429}