pub struct SwapEvent {
pub pool_state: Pubkey,
pub sender: Pubkey,
pub token_account_0: Pubkey,
pub token_account_1: Pubkey,
pub amount_0: i64,
pub amount_1: i64,
pub sqrt_price_x32: u64,
pub liquidity: u64,
pub tick: i32,
}Expand description
Emitted by when a swap is performed for a pool
Fields
pool_state: PubkeyThe pool for which token_0 and token_1 were swapped
sender: PubkeyThe address that initiated the swap call, and that received the callback
token_account_0: PubkeyThe payer token account in zero for one swaps, or the recipient token account in one for zero swaps
token_account_1: PubkeyThe payer token account in one for zero swaps, or the recipient token account in zero for one swaps
amount_0: i64The delta of the token_0 balance of the pool
amount_1: i64The delta of the token_1 balance of the pool
sqrt_price_x32: u64The sqrt(price) of the pool after the swap, as a Q32.32
liquidity: u64The liquidity of the pool after the swap
tick: i32The log base 1.0001 of price of the pool after the swap
Trait Implementations
sourceimpl BorshDeserialize for SwapEvent where
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
i32: BorshDeserialize,
impl BorshDeserialize for SwapEvent where
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
i32: BorshDeserialize,
sourceimpl BorshSerialize for SwapEvent where
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
i32: BorshSerialize,
impl BorshSerialize for SwapEvent where
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
i32: BorshSerialize,
sourceimpl Discriminator for SwapEvent
impl Discriminator for SwapEvent
fn discriminator() -> [u8; 8]
Auto Trait Implementations
impl RefUnwindSafe for SwapEvent
impl Send for SwapEvent
impl Sync for SwapEvent
impl Unpin for SwapEvent
impl UnwindSafe for SwapEvent
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more