mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-19 11:58:06 +00:00
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
use crate::impl_unified_event;
|
|||
|
|
use crate::streaming::event_parser::common::EventMetadata;
|
||
|
|
use borsh::BorshDeserialize;
|
||
|
|
use serde::{Deserialize, Serialize};
|
||
|
|
use solana_sdk::pubkey::Pubkey;
|
||
|
|
|
||
|
|
/// 交易
|
||
|
|
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, BorshDeserialize)]
|
||
|
|
pub struct RaydiumCpmmSwapEvent {
|
||
|
|
pub metadata: EventMetadata,
|
||
|
|
pub amount_in: u64,
|
||
|
|
pub minimum_amount_out: u64,
|
||
|
|
pub max_amount_in: u64,
|
||
|
|
pub amount_out: u64,
|
||
|
|
pub payer: Pubkey,
|
||
|
|
pub authority: Pubkey,
|
||
|
|
pub amm_config: Pubkey,
|
||
|
|
pub pool_state: Pubkey,
|
||
|
|
pub input_token_account: Pubkey,
|
||
|
|
pub output_token_account: Pubkey,
|
||
|
|
pub input_vault: Pubkey,
|
||
|
|
pub output_vault: Pubkey,
|
||
|
|
pub input_token_mint: Pubkey,
|
||
|
|
pub output_token_mint: Pubkey,
|
||
|
|
pub observation_state: Pubkey,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl_unified_event!(RaydiumCpmmSwapEvent,);
|
||
|
|
|
||
|
|
/// 事件鉴别器常量
|
||
|
|
pub mod discriminators {
|
||
|
|
// 指令鉴别器
|
||
|
|
pub const SWAP_BASE_IN: &[u8] = &[143, 190, 90, 218, 196, 30, 51, 222];
|
||
|
|
pub const SWAP_BASE_OUT: &[u8] = &[55, 217, 98, 86, 163, 74, 180, 173];
|
||
|
|
}
|