clmm-common 0.1.39

Blockchain, Clmm for Solana
Documentation
use borsh::BorshDeserialize;
use solana_sdk::pubkey::Pubkey;
use tabled::Tabled;

use crate::program::SWAP_PROGRAM_ID;

#[derive(BorshDeserialize, Tabled)]
pub struct ClmmConfig {
    /// The authority of token accounts for receive protocol fee.
    pub protocol_fee_authority: Pubkey,

    /// The authority for claim protocol fee
    pub protocol_fee_claim_authority: Pubkey,

    /// The protocol fee rate
    pub protocol_fee_rate: u16,

    /// `pending_authority` is used when transfer authority, store the new authority to accept in next step and as the new authority.
    pub pending_authority: Pubkey,

    pub create_pool_authority: Pubkey,
}

impl ClmmConfig {
    pub fn find_address() -> Pubkey {
        let (address, _) = Pubkey::find_program_address(&[b"clmmconfig"], &SWAP_PROGRAM_ID);
        address
    }
}