raydium 0.1.1

raydium client
Documentation
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

use borsh::BorshDeserialize;
use borsh::BorshSerialize;
use solana_pubkey::Pubkey;

/// Emitted by when a swap is performed for a pool
#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SwapEvent {
    /// The pool for which token_0 and token_1 were swapped
    #[cfg_attr(
        feature = "serde",
        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
    )]
    pub pool_state: Pubkey,
    /// The address that initiated the swap call, and that received the callback
    #[cfg_attr(
        feature = "serde",
        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
    )]
    pub sender: Pubkey,
    /// The payer token account in zero for one swaps, or the recipient token account
    /// in one for zero swaps
    #[cfg_attr(
        feature = "serde",
        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
    )]
    pub token_account0: Pubkey,
    /// The payer token account in one for zero swaps, or the recipient token account
    /// in zero for one swaps
    #[cfg_attr(
        feature = "serde",
        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
    )]
    pub token_account1: Pubkey,
    /// The real delta amount of the token_0 of the pool or user
    pub amount0: u64,
    /// The transfer fee charged by the withheld_amount of the token_0
    pub transfer_fee0: u64,
    /// The real delta of the token_1 of the pool or user
    pub amount1: u64,
    /// The transfer fee charged by the withheld_amount of the token_1
    pub transfer_fee1: u64,
    /// if true, amount_0 is negtive and amount_1 is positive
    pub zero_for_one: bool,
    /// The sqrt(price) of the pool after the swap, as a Q64.64
    pub sqrt_price_x64: u128,
    /// The liquidity of the pool after the swap
    pub liquidity: u128,
    /// The log base 1.0001 of price of the pool after the swap
    pub tick: i32,
}