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: Pubkey

The pool for which token_0 and token_1 were swapped

sender: Pubkey

The address that initiated the swap call, and that received the callback

token_account_0: Pubkey

The payer token account in zero for one swaps, or the recipient token account in one for zero swaps

token_account_1: Pubkey

The payer token account in one for zero swaps, or the recipient token account in zero for one swaps

amount_0: i64

The delta of the token_0 balance of the pool

amount_1: i64

The delta of the token_1 balance of the pool

sqrt_price_x32: u64

The sqrt(price) of the pool after the swap, as a Q32.32

liquidity: u64

The liquidity of the pool after the swap

tick: i32

The log base 1.0001 of price of the pool after the swap

Trait Implementations

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more

Deserialize this instance from a slice of bytes.

Serialize this instance into a vector of bytes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.