use borsh::BorshDeserialize;
use serde::{Deserialize, Serialize};
use solana_sdk::{pubkey::Pubkey, signature::Signature};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EventMetadata {
pub signature: Signature,
pub slot: u64,
pub tx_index: u64, pub block_time_us: i64,
pub grpc_recv_us: i64,
#[serde(default)]
pub recent_blockhash: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BlockMetaEvent {
pub metadata: EventMetadata,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkPoolCreateEvent {
pub metadata: EventMetadata,
pub base_mint_param: BaseMintParam,
pub pool_state: Pubkey,
pub creator: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BaseMintParam {
pub symbol: String,
pub name: String,
pub uri: String,
pub decimals: u8,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkTradeEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool_state: Pubkey, pub user: Pubkey, pub amount_in: u64, pub amount_out: u64, pub is_buy: bool,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub trade_direction: TradeDirection,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub exact_in: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub enum TradeDirection {
#[default]
Buy,
Sell,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkMigrateAmmEvent {
pub metadata: EventMetadata,
pub old_pool: Pubkey,
pub new_pool: Pubkey,
pub user: Pubkey,
pub liquidity_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpFunTradeEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub mint: Pubkey,
pub sol_amount: u64,
pub token_amount: u64,
pub is_buy: bool,
#[borsh(skip)]
pub is_created_buy: bool, pub user: Pubkey,
pub timestamp: i64,
pub virtual_sol_reserves: u64,
pub virtual_token_reserves: u64,
pub real_sol_reserves: u64,
pub real_token_reserves: u64,
pub fee_recipient: Pubkey,
pub fee_basis_points: u64,
pub fee: u64,
pub creator: Pubkey,
pub creator_fee_basis_points: u64,
pub creator_fee: u64,
pub track_volume: bool,
pub total_unclaimed_tokens: u64,
pub total_claimed_tokens: u64,
pub current_sol_volume: u64,
pub last_update_timestamp: i64,
pub ix_name: String,
pub mayhem_mode: bool,
pub cashback_fee_basis_points: u64,
pub cashback: u64,
#[borsh(skip)]
pub is_cashback_coin: bool,
#[borsh(skip)]
pub bonding_curve: Pubkey, #[borsh(skip)]
pub associated_bonding_curve: Pubkey, #[borsh(skip)]
pub token_program: Pubkey, #[borsh(skip)]
pub creator_vault: Pubkey, #[borsh(skip)]
pub account: Option<Pubkey>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpFunMigrateEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub user: Pubkey,
pub mint: Pubkey,
pub mint_amount: u64,
pub sol_amount: u64,
pub pool_migration_fee: u64,
pub bonding_curve: Pubkey,
pub timestamp: i64,
pub pool: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpFunCreateTokenEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub name: String,
pub symbol: String,
pub uri: String,
pub mint: Pubkey,
pub bonding_curve: Pubkey,
pub user: Pubkey,
pub creator: Pubkey,
pub timestamp: i64,
pub virtual_token_reserves: u64,
pub virtual_sol_reserves: u64,
pub real_token_reserves: u64,
pub token_total_supply: u64,
pub token_program: Pubkey,
pub is_mayhem_mode: bool,
pub is_cashback_enabled: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpFunCreateV2TokenEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub name: String,
pub symbol: String,
pub uri: String,
pub mint: Pubkey,
pub bonding_curve: Pubkey,
pub user: Pubkey,
pub creator: Pubkey,
pub timestamp: i64,
pub virtual_token_reserves: u64,
pub virtual_sol_reserves: u64,
pub real_token_reserves: u64,
pub token_total_supply: u64,
pub token_program: Pubkey,
pub is_mayhem_mode: bool,
pub is_cashback_enabled: bool,
#[borsh(skip)]
pub mint_authority: Pubkey,
#[borsh(skip)]
pub associated_bonding_curve: Pubkey,
#[borsh(skip)]
pub global: Pubkey,
#[borsh(skip)]
pub system_program: Pubkey,
#[borsh(skip)]
pub associated_token_program: Pubkey,
#[borsh(skip)]
pub mayhem_program_id: Pubkey,
#[borsh(skip)]
pub global_params: Pubkey,
#[borsh(skip)]
pub sol_vault: Pubkey,
#[borsh(skip)]
pub mayhem_state: Pubkey,
#[borsh(skip)]
pub mayhem_token_vault: Pubkey,
#[borsh(skip)]
pub event_authority: Pubkey,
#[borsh(skip)]
pub program: Pubkey,
#[borsh(skip)]
pub observed_fee_recipient: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapTradeEvent {
pub metadata: EventMetadata,
pub mint: Pubkey,
pub sol_amount: u64,
pub token_amount: u64,
pub is_buy: bool,
pub user: Pubkey,
pub timestamp: i64,
pub virtual_sol_reserves: u64,
pub virtual_token_reserves: u64,
pub real_sol_reserves: u64,
pub real_token_reserves: u64,
pub fee_recipient: Pubkey,
pub fee_basis_points: u64,
pub fee: u64,
pub creator: Pubkey,
pub creator_fee_basis_points: u64,
pub creator_fee: u64,
pub track_volume: bool,
pub total_unclaimed_tokens: u64,
pub total_claimed_tokens: u64,
pub current_sol_volume: u64,
pub last_update_timestamp: i64,
pub ix_name: String, }
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpSwapBuyEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub timestamp: i64,
pub base_amount_out: u64,
pub max_quote_amount_in: u64,
pub user_base_token_reserves: u64,
pub user_quote_token_reserves: u64,
pub pool_base_token_reserves: u64,
pub pool_quote_token_reserves: u64,
pub quote_amount_in: u64,
pub lp_fee_basis_points: u64,
pub lp_fee: u64,
pub protocol_fee_basis_points: u64,
pub protocol_fee: u64,
pub quote_amount_in_with_lp_fee: u64,
pub user_quote_amount_in: u64,
pub pool: Pubkey,
pub user: Pubkey,
pub user_base_token_account: Pubkey,
pub user_quote_token_account: Pubkey,
pub protocol_fee_recipient: Pubkey,
pub protocol_fee_recipient_token_account: Pubkey,
pub coin_creator: Pubkey,
pub coin_creator_fee_basis_points: u64,
pub coin_creator_fee: u64,
pub track_volume: bool,
pub total_unclaimed_tokens: u64,
pub total_claimed_tokens: u64,
pub current_sol_volume: u64,
pub last_update_timestamp: i64,
pub min_base_amount_out: u64,
pub ix_name: String,
pub cashback_fee_basis_points: u64,
pub cashback: u64,
#[borsh(skip)]
pub is_pump_pool: bool,
#[borsh(skip)]
pub base_mint: Pubkey,
#[borsh(skip)]
pub quote_mint: Pubkey,
#[borsh(skip)]
pub pool_base_token_account: Pubkey,
#[borsh(skip)]
pub pool_quote_token_account: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_ata: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_authority: Pubkey,
#[borsh(skip)]
pub base_token_program: Pubkey,
#[borsh(skip)]
pub quote_token_program: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)]
pub struct PumpSwapSellEvent {
#[borsh(skip)]
pub metadata: EventMetadata,
pub timestamp: i64,
pub base_amount_in: u64,
pub min_quote_amount_out: u64,
pub user_base_token_reserves: u64,
pub user_quote_token_reserves: u64,
pub pool_base_token_reserves: u64,
pub pool_quote_token_reserves: u64,
pub quote_amount_out: u64,
pub lp_fee_basis_points: u64,
pub lp_fee: u64,
pub protocol_fee_basis_points: u64,
pub protocol_fee: u64,
pub quote_amount_out_without_lp_fee: u64,
pub user_quote_amount_out: u64,
pub pool: Pubkey,
pub user: Pubkey,
pub user_base_token_account: Pubkey,
pub user_quote_token_account: Pubkey,
pub protocol_fee_recipient: Pubkey,
pub protocol_fee_recipient_token_account: Pubkey,
pub coin_creator: Pubkey,
pub coin_creator_fee_basis_points: u64,
pub coin_creator_fee: u64,
pub cashback_fee_basis_points: u64,
pub cashback: u64,
#[borsh(skip)]
pub is_pump_pool: bool,
#[borsh(skip)]
pub base_mint: Pubkey,
#[borsh(skip)]
pub quote_mint: Pubkey,
#[borsh(skip)]
pub pool_base_token_account: Pubkey,
#[borsh(skip)]
pub pool_quote_token_account: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_ata: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_authority: Pubkey,
#[borsh(skip)]
pub base_token_program: Pubkey,
#[borsh(skip)]
pub quote_token_program: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapCreatePoolEvent {
pub metadata: EventMetadata,
pub timestamp: i64,
pub index: u16,
pub creator: Pubkey,
pub base_mint: Pubkey,
pub quote_mint: Pubkey,
pub base_mint_decimals: u8,
pub quote_mint_decimals: u8,
pub base_amount_in: u64,
pub quote_amount_in: u64,
pub pool_base_amount: u64,
pub pool_quote_amount: u64,
pub minimum_liquidity: u64,
pub initial_liquidity: u64,
pub lp_token_amount_out: u64,
pub pool_bump: u8,
pub pool: Pubkey,
pub lp_mint: Pubkey,
pub user_base_token_account: Pubkey,
pub user_quote_token_account: Pubkey,
pub coin_creator: Pubkey,
pub is_mayhem_mode: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpSwapPoolCreated {
pub metadata: EventMetadata,
pub pool_account: Pubkey,
pub token_a_mint: Pubkey,
pub token_b_mint: Pubkey,
pub token_a_vault: Pubkey,
pub token_b_vault: Pubkey,
pub lp_mint: Pubkey,
pub creator: Pubkey,
pub authority: Pubkey,
pub initial_token_a_amount: u64,
pub initial_token_b_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapLiquidityAdded {
pub metadata: EventMetadata,
pub timestamp: i64,
pub lp_token_amount_out: u64,
pub max_base_amount_in: u64,
pub max_quote_amount_in: u64,
pub user_base_token_reserves: u64,
pub user_quote_token_reserves: u64,
pub pool_base_token_reserves: u64,
pub pool_quote_token_reserves: u64,
pub base_amount_in: u64,
pub quote_amount_in: u64,
pub lp_mint_supply: u64,
pub pool: Pubkey,
pub user: Pubkey,
pub user_base_token_account: Pubkey,
pub user_quote_token_account: Pubkey,
pub user_pool_token_account: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapLiquidityRemoved {
pub metadata: EventMetadata,
pub timestamp: i64,
pub lp_token_amount_in: u64,
pub min_base_amount_out: u64,
pub min_quote_amount_out: u64,
pub user_base_token_reserves: u64,
pub user_quote_token_reserves: u64,
pub pool_base_token_reserves: u64,
pub pool_quote_token_reserves: u64,
pub base_amount_out: u64,
pub quote_amount_out: u64,
pub lp_mint_supply: u64,
pub pool: Pubkey,
pub user: Pubkey,
pub user_base_token_account: Pubkey,
pub user_quote_token_account: Pubkey,
pub user_pool_token_account: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpSwapPoolUpdated {
pub metadata: EventMetadata,
pub pool_account: Pubkey,
pub authority: Pubkey,
pub admin: Pubkey,
pub new_fee_rate: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpSwapFeesClaimed {
pub metadata: EventMetadata,
pub pool_account: Pubkey,
pub authority: Pubkey,
pub admin: Pubkey,
pub admin_token_a_account: Pubkey,
pub admin_token_b_account: Pubkey,
pub pool_fee_vault: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpSwapDepositEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub user: Pubkey,
pub amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpSwapWithdrawEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub user: Pubkey,
pub amount: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmSwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool_id: Pubkey,
pub input_amount: u64,
pub output_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub input_vault_before: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub output_vault_before: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub input_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub output_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub base_input: bool,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmDepositEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey,
pub token0_amount: u64,
pub token1_amount: u64,
pub lp_token_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmInitializeEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub creator: Pubkey,
pub init_amount0: u64,
pub init_amount1: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmWithdrawEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey,
pub lp_token_amount: u64,
pub token0_amount: u64,
pub token1_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmSwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool_state: Pubkey,
pub token_account_0: Pubkey,
pub token_account_1: Pubkey,
pub amount_0: u64,
pub amount_1: u64,
pub zero_for_one: bool,
pub sqrt_price_x64: u128,
pub liquidity: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub sender: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub transfer_fee_0: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub transfer_fee_1: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub tick: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmClosePositionEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub user: Pubkey,
pub position_nft_mint: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmDecreaseLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey,
pub position_nft_mint: Pubkey,
pub amount0_min: u64,
pub amount1_min: u64,
pub liquidity: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmCollectFeeEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool_state: Pubkey,
pub position_nft_mint: Pubkey,
pub amount_0: u64,
pub amount_1: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmCreatePoolEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey,
pub token_0_mint: Pubkey,
pub token_1_mint: Pubkey,
pub tick_spacing: u16,
pub fee_rate: u32,
pub sqrt_price_x64: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub creator: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub open_time: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmIncreaseLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey,
pub position_nft_mint: Pubkey,
pub amount0_max: u64,
pub amount1_max: u64,
pub liquidity: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmOpenPositionWithTokenExtNftEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub user: Pubkey,
pub position_nft_mint: Pubkey,
pub tick_lower_index: i32,
pub tick_upper_index: i32,
pub liquidity: u128,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmOpenPositionEvent {
pub metadata: EventMetadata,
pub pool: Pubkey,
pub user: Pubkey,
pub position_nft_mint: Pubkey,
pub tick_lower_index: i32,
pub tick_upper_index: i32,
pub liquidity: u128,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmDepositEvent {
pub metadata: EventMetadata,
pub amm_id: Pubkey,
pub user: Pubkey,
pub max_coin_amount: u64,
pub max_pc_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmInitializeAltEvent {
pub metadata: EventMetadata,
pub amm_id: Pubkey,
pub creator: Pubkey,
pub nonce: u8,
pub open_time: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmWithdrawEvent {
pub metadata: EventMetadata,
pub amm_id: Pubkey,
pub user: Pubkey,
pub pool_coin_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmWithdrawPnlEvent {
pub metadata: EventMetadata,
pub amm_id: Pubkey,
pub user: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmV4SwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub amm: Pubkey,
pub amount_in: u64,
pub amount_out: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub minimum_amount_out: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub max_amount_in: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_authority: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_open_orders: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_target_orders: Option<Pubkey>,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_coin_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_pc_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_market: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_bids: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_asks: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_event_queue: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_coin_vault_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_pc_vault_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_vault_signer: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_source_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_destination_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_source_owner: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmV4DepositEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub amm: Pubkey,
pub max_coin_amount: u64,
pub max_pc_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub base_side: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_authority: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_open_orders: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_target_orders: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub lp_mint_address: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_coin_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_pc_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_market: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_coin_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_pc_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_lp_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_owner: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_event_queue: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmV4Initialize2Event {
pub metadata: EventMetadata,
pub nonce: u8,
pub open_time: u64,
pub init_pc_amount: u64,
pub init_coin_amount: u64,
pub token_program: Pubkey,
pub spl_associated_token_account: Pubkey,
pub system_program: Pubkey,
pub rent: Pubkey,
pub amm: Pubkey,
pub amm_authority: Pubkey,
pub amm_open_orders: Pubkey,
pub lp_mint: Pubkey,
pub coin_mint: Pubkey,
pub pc_mint: Pubkey,
pub pool_coin_token_account: Pubkey,
pub pool_pc_token_account: Pubkey,
pub pool_withdraw_queue: Pubkey,
pub amm_target_orders: Pubkey,
pub pool_temp_lp: Pubkey,
pub serum_program: Pubkey,
pub serum_market: Pubkey,
pub user_wallet: Pubkey,
pub user_token_coin: Pubkey,
pub user_token_pc: Pubkey,
pub user_lp_token_account: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmV4WithdrawEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub amm: Pubkey,
pub amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_authority: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_open_orders: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub amm_target_orders: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub lp_mint_address: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_coin_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_pc_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_withdraw_queue: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pool_temp_lp_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_market: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_coin_vault_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_pc_vault_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_vault_signer: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_lp_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_coin_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_pc_token_account: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub user_owner: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_event_queue: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_bids: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub serum_asks: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmV4WithdrawPnlEvent {
pub metadata: EventMetadata,
pub token_program: Pubkey,
pub amm: Pubkey,
pub amm_config: Pubkey,
pub amm_authority: Pubkey,
pub amm_open_orders: Pubkey,
pub pool_coin_token_account: Pubkey,
pub pool_pc_token_account: Pubkey,
pub coin_pnl_token_account: Pubkey,
pub pc_pnl_token_account: Pubkey,
pub pnl_owner: Pubkey,
pub amm_target_orders: Pubkey,
pub serum_program: Pubkey,
pub serum_market: Pubkey,
pub serum_event_queue: Pubkey,
pub serum_coin_vault_account: Pubkey,
pub serum_pc_vault_account: Pubkey,
pub serum_vault_signer: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum AmmCreatorFeeOn {
QuoteToken = 0,
BothToken = 1,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VestingSchedule {
pub total_locked_amount: u64,
pub cliff_period: u64,
pub unlock_period: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkPoolStateAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub pool_state: BonkPoolState,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkPoolState {
pub epoch: u64,
pub auth_bump: u8,
pub status: u8,
pub base_decimals: u8,
pub quote_decimals: u8,
pub migrate_type: u8,
pub supply: u64,
pub total_base_sell: u64,
pub virtual_base: u64,
pub virtual_quote: u64,
pub real_base: u64,
pub real_quote: u64,
pub total_quote_fund_raising: u64,
pub quote_protocol_fee: u64,
pub platform_fee: u64,
pub migrate_fee: u64,
pub vesting_schedule: VestingSchedule,
pub global_config: Pubkey,
pub platform_config: Pubkey,
pub base_mint: Pubkey,
pub quote_mint: Pubkey,
pub base_vault: Pubkey,
pub quote_vault: Pubkey,
pub creator: Pubkey,
pub token_program_flag: u8,
pub amm_creator_fee_on: AmmCreatorFeeOn,
pub platform_vesting_share: u64,
#[serde(with = "serde_big_array::BigArray")]
pub padding: [u8; 54],
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkGlobalConfigAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub global_config: BonkGlobalConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkGlobalConfig {
pub protocol_fee_rate: u64,
pub trade_fee_rate: u64,
pub migration_fee_rate: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkPlatformConfigAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub platform_config: BonkPlatformConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BondingCurveParam {
pub migrate_type: u8,
pub migrate_cpmm_fee_on: u8,
pub supply: u64,
pub total_base_sell: u64,
pub total_quote_fund_raising: u64,
pub total_locked_amount: u64,
pub cliff_period: u64,
pub unlock_period: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlatformCurveParam {
pub epoch: u64,
pub index: u8,
pub global_config: Pubkey,
pub bonding_curve_param: BondingCurveParam,
#[serde(with = "serde_big_array::BigArray")]
pub padding: [u64; 50],
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BonkPlatformConfig {
pub epoch: u64,
pub platform_fee_wallet: Pubkey,
pub platform_nft_wallet: Pubkey,
pub platform_scale: u64,
pub creator_scale: u64,
pub burn_scale: u64,
pub fee_rate: u64,
#[serde(with = "serde_big_array::BigArray")]
pub name: [u8; 64],
#[serde(with = "serde_big_array::BigArray")]
pub web: [u8; 256],
#[serde(with = "serde_big_array::BigArray")]
pub img: [u8; 256],
pub cpswap_config: Pubkey,
pub creator_fee_rate: u64,
pub transfer_fee_extension_auth: Pubkey,
pub platform_vesting_wallet: Pubkey,
pub platform_vesting_scale: u64,
pub platform_cp_creator: Pubkey,
#[serde(with = "serde_big_array::BigArray")]
pub padding: [u8; 108],
pub curve_params: Vec<PlatformCurveParam>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapGlobalConfigAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub executable: bool,
pub lamports: u64,
pub owner: Pubkey,
pub rent_epoch: u64,
pub global_config: PumpSwapGlobalConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapGlobalConfig {
pub admin: Pubkey,
pub lp_fee_basis_points: u64,
pub protocol_fee_basis_points: u64,
pub disable_flags: u8,
pub protocol_fee_recipients: [Pubkey; 8],
pub coin_creator_fee_basis_points: u64,
pub admin_set_coin_creator_authority: Pubkey,
pub whitelist_pda: Pubkey,
pub reserved_fee_recipient: Pubkey,
pub mayhem_mode_enabled: bool,
pub reserved_fee_recipients: [Pubkey; 7],
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapPoolAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub executable: bool,
pub lamports: u64,
pub owner: Pubkey,
pub rent_epoch: u64,
pub pool: PumpSwapPool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpSwapPool {
pub pool_bump: u8,
pub index: u16,
pub creator: Pubkey,
pub base_mint: Pubkey,
pub quote_mint: Pubkey,
pub lp_mint: Pubkey,
pub pool_base_token_account: Pubkey,
pub pool_quote_token_account: Pubkey,
pub lp_supply: u64,
pub coin_creator: Pubkey,
pub is_mayhem_mode: bool,
pub is_cashback_coin: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpFunBondingCurveAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub bonding_curve: PumpFunBondingCurve,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PumpFunBondingCurve {
pub virtual_token_reserves: u64,
pub virtual_sol_reserves: u64,
pub real_token_reserves: u64,
pub real_sol_reserves: u64,
pub token_total_supply: u64,
pub complete: bool,
#[serde(default)]
pub is_cashback_coin: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpFunGlobalAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub global: PumpFunGlobal,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PumpFunGlobal {
pub initialized: bool,
pub authority: Pubkey,
pub fee_recipient: Pubkey,
pub initial_virtual_token_reserves: u64,
pub initial_virtual_sol_reserves: u64,
pub initial_real_token_reserves: u64,
pub token_total_supply: u64,
pub fee_basis_points: u64,
pub withdraw_authority: Pubkey,
pub enable_migrate: bool,
pub pool_migration_fee: u64,
pub creator_fee_basis_points: u64,
pub fee_recipients: [Pubkey; 8],
pub set_creator_authority: Pubkey,
pub admin_set_creator_authority: Pubkey,
pub create_v2_enabled: bool,
pub whitelist_pda: Pubkey,
pub reserved_fee_recipient: Pubkey,
pub mayhem_mode_enabled: bool,
pub reserved_fee_recipients: [Pubkey; 7],
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmAmmInfoAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub amm_info: RaydiumAmmInfo,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumAmmInfo {
pub status: u64,
pub nonce: u64,
pub order_num: u64,
pub depth: u64,
pub coin_decimals: u64,
pub pc_decimals: u64,
pub state: u64,
pub reset_flag: u64,
pub min_size: u64,
pub vol_max_cut_ratio: u64,
pub amount_wave_ratio: u64,
pub coin_lot_size: u64,
pub pc_lot_size: u64,
pub min_price_multiplier: u64,
pub max_price_multiplier: u64,
pub sys_decimal_value: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmAmmConfigAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub amm_config: RaydiumClmmAmmConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmAmmConfig {
pub bump: u8,
pub index: u16,
pub owner: Pubkey,
pub protocol_fee_rate: u32,
pub trade_fee_rate: u32,
pub tick_spacing: u16,
pub fund_fee_rate: u32,
pub fund_owner: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmPoolStateAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub pool_state: RaydiumClmmPoolState,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmPoolState {
pub bump: [u8; 1],
pub amm_config: Pubkey,
pub owner: Pubkey,
pub token_mint0: Pubkey,
pub token_mint1: Pubkey,
pub token_vault0: Pubkey,
pub token_vault1: Pubkey,
pub observation_key: Pubkey,
pub mint_decimals0: u8,
pub mint_decimals1: u8,
pub tick_spacing: u16,
pub liquidity: u128,
pub sqrt_price_x64: u128,
pub tick_current: i32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmTickArrayStateAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub tick_array_state: RaydiumClmmTickArrayState,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumClmmTickArrayState {
pub discriminator: u64,
pub pool_id: Pubkey,
pub start_tick_index: i32,
pub ticks: Vec<Tick>,
pub initialized_tick_count: u8,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Tick {
pub tick: i32,
pub liquidity_net: i128,
pub liquidity_gross: u128,
pub fee_growth_outside_0_x64: u128,
pub fee_growth_outside_1_x64: u128,
pub reward_growths_outside_x64: [u128; 3],
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmAmmConfigAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub amm_config: RaydiumCpmmAmmConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmAmmConfig {
pub bump: u8,
pub disable_create_pool: bool,
pub index: u16,
pub trade_fee_rate: u64,
pub protocol_fee_rate: u64,
pub fund_fee_rate: u64,
pub create_pool_fee: u64,
pub protocol_owner: Pubkey,
pub fund_owner: Pubkey,
pub creator_fee_rate: u64,
pub padding: [u64; 15],
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmPoolStateAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub pool_state: RaydiumCpmmPoolState,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RaydiumCpmmPoolState {
pub amm_config: Pubkey,
pub pool_creator: Pubkey,
pub token_0_vault: Pubkey,
pub token_1_vault: Pubkey,
pub lp_mint: Pubkey,
pub token_0_mint: Pubkey,
pub token_1_mint: Pubkey,
pub token_0_program: Pubkey,
pub token_1_program: Pubkey,
pub observation_key: Pubkey,
pub auth_bump: u8,
pub status: u8,
pub lp_mint_decimals: u8,
pub mint_0_decimals: u8,
pub mint_1_decimals: u8,
pub lp_supply: u64,
pub protocol_fees_token_0: u64,
pub protocol_fees_token_1: u64,
pub fund_fees_token_0: u64,
pub fund_fees_token_1: u64,
pub open_time: u64,
pub recent_epoch: u64,
pub creator_fee_on: u8,
pub enable_creator_fee: bool,
pub padding1: [u8; 6],
pub creator_fees_token_0: u64,
pub creator_fees_token_1: u64,
pub padding: [u64; 28],
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TokenInfoEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub executable: bool,
pub lamports: u64,
pub owner: Pubkey,
pub rent_epoch: u64,
pub supply: u64,
pub decimals: u8,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TokenAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub executable: bool,
pub lamports: u64,
pub owner: Pubkey,
pub rent_epoch: u64,
pub amount: Option<u64>,
pub token_owner: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct NonceAccountEvent {
pub metadata: EventMetadata,
pub pubkey: Pubkey,
pub executable: bool,
pub lamports: u64,
pub owner: Pubkey,
pub rent_epoch: u64,
pub nonce: String,
pub authority: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
pub struct OrcaWhirlpoolSwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub whirlpool: Pubkey, pub input_amount: u64, pub output_amount: u64, pub a_to_b: bool,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub pre_sqrt_price: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub post_sqrt_price: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub input_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub output_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub lp_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub protocol_fee: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrcaWhirlpoolLiquidityIncreasedEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub whirlpool: Pubkey, pub liquidity: u128, pub token_a_amount: u64, pub token_b_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub position: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub tick_lower_index: i32,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub tick_upper_index: i32,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_transfer_fee: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrcaWhirlpoolLiquidityDecreasedEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub whirlpool: Pubkey, pub liquidity: u128, pub token_a_amount: u64, pub token_b_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub position: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub tick_lower_index: i32,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub tick_upper_index: i32,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_transfer_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_transfer_fee: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrcaWhirlpoolPoolInitializedEvent {
pub metadata: EventMetadata,
pub whirlpool: Pubkey,
pub whirlpools_config: Pubkey,
pub token_mint_a: Pubkey,
pub token_mint_b: Pubkey,
pub tick_spacing: u16,
pub token_program_a: Pubkey,
pub token_program_b: Pubkey,
pub decimals_a: u8,
pub decimals_b: u8,
pub initial_sqrt_price: u128,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsSwapEvent {
pub metadata: EventMetadata,
pub in_amount: u64,
pub out_amount: u64,
pub trade_fee: u64,
pub admin_fee: u64, pub host_fee: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsAddLiquidityEvent {
pub metadata: EventMetadata,
pub lp_mint_amount: u64,
pub token_a_amount: u64,
pub token_b_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsRemoveLiquidityEvent {
pub metadata: EventMetadata,
pub lp_unmint_amount: u64,
pub token_a_out_amount: u64,
pub token_b_out_amount: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsBootstrapLiquidityEvent {
pub metadata: EventMetadata,
pub lp_mint_amount: u64,
pub token_a_amount: u64,
pub token_b_amount: u64,
pub pool: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsPoolCreatedEvent {
pub metadata: EventMetadata,
pub lp_mint: Pubkey,
pub token_a_mint: Pubkey,
pub token_b_mint: Pubkey,
pub pool_type: u8,
pub pool: Pubkey,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraPoolsSetPoolFeesEvent {
pub metadata: EventMetadata,
pub trade_fee_numerator: u64,
pub trade_fee_denominator: u64,
pub owner_trade_fee_numerator: u64, pub owner_trade_fee_denominator: u64, pub pool: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct MeteoraDammV2SwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub amount_in: u64, pub output_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub trade_direction: u8,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub has_referral: bool,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub minimum_amount_out: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub next_sqrt_price: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub lp_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub protocol_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub partner_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub referral_fee: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub actual_amount_in: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub current_timestamp: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_vault: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_vault: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_mint: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_mint: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_program: Pubkey,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_program: Pubkey,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDammV2AddLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub position: Pubkey, pub owner: Pubkey, pub token_a_amount: u64, pub token_b_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub liquidity_delta: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_amount_threshold: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_amount_threshold: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub total_amount_a: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub total_amount_b: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDammV2RemoveLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub position: Pubkey, pub owner: Pubkey, pub token_a_amount: u64, pub token_b_amount: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub liquidity_delta: u128,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_a_amount_threshold: u64,
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub token_b_amount_threshold: u64,
}
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDammV2CreatePositionEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub owner: Pubkey, pub position: Pubkey, pub position_nft_mint: Pubkey, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDammV2ClosePositionEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub owner: Pubkey, pub position: Pubkey, pub position_nft_mint: Pubkey, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmSwapEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub from: Pubkey, pub start_bin_id: i32, pub end_bin_id: i32, pub amount_in: u64, pub amount_out: u64, pub swap_for_y: bool, pub fee: u64, pub protocol_fee: u64, pub fee_bps: u128, pub host_fee: u64, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmAddLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub from: Pubkey, pub position: Pubkey, pub amounts: [u64; 2], pub active_bin_id: i32, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmRemoveLiquidityEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub from: Pubkey, pub position: Pubkey, pub amounts: [u64; 2], pub active_bin_id: i32, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmInitializePoolEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub creator: Pubkey, pub active_bin_id: i32, pub bin_step: u16, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmInitializeBinArrayEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub bin_array: Pubkey, pub index: i64, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmCreatePositionEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub position: Pubkey, pub owner: Pubkey, pub lower_bin_id: i32, pub width: u32, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmClosePositionEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub position: Pubkey, pub owner: Pubkey, }
#[cfg_attr(feature = "parse-borsh", derive(BorshDeserialize))]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MeteoraDlmmClaimFeeEvent {
#[cfg_attr(feature = "parse-borsh", borsh(skip))]
pub metadata: EventMetadata,
pub pool: Pubkey, pub position: Pubkey, pub owner: Pubkey, pub fee_x: u64, pub fee_y: u64, }
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum DexEvent {
PumpFunCreate(PumpFunCreateTokenEvent), PumpFunCreateV2(PumpFunCreateV2TokenEvent), PumpFunTrade(PumpFunTradeEvent), PumpFunBuy(PumpFunTradeEvent), PumpFunSell(PumpFunTradeEvent), PumpFunBuyExactSolIn(PumpFunTradeEvent), PumpFunMigrate(PumpFunMigrateEvent),
PumpSwapTrade(PumpSwapTradeEvent), PumpSwapBuy(PumpSwapBuyEvent), PumpSwapSell(PumpSwapSellEvent), PumpSwapCreatePool(PumpSwapCreatePoolEvent), PumpSwapLiquidityAdded(PumpSwapLiquidityAdded), PumpSwapLiquidityRemoved(PumpSwapLiquidityRemoved),
MeteoraDammV2Swap(MeteoraDammV2SwapEvent), MeteoraDammV2CreatePosition(MeteoraDammV2CreatePositionEvent), MeteoraDammV2ClosePosition(MeteoraDammV2ClosePositionEvent), MeteoraDammV2AddLiquidity(MeteoraDammV2AddLiquidityEvent), MeteoraDammV2RemoveLiquidity(MeteoraDammV2RemoveLiquidityEvent),
BonkTrade(BonkTradeEvent),
BonkPoolCreate(BonkPoolCreateEvent),
BonkMigrateAmm(BonkMigrateAmmEvent),
RaydiumClmmSwap(RaydiumClmmSwapEvent),
RaydiumClmmCreatePool(RaydiumClmmCreatePoolEvent),
RaydiumClmmOpenPosition(RaydiumClmmOpenPositionEvent),
RaydiumClmmOpenPositionWithTokenExtNft(RaydiumClmmOpenPositionWithTokenExtNftEvent),
RaydiumClmmClosePosition(RaydiumClmmClosePositionEvent),
RaydiumClmmIncreaseLiquidity(RaydiumClmmIncreaseLiquidityEvent),
RaydiumClmmDecreaseLiquidity(RaydiumClmmDecreaseLiquidityEvent),
RaydiumClmmCollectFee(RaydiumClmmCollectFeeEvent),
RaydiumCpmmSwap(RaydiumCpmmSwapEvent),
RaydiumCpmmDeposit(RaydiumCpmmDepositEvent),
RaydiumCpmmWithdraw(RaydiumCpmmWithdrawEvent),
RaydiumCpmmInitialize(RaydiumCpmmInitializeEvent),
RaydiumAmmV4Swap(RaydiumAmmV4SwapEvent),
RaydiumAmmV4Deposit(RaydiumAmmV4DepositEvent),
RaydiumAmmV4Initialize2(RaydiumAmmV4Initialize2Event),
RaydiumAmmV4Withdraw(RaydiumAmmV4WithdrawEvent),
RaydiumAmmV4WithdrawPnl(RaydiumAmmV4WithdrawPnlEvent),
OrcaWhirlpoolSwap(OrcaWhirlpoolSwapEvent),
OrcaWhirlpoolLiquidityIncreased(OrcaWhirlpoolLiquidityIncreasedEvent),
OrcaWhirlpoolLiquidityDecreased(OrcaWhirlpoolLiquidityDecreasedEvent),
OrcaWhirlpoolPoolInitialized(OrcaWhirlpoolPoolInitializedEvent),
MeteoraPoolsSwap(MeteoraPoolsSwapEvent),
MeteoraPoolsAddLiquidity(MeteoraPoolsAddLiquidityEvent),
MeteoraPoolsRemoveLiquidity(MeteoraPoolsRemoveLiquidityEvent),
MeteoraPoolsBootstrapLiquidity(MeteoraPoolsBootstrapLiquidityEvent),
MeteoraPoolsPoolCreated(MeteoraPoolsPoolCreatedEvent),
MeteoraPoolsSetPoolFees(MeteoraPoolsSetPoolFeesEvent),
MeteoraDlmmSwap(MeteoraDlmmSwapEvent),
MeteoraDlmmAddLiquidity(MeteoraDlmmAddLiquidityEvent),
MeteoraDlmmRemoveLiquidity(MeteoraDlmmRemoveLiquidityEvent),
MeteoraDlmmInitializePool(MeteoraDlmmInitializePoolEvent),
MeteoraDlmmInitializeBinArray(MeteoraDlmmInitializeBinArrayEvent),
MeteoraDlmmCreatePosition(MeteoraDlmmCreatePositionEvent),
MeteoraDlmmClosePosition(MeteoraDlmmClosePositionEvent),
MeteoraDlmmClaimFee(MeteoraDlmmClaimFeeEvent),
TokenInfo(TokenInfoEvent), TokenAccount(TokenAccountEvent), NonceAccount(NonceAccountEvent), PumpSwapGlobalConfigAccount(PumpSwapGlobalConfigAccountEvent), PumpSwapPoolAccount(PumpSwapPoolAccountEvent),
BlockMeta(BlockMetaEvent),
Error(String),
}
use once_cell::sync::Lazy;
static DEFAULT_METADATA: Lazy<EventMetadata> = Lazy::new(|| EventMetadata {
signature: Signature::from([0u8; 64]),
slot: 0,
tx_index: 0,
block_time_us: 0,
grpc_recv_us: 0,
recent_blockhash: None,
});
impl DexEvent {
pub fn metadata(&self) -> &EventMetadata {
match self {
DexEvent::PumpFunCreate(e) => &e.metadata,
DexEvent::PumpFunCreateV2(e) => &e.metadata,
DexEvent::PumpFunTrade(e) => &e.metadata,
DexEvent::PumpFunBuy(e) => &e.metadata,
DexEvent::PumpFunSell(e) => &e.metadata,
DexEvent::PumpFunBuyExactSolIn(e) => &e.metadata,
DexEvent::PumpFunMigrate(e) => &e.metadata,
DexEvent::PumpSwapTrade(e) => &e.metadata,
DexEvent::PumpSwapBuy(e) => &e.metadata,
DexEvent::PumpSwapSell(e) => &e.metadata,
DexEvent::PumpSwapCreatePool(e) => &e.metadata,
DexEvent::PumpSwapLiquidityAdded(e) => &e.metadata,
DexEvent::PumpSwapLiquidityRemoved(e) => &e.metadata,
DexEvent::MeteoraDammV2Swap(e) => &e.metadata,
DexEvent::MeteoraDammV2CreatePosition(e) => &e.metadata,
DexEvent::MeteoraDammV2ClosePosition(e) => &e.metadata,
DexEvent::MeteoraDammV2AddLiquidity(e) => &e.metadata,
DexEvent::MeteoraDammV2RemoveLiquidity(e) => &e.metadata,
DexEvent::BonkTrade(e) => &e.metadata,
DexEvent::BonkPoolCreate(e) => &e.metadata,
DexEvent::BonkMigrateAmm(e) => &e.metadata,
DexEvent::RaydiumClmmSwap(e) => &e.metadata,
DexEvent::RaydiumClmmCreatePool(e) => &e.metadata,
DexEvent::RaydiumClmmOpenPosition(e) => &e.metadata,
DexEvent::RaydiumClmmOpenPositionWithTokenExtNft(e) => &e.metadata,
DexEvent::RaydiumClmmClosePosition(e) => &e.metadata,
DexEvent::RaydiumClmmIncreaseLiquidity(e) => &e.metadata,
DexEvent::RaydiumClmmDecreaseLiquidity(e) => &e.metadata,
DexEvent::RaydiumClmmCollectFee(e) => &e.metadata,
DexEvent::RaydiumCpmmSwap(e) => &e.metadata,
DexEvent::RaydiumCpmmDeposit(e) => &e.metadata,
DexEvent::RaydiumCpmmWithdraw(e) => &e.metadata,
DexEvent::RaydiumCpmmInitialize(e) => &e.metadata,
DexEvent::RaydiumAmmV4Swap(e) => &e.metadata,
DexEvent::RaydiumAmmV4Deposit(e) => &e.metadata,
DexEvent::RaydiumAmmV4Initialize2(e) => &e.metadata,
DexEvent::RaydiumAmmV4Withdraw(e) => &e.metadata,
DexEvent::RaydiumAmmV4WithdrawPnl(e) => &e.metadata,
DexEvent::OrcaWhirlpoolSwap(e) => &e.metadata,
DexEvent::OrcaWhirlpoolLiquidityIncreased(e) => &e.metadata,
DexEvent::OrcaWhirlpoolLiquidityDecreased(e) => &e.metadata,
DexEvent::OrcaWhirlpoolPoolInitialized(e) => &e.metadata,
DexEvent::MeteoraPoolsSwap(e) => &e.metadata,
DexEvent::MeteoraPoolsAddLiquidity(e) => &e.metadata,
DexEvent::MeteoraPoolsRemoveLiquidity(e) => &e.metadata,
DexEvent::MeteoraPoolsBootstrapLiquidity(e) => &e.metadata,
DexEvent::MeteoraPoolsPoolCreated(e) => &e.metadata,
DexEvent::MeteoraPoolsSetPoolFees(e) => &e.metadata,
DexEvent::MeteoraDlmmSwap(e) => &e.metadata,
DexEvent::MeteoraDlmmAddLiquidity(e) => &e.metadata,
DexEvent::MeteoraDlmmRemoveLiquidity(e) => &e.metadata,
DexEvent::MeteoraDlmmInitializePool(e) => &e.metadata,
DexEvent::MeteoraDlmmInitializeBinArray(e) => &e.metadata,
DexEvent::MeteoraDlmmCreatePosition(e) => &e.metadata,
DexEvent::MeteoraDlmmClosePosition(e) => &e.metadata,
DexEvent::MeteoraDlmmClaimFee(e) => &e.metadata,
DexEvent::TokenInfo(e) => &e.metadata,
DexEvent::TokenAccount(e) => &e.metadata,
DexEvent::NonceAccount(e) => &e.metadata,
DexEvent::PumpSwapGlobalConfigAccount(e) => &e.metadata,
DexEvent::PumpSwapPoolAccount(e) => &e.metadata,
DexEvent::BlockMeta(e) => &e.metadata,
DexEvent::Error(_) => &DEFAULT_METADATA,
}
}
pub fn metadata_mut(&mut self) -> Option<&mut EventMetadata> {
match self {
DexEvent::PumpFunCreate(e) => Some(&mut e.metadata),
DexEvent::PumpFunCreateV2(e) => Some(&mut e.metadata),
DexEvent::PumpFunTrade(e) => Some(&mut e.metadata),
DexEvent::PumpFunBuy(e) => Some(&mut e.metadata),
DexEvent::PumpFunSell(e) => Some(&mut e.metadata),
DexEvent::PumpFunBuyExactSolIn(e) => Some(&mut e.metadata),
DexEvent::PumpFunMigrate(e) => Some(&mut e.metadata),
DexEvent::PumpSwapTrade(e) => Some(&mut e.metadata),
DexEvent::PumpSwapBuy(e) => Some(&mut e.metadata),
DexEvent::PumpSwapSell(e) => Some(&mut e.metadata),
DexEvent::PumpSwapCreatePool(e) => Some(&mut e.metadata),
DexEvent::PumpSwapLiquidityAdded(e) => Some(&mut e.metadata),
DexEvent::PumpSwapLiquidityRemoved(e) => Some(&mut e.metadata),
DexEvent::MeteoraDammV2Swap(e) => Some(&mut e.metadata),
DexEvent::MeteoraDammV2CreatePosition(e) => Some(&mut e.metadata),
DexEvent::MeteoraDammV2ClosePosition(e) => Some(&mut e.metadata),
DexEvent::MeteoraDammV2AddLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraDammV2RemoveLiquidity(e) => Some(&mut e.metadata),
DexEvent::BonkTrade(e) => Some(&mut e.metadata),
DexEvent::BonkPoolCreate(e) => Some(&mut e.metadata),
DexEvent::BonkMigrateAmm(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmSwap(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmCreatePool(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmOpenPosition(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmOpenPositionWithTokenExtNft(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmClosePosition(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmIncreaseLiquidity(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmDecreaseLiquidity(e) => Some(&mut e.metadata),
DexEvent::RaydiumClmmCollectFee(e) => Some(&mut e.metadata),
DexEvent::RaydiumCpmmSwap(e) => Some(&mut e.metadata),
DexEvent::RaydiumCpmmDeposit(e) => Some(&mut e.metadata),
DexEvent::RaydiumCpmmWithdraw(e) => Some(&mut e.metadata),
DexEvent::RaydiumCpmmInitialize(e) => Some(&mut e.metadata),
DexEvent::RaydiumAmmV4Swap(e) => Some(&mut e.metadata),
DexEvent::RaydiumAmmV4Deposit(e) => Some(&mut e.metadata),
DexEvent::RaydiumAmmV4Initialize2(e) => Some(&mut e.metadata),
DexEvent::RaydiumAmmV4Withdraw(e) => Some(&mut e.metadata),
DexEvent::RaydiumAmmV4WithdrawPnl(e) => Some(&mut e.metadata),
DexEvent::OrcaWhirlpoolSwap(e) => Some(&mut e.metadata),
DexEvent::OrcaWhirlpoolLiquidityIncreased(e) => Some(&mut e.metadata),
DexEvent::OrcaWhirlpoolLiquidityDecreased(e) => Some(&mut e.metadata),
DexEvent::OrcaWhirlpoolPoolInitialized(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsSwap(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsAddLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsRemoveLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsBootstrapLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsPoolCreated(e) => Some(&mut e.metadata),
DexEvent::MeteoraPoolsSetPoolFees(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmSwap(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmAddLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmRemoveLiquidity(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmInitializePool(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmInitializeBinArray(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmCreatePosition(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmClosePosition(e) => Some(&mut e.metadata),
DexEvent::MeteoraDlmmClaimFee(e) => Some(&mut e.metadata),
DexEvent::TokenInfo(e) => Some(&mut e.metadata),
DexEvent::TokenAccount(e) => Some(&mut e.metadata),
DexEvent::NonceAccount(e) => Some(&mut e.metadata),
DexEvent::PumpSwapGlobalConfigAccount(e) => Some(&mut e.metadata),
DexEvent::PumpSwapPoolAccount(e) => Some(&mut e.metadata),
DexEvent::BlockMeta(e) => Some(&mut e.metadata),
DexEvent::Error(_) => None,
}
}
}