//! 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;

pub const GRADUATE_WHIRLPOOL_DISCRIMINATOR: u8 = 32;

/// Accounts.
#[derive(Debug)]
pub struct GraduateWhirlpool {
    /// The signer of the transaction
    pub signer: solana_pubkey::Pubkey,
    /// The lp authority of the token
    pub lp_authority: solana_pubkey::Pubkey,
    /// The bonding curve account
    pub bonding_curve: solana_pubkey::Pubkey,
    /// The quote token mint account
    pub quote_mint: solana_pubkey::Pubkey,
    /// The quote token vault
    pub quote_vault: solana_pubkey::Pubkey,
    /// The quote token ata account
    pub signer_quote_ata: solana_pubkey::Pubkey,
    /// The lp authority quote token ata account
    pub lp_authority_quote_ata: solana_pubkey::Pubkey,
    /// The whirlpool quote vault account
    pub whirlpool_quote_vault: solana_pubkey::Pubkey,
    /// The base token mint account
    pub base_mint: solana_pubkey::Pubkey,
    /// The config base vault account
    pub base_vault: solana_pubkey::Pubkey,
    /// The lp authority base token ata account
    pub lp_authority_base_ata: solana_pubkey::Pubkey,
    /// The whirlpool base vault account
    pub whirlpool_base_vault: solana_pubkey::Pubkey,
    /// The whirlpool config account
    pub whirlpool_config: solana_pubkey::Pubkey,
    /// The fee tier account
    pub fee_tier: solana_pubkey::Pubkey,
    /// The whirlpool account
    pub whirlpool: solana_pubkey::Pubkey,
    /// The whirlpool oracle account
    pub oracle: solana_pubkey::Pubkey,
    /// The position account
    pub position: solana_pubkey::Pubkey,
    /// The position mint account
    pub position_mint: solana_pubkey::Pubkey,
    /// The position token account for the bonding curve
    pub position_token_account: solana_pubkey::Pubkey,
    /// The position token account for the lp authority
    pub lp_authority_token_account: solana_pubkey::Pubkey,
    /// The lower tick array account
    pub lower_tick_array: solana_pubkey::Pubkey,
    /// The upper tick array account
    pub upper_tick_array: solana_pubkey::Pubkey,
    /// The quote token badge account
    pub quote_token_badge: solana_pubkey::Pubkey,
    /// The base token badge account
    pub base_token_badge: solana_pubkey::Pubkey,
    /// The whirlpool init authority account
    pub whirlpool_init_authority: solana_pubkey::Pubkey,
    /// The whirlpool update authority account
    pub whirlpool_update_authority: solana_pubkey::Pubkey,
    /// The lock config account
    pub lock_config: solana_pubkey::Pubkey,
    /// The system program
    pub system_program: solana_pubkey::Pubkey,
    /// The ata program
    pub ata_program: solana_pubkey::Pubkey,
    /// The quote token program
    pub quote_token_program: solana_pubkey::Pubkey,
    /// The base token program
    pub base_token_program: solana_pubkey::Pubkey,
    /// The token 22 program
    pub token22_program: solana_pubkey::Pubkey,
    /// The memo program
    pub memo_program: solana_pubkey::Pubkey,
    /// The whirlpool program
    pub whirlpool_program: solana_pubkey::Pubkey,
    /// The rent sysvar
    pub rent: solana_pubkey::Pubkey,
}

impl GraduateWhirlpool {
    pub fn instruction(&self) -> solana_instruction::Instruction {
        self.instruction_with_remaining_accounts(&[])
    }
    #[allow(clippy::arithmetic_side_effects)]
    #[allow(clippy::vec_init_then_push)]
    pub fn instruction_with_remaining_accounts(
        &self,
        remaining_accounts: &[solana_instruction::AccountMeta],
    ) -> solana_instruction::Instruction {
        let mut accounts = Vec::with_capacity(35 + remaining_accounts.len());
        accounts.push(solana_instruction::AccountMeta::new(self.signer, true));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.lp_authority,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.bonding_curve,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.quote_mint,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.quote_vault,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.signer_quote_ata,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.lp_authority_quote_ata,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.whirlpool_quote_vault,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(self.base_mint, false));
        accounts.push(solana_instruction::AccountMeta::new(self.base_vault, false));
        accounts.push(solana_instruction::AccountMeta::new(
            self.lp_authority_base_ata,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.whirlpool_base_vault,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.whirlpool_config,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.fee_tier,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(self.whirlpool, false));
        accounts.push(solana_instruction::AccountMeta::new(self.oracle, false));
        accounts.push(solana_instruction::AccountMeta::new(self.position, false));
        accounts.push(solana_instruction::AccountMeta::new(
            self.position_mint,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.position_token_account,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.lp_authority_token_account,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.lower_tick_array,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.upper_tick_array,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.quote_token_badge,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.base_token_badge,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.whirlpool_init_authority,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.whirlpool_update_authority,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            self.lock_config,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.system_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.ata_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.quote_token_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.base_token_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.token22_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.memo_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.whirlpool_program,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            self.rent, false,
        ));
        accounts.extend_from_slice(remaining_accounts);
        let data = borsh::to_vec(&GraduateWhirlpoolInstructionData::new()).unwrap();

        solana_instruction::Instruction {
            program_id: crate::WAVEBREAK_ID,
            accounts,
            data,
        }
    }
}

#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct GraduateWhirlpoolInstructionData {
    discriminator: u8,
}

impl GraduateWhirlpoolInstructionData {
    pub fn new() -> Self {
        Self { discriminator: 32 }
    }
}

impl Default for GraduateWhirlpoolInstructionData {
    fn default() -> Self {
        Self::new()
    }
}

/// Instruction builder for `GraduateWhirlpool`.
///
/// ### Accounts:
///
///   0. `[writable, signer]` signer
///   1. `[]` lp_authority
///   2. `[writable]` bonding_curve
///   3. `[]` quote_mint
///   4. `[writable]` quote_vault
///   5. `[writable]` signer_quote_ata
///   6. `[writable]` lp_authority_quote_ata
///   7. `[writable]` whirlpool_quote_vault
///   8. `[writable]` base_mint
///   9. `[writable]` base_vault
///   10. `[writable]` lp_authority_base_ata
///   11. `[writable]` whirlpool_base_vault
///   12. `[]` whirlpool_config
///   13. `[]` fee_tier
///   14. `[writable]` whirlpool
///   15. `[writable]` oracle
///   16. `[writable]` position
///   17. `[writable]` position_mint
///   18. `[writable]` position_token_account
///   19. `[writable]` lp_authority_token_account
///   20. `[writable]` lower_tick_array
///   21. `[writable]` upper_tick_array
///   22. `[]` quote_token_badge
///   23. `[]` base_token_badge
///   24. `[]` whirlpool_init_authority
///   25. `[]` whirlpool_update_authority
///   26. `[writable]` lock_config
///   27. `[optional]` system_program (default to `11111111111111111111111111111111`)
///   28. `[optional]` ata_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`)
///   29. `[]` quote_token_program
///   30. `[]` base_token_program
///   31. `[]` token22_program
///   32. `[]` memo_program
///   33. `[]` whirlpool_program
///   34. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
#[derive(Clone, Debug, Default)]
pub struct GraduateWhirlpoolBuilder {
    signer: Option<solana_pubkey::Pubkey>,
    lp_authority: Option<solana_pubkey::Pubkey>,
    bonding_curve: Option<solana_pubkey::Pubkey>,
    quote_mint: Option<solana_pubkey::Pubkey>,
    quote_vault: Option<solana_pubkey::Pubkey>,
    signer_quote_ata: Option<solana_pubkey::Pubkey>,
    lp_authority_quote_ata: Option<solana_pubkey::Pubkey>,
    whirlpool_quote_vault: Option<solana_pubkey::Pubkey>,
    base_mint: Option<solana_pubkey::Pubkey>,
    base_vault: Option<solana_pubkey::Pubkey>,
    lp_authority_base_ata: Option<solana_pubkey::Pubkey>,
    whirlpool_base_vault: Option<solana_pubkey::Pubkey>,
    whirlpool_config: Option<solana_pubkey::Pubkey>,
    fee_tier: Option<solana_pubkey::Pubkey>,
    whirlpool: Option<solana_pubkey::Pubkey>,
    oracle: Option<solana_pubkey::Pubkey>,
    position: Option<solana_pubkey::Pubkey>,
    position_mint: Option<solana_pubkey::Pubkey>,
    position_token_account: Option<solana_pubkey::Pubkey>,
    lp_authority_token_account: Option<solana_pubkey::Pubkey>,
    lower_tick_array: Option<solana_pubkey::Pubkey>,
    upper_tick_array: Option<solana_pubkey::Pubkey>,
    quote_token_badge: Option<solana_pubkey::Pubkey>,
    base_token_badge: Option<solana_pubkey::Pubkey>,
    whirlpool_init_authority: Option<solana_pubkey::Pubkey>,
    whirlpool_update_authority: Option<solana_pubkey::Pubkey>,
    lock_config: Option<solana_pubkey::Pubkey>,
    system_program: Option<solana_pubkey::Pubkey>,
    ata_program: Option<solana_pubkey::Pubkey>,
    quote_token_program: Option<solana_pubkey::Pubkey>,
    base_token_program: Option<solana_pubkey::Pubkey>,
    token22_program: Option<solana_pubkey::Pubkey>,
    memo_program: Option<solana_pubkey::Pubkey>,
    whirlpool_program: Option<solana_pubkey::Pubkey>,
    rent: Option<solana_pubkey::Pubkey>,
    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
}

impl GraduateWhirlpoolBuilder {
    pub fn new() -> Self {
        Self::default()
    }
    /// The signer of the transaction
    #[inline(always)]
    pub fn signer(&mut self, signer: solana_pubkey::Pubkey) -> &mut Self {
        self.signer = Some(signer);
        self
    }
    /// The lp authority of the token
    #[inline(always)]
    pub fn lp_authority(&mut self, lp_authority: solana_pubkey::Pubkey) -> &mut Self {
        self.lp_authority = Some(lp_authority);
        self
    }
    /// The bonding curve account
    #[inline(always)]
    pub fn bonding_curve(&mut self, bonding_curve: solana_pubkey::Pubkey) -> &mut Self {
        self.bonding_curve = Some(bonding_curve);
        self
    }
    /// The quote token mint account
    #[inline(always)]
    pub fn quote_mint(&mut self, quote_mint: solana_pubkey::Pubkey) -> &mut Self {
        self.quote_mint = Some(quote_mint);
        self
    }
    /// The quote token vault
    #[inline(always)]
    pub fn quote_vault(&mut self, quote_vault: solana_pubkey::Pubkey) -> &mut Self {
        self.quote_vault = Some(quote_vault);
        self
    }
    /// The quote token ata account
    #[inline(always)]
    pub fn signer_quote_ata(&mut self, signer_quote_ata: solana_pubkey::Pubkey) -> &mut Self {
        self.signer_quote_ata = Some(signer_quote_ata);
        self
    }
    /// The lp authority quote token ata account
    #[inline(always)]
    pub fn lp_authority_quote_ata(
        &mut self,
        lp_authority_quote_ata: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.lp_authority_quote_ata = Some(lp_authority_quote_ata);
        self
    }
    /// The whirlpool quote vault account
    #[inline(always)]
    pub fn whirlpool_quote_vault(
        &mut self,
        whirlpool_quote_vault: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.whirlpool_quote_vault = Some(whirlpool_quote_vault);
        self
    }
    /// The base token mint account
    #[inline(always)]
    pub fn base_mint(&mut self, base_mint: solana_pubkey::Pubkey) -> &mut Self {
        self.base_mint = Some(base_mint);
        self
    }
    /// The config base vault account
    #[inline(always)]
    pub fn base_vault(&mut self, base_vault: solana_pubkey::Pubkey) -> &mut Self {
        self.base_vault = Some(base_vault);
        self
    }
    /// The lp authority base token ata account
    #[inline(always)]
    pub fn lp_authority_base_ata(
        &mut self,
        lp_authority_base_ata: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.lp_authority_base_ata = Some(lp_authority_base_ata);
        self
    }
    /// The whirlpool base vault account
    #[inline(always)]
    pub fn whirlpool_base_vault(
        &mut self,
        whirlpool_base_vault: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.whirlpool_base_vault = Some(whirlpool_base_vault);
        self
    }
    /// The whirlpool config account
    #[inline(always)]
    pub fn whirlpool_config(&mut self, whirlpool_config: solana_pubkey::Pubkey) -> &mut Self {
        self.whirlpool_config = Some(whirlpool_config);
        self
    }
    /// The fee tier account
    #[inline(always)]
    pub fn fee_tier(&mut self, fee_tier: solana_pubkey::Pubkey) -> &mut Self {
        self.fee_tier = Some(fee_tier);
        self
    }
    /// The whirlpool account
    #[inline(always)]
    pub fn whirlpool(&mut self, whirlpool: solana_pubkey::Pubkey) -> &mut Self {
        self.whirlpool = Some(whirlpool);
        self
    }
    /// The whirlpool oracle account
    #[inline(always)]
    pub fn oracle(&mut self, oracle: solana_pubkey::Pubkey) -> &mut Self {
        self.oracle = Some(oracle);
        self
    }
    /// The position account
    #[inline(always)]
    pub fn position(&mut self, position: solana_pubkey::Pubkey) -> &mut Self {
        self.position = Some(position);
        self
    }
    /// The position mint account
    #[inline(always)]
    pub fn position_mint(&mut self, position_mint: solana_pubkey::Pubkey) -> &mut Self {
        self.position_mint = Some(position_mint);
        self
    }
    /// The position token account for the bonding curve
    #[inline(always)]
    pub fn position_token_account(
        &mut self,
        position_token_account: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.position_token_account = Some(position_token_account);
        self
    }
    /// The position token account for the lp authority
    #[inline(always)]
    pub fn lp_authority_token_account(
        &mut self,
        lp_authority_token_account: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.lp_authority_token_account = Some(lp_authority_token_account);
        self
    }
    /// The lower tick array account
    #[inline(always)]
    pub fn lower_tick_array(&mut self, lower_tick_array: solana_pubkey::Pubkey) -> &mut Self {
        self.lower_tick_array = Some(lower_tick_array);
        self
    }
    /// The upper tick array account
    #[inline(always)]
    pub fn upper_tick_array(&mut self, upper_tick_array: solana_pubkey::Pubkey) -> &mut Self {
        self.upper_tick_array = Some(upper_tick_array);
        self
    }
    /// The quote token badge account
    #[inline(always)]
    pub fn quote_token_badge(&mut self, quote_token_badge: solana_pubkey::Pubkey) -> &mut Self {
        self.quote_token_badge = Some(quote_token_badge);
        self
    }
    /// The base token badge account
    #[inline(always)]
    pub fn base_token_badge(&mut self, base_token_badge: solana_pubkey::Pubkey) -> &mut Self {
        self.base_token_badge = Some(base_token_badge);
        self
    }
    /// The whirlpool init authority account
    #[inline(always)]
    pub fn whirlpool_init_authority(
        &mut self,
        whirlpool_init_authority: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.whirlpool_init_authority = Some(whirlpool_init_authority);
        self
    }
    /// The whirlpool update authority account
    #[inline(always)]
    pub fn whirlpool_update_authority(
        &mut self,
        whirlpool_update_authority: solana_pubkey::Pubkey,
    ) -> &mut Self {
        self.whirlpool_update_authority = Some(whirlpool_update_authority);
        self
    }
    /// The lock config account
    #[inline(always)]
    pub fn lock_config(&mut self, lock_config: solana_pubkey::Pubkey) -> &mut Self {
        self.lock_config = Some(lock_config);
        self
    }
    /// `[optional account, default to '11111111111111111111111111111111']`
    /// The system program
    #[inline(always)]
    pub fn system_program(&mut self, system_program: solana_pubkey::Pubkey) -> &mut Self {
        self.system_program = Some(system_program);
        self
    }
    /// `[optional account, default to 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL']`
    /// The ata program
    #[inline(always)]
    pub fn ata_program(&mut self, ata_program: solana_pubkey::Pubkey) -> &mut Self {
        self.ata_program = Some(ata_program);
        self
    }
    /// The quote token program
    #[inline(always)]
    pub fn quote_token_program(&mut self, quote_token_program: solana_pubkey::Pubkey) -> &mut Self {
        self.quote_token_program = Some(quote_token_program);
        self
    }
    /// The base token program
    #[inline(always)]
    pub fn base_token_program(&mut self, base_token_program: solana_pubkey::Pubkey) -> &mut Self {
        self.base_token_program = Some(base_token_program);
        self
    }
    /// The token 22 program
    #[inline(always)]
    pub fn token22_program(&mut self, token22_program: solana_pubkey::Pubkey) -> &mut Self {
        self.token22_program = Some(token22_program);
        self
    }
    /// The memo program
    #[inline(always)]
    pub fn memo_program(&mut self, memo_program: solana_pubkey::Pubkey) -> &mut Self {
        self.memo_program = Some(memo_program);
        self
    }
    /// The whirlpool program
    #[inline(always)]
    pub fn whirlpool_program(&mut self, whirlpool_program: solana_pubkey::Pubkey) -> &mut Self {
        self.whirlpool_program = Some(whirlpool_program);
        self
    }
    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
    /// The rent sysvar
    #[inline(always)]
    pub fn rent(&mut self, rent: solana_pubkey::Pubkey) -> &mut Self {
        self.rent = Some(rent);
        self
    }
    /// Add an additional account to the instruction.
    #[inline(always)]
    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
        self.__remaining_accounts.push(account);
        self
    }
    /// Add additional accounts to the instruction.
    #[inline(always)]
    pub fn add_remaining_accounts(
        &mut self,
        accounts: &[solana_instruction::AccountMeta],
    ) -> &mut Self {
        self.__remaining_accounts.extend_from_slice(accounts);
        self
    }
    #[allow(clippy::clone_on_copy)]
    pub fn instruction(&self) -> solana_instruction::Instruction {
        let accounts = GraduateWhirlpool {
            signer: self.signer.expect("signer is not set"),
            lp_authority: self.lp_authority.expect("lp_authority is not set"),
            bonding_curve: self.bonding_curve.expect("bonding_curve is not set"),
            quote_mint: self.quote_mint.expect("quote_mint is not set"),
            quote_vault: self.quote_vault.expect("quote_vault is not set"),
            signer_quote_ata: self.signer_quote_ata.expect("signer_quote_ata is not set"),
            lp_authority_quote_ata: self
                .lp_authority_quote_ata
                .expect("lp_authority_quote_ata is not set"),
            whirlpool_quote_vault: self
                .whirlpool_quote_vault
                .expect("whirlpool_quote_vault is not set"),
            base_mint: self.base_mint.expect("base_mint is not set"),
            base_vault: self.base_vault.expect("base_vault is not set"),
            lp_authority_base_ata: self
                .lp_authority_base_ata
                .expect("lp_authority_base_ata is not set"),
            whirlpool_base_vault: self
                .whirlpool_base_vault
                .expect("whirlpool_base_vault is not set"),
            whirlpool_config: self.whirlpool_config.expect("whirlpool_config is not set"),
            fee_tier: self.fee_tier.expect("fee_tier is not set"),
            whirlpool: self.whirlpool.expect("whirlpool is not set"),
            oracle: self.oracle.expect("oracle is not set"),
            position: self.position.expect("position is not set"),
            position_mint: self.position_mint.expect("position_mint is not set"),
            position_token_account: self
                .position_token_account
                .expect("position_token_account is not set"),
            lp_authority_token_account: self
                .lp_authority_token_account
                .expect("lp_authority_token_account is not set"),
            lower_tick_array: self.lower_tick_array.expect("lower_tick_array is not set"),
            upper_tick_array: self.upper_tick_array.expect("upper_tick_array is not set"),
            quote_token_badge: self
                .quote_token_badge
                .expect("quote_token_badge is not set"),
            base_token_badge: self.base_token_badge.expect("base_token_badge is not set"),
            whirlpool_init_authority: self
                .whirlpool_init_authority
                .expect("whirlpool_init_authority is not set"),
            whirlpool_update_authority: self
                .whirlpool_update_authority
                .expect("whirlpool_update_authority is not set"),
            lock_config: self.lock_config.expect("lock_config is not set"),
            system_program: self
                .system_program
                .unwrap_or(solana_pubkey::pubkey!("11111111111111111111111111111111")),
            ata_program: self.ata_program.unwrap_or(solana_pubkey::pubkey!(
                "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
            )),
            quote_token_program: self
                .quote_token_program
                .expect("quote_token_program is not set"),
            base_token_program: self
                .base_token_program
                .expect("base_token_program is not set"),
            token22_program: self.token22_program.expect("token22_program is not set"),
            memo_program: self.memo_program.expect("memo_program is not set"),
            whirlpool_program: self
                .whirlpool_program
                .expect("whirlpool_program is not set"),
            rent: self.rent.unwrap_or(solana_pubkey::pubkey!(
                "SysvarRent111111111111111111111111111111111"
            )),
        };

        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
    }
}

/// `graduate_whirlpool` CPI accounts.
pub struct GraduateWhirlpoolCpiAccounts<'a, 'b> {
    /// The signer of the transaction
    pub signer: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority of the token
    pub lp_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The bonding curve account
    pub bonding_curve: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token mint account
    pub quote_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token vault
    pub quote_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token ata account
    pub signer_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority quote token ata account
    pub lp_authority_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool quote vault account
    pub whirlpool_quote_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The base token mint account
    pub base_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The config base vault account
    pub base_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority base token ata account
    pub lp_authority_base_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool base vault account
    pub whirlpool_base_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool config account
    pub whirlpool_config: &'b solana_account_info::AccountInfo<'a>,
    /// The fee tier account
    pub fee_tier: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool account
    pub whirlpool: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool oracle account
    pub oracle: &'b solana_account_info::AccountInfo<'a>,
    /// The position account
    pub position: &'b solana_account_info::AccountInfo<'a>,
    /// The position mint account
    pub position_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The position token account for the bonding curve
    pub position_token_account: &'b solana_account_info::AccountInfo<'a>,
    /// The position token account for the lp authority
    pub lp_authority_token_account: &'b solana_account_info::AccountInfo<'a>,
    /// The lower tick array account
    pub lower_tick_array: &'b solana_account_info::AccountInfo<'a>,
    /// The upper tick array account
    pub upper_tick_array: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token badge account
    pub quote_token_badge: &'b solana_account_info::AccountInfo<'a>,
    /// The base token badge account
    pub base_token_badge: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool init authority account
    pub whirlpool_init_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool update authority account
    pub whirlpool_update_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The lock config account
    pub lock_config: &'b solana_account_info::AccountInfo<'a>,
    /// The system program
    pub system_program: &'b solana_account_info::AccountInfo<'a>,
    /// The ata program
    pub ata_program: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token program
    pub quote_token_program: &'b solana_account_info::AccountInfo<'a>,
    /// The base token program
    pub base_token_program: &'b solana_account_info::AccountInfo<'a>,
    /// The token 22 program
    pub token22_program: &'b solana_account_info::AccountInfo<'a>,
    /// The memo program
    pub memo_program: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool program
    pub whirlpool_program: &'b solana_account_info::AccountInfo<'a>,
    /// The rent sysvar
    pub rent: &'b solana_account_info::AccountInfo<'a>,
}

/// `graduate_whirlpool` CPI instruction.
pub struct GraduateWhirlpoolCpi<'a, 'b> {
    /// The program to invoke.
    pub __program: &'b solana_account_info::AccountInfo<'a>,
    /// The signer of the transaction
    pub signer: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority of the token
    pub lp_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The bonding curve account
    pub bonding_curve: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token mint account
    pub quote_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token vault
    pub quote_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token ata account
    pub signer_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority quote token ata account
    pub lp_authority_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool quote vault account
    pub whirlpool_quote_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The base token mint account
    pub base_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The config base vault account
    pub base_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The lp authority base token ata account
    pub lp_authority_base_ata: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool base vault account
    pub whirlpool_base_vault: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool config account
    pub whirlpool_config: &'b solana_account_info::AccountInfo<'a>,
    /// The fee tier account
    pub fee_tier: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool account
    pub whirlpool: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool oracle account
    pub oracle: &'b solana_account_info::AccountInfo<'a>,
    /// The position account
    pub position: &'b solana_account_info::AccountInfo<'a>,
    /// The position mint account
    pub position_mint: &'b solana_account_info::AccountInfo<'a>,
    /// The position token account for the bonding curve
    pub position_token_account: &'b solana_account_info::AccountInfo<'a>,
    /// The position token account for the lp authority
    pub lp_authority_token_account: &'b solana_account_info::AccountInfo<'a>,
    /// The lower tick array account
    pub lower_tick_array: &'b solana_account_info::AccountInfo<'a>,
    /// The upper tick array account
    pub upper_tick_array: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token badge account
    pub quote_token_badge: &'b solana_account_info::AccountInfo<'a>,
    /// The base token badge account
    pub base_token_badge: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool init authority account
    pub whirlpool_init_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool update authority account
    pub whirlpool_update_authority: &'b solana_account_info::AccountInfo<'a>,
    /// The lock config account
    pub lock_config: &'b solana_account_info::AccountInfo<'a>,
    /// The system program
    pub system_program: &'b solana_account_info::AccountInfo<'a>,
    /// The ata program
    pub ata_program: &'b solana_account_info::AccountInfo<'a>,
    /// The quote token program
    pub quote_token_program: &'b solana_account_info::AccountInfo<'a>,
    /// The base token program
    pub base_token_program: &'b solana_account_info::AccountInfo<'a>,
    /// The token 22 program
    pub token22_program: &'b solana_account_info::AccountInfo<'a>,
    /// The memo program
    pub memo_program: &'b solana_account_info::AccountInfo<'a>,
    /// The whirlpool program
    pub whirlpool_program: &'b solana_account_info::AccountInfo<'a>,
    /// The rent sysvar
    pub rent: &'b solana_account_info::AccountInfo<'a>,
}

impl<'a, 'b> GraduateWhirlpoolCpi<'a, 'b> {
    pub fn new(
        program: &'b solana_account_info::AccountInfo<'a>,
        accounts: GraduateWhirlpoolCpiAccounts<'a, 'b>,
    ) -> Self {
        Self {
            __program: program,
            signer: accounts.signer,
            lp_authority: accounts.lp_authority,
            bonding_curve: accounts.bonding_curve,
            quote_mint: accounts.quote_mint,
            quote_vault: accounts.quote_vault,
            signer_quote_ata: accounts.signer_quote_ata,
            lp_authority_quote_ata: accounts.lp_authority_quote_ata,
            whirlpool_quote_vault: accounts.whirlpool_quote_vault,
            base_mint: accounts.base_mint,
            base_vault: accounts.base_vault,
            lp_authority_base_ata: accounts.lp_authority_base_ata,
            whirlpool_base_vault: accounts.whirlpool_base_vault,
            whirlpool_config: accounts.whirlpool_config,
            fee_tier: accounts.fee_tier,
            whirlpool: accounts.whirlpool,
            oracle: accounts.oracle,
            position: accounts.position,
            position_mint: accounts.position_mint,
            position_token_account: accounts.position_token_account,
            lp_authority_token_account: accounts.lp_authority_token_account,
            lower_tick_array: accounts.lower_tick_array,
            upper_tick_array: accounts.upper_tick_array,
            quote_token_badge: accounts.quote_token_badge,
            base_token_badge: accounts.base_token_badge,
            whirlpool_init_authority: accounts.whirlpool_init_authority,
            whirlpool_update_authority: accounts.whirlpool_update_authority,
            lock_config: accounts.lock_config,
            system_program: accounts.system_program,
            ata_program: accounts.ata_program,
            quote_token_program: accounts.quote_token_program,
            base_token_program: accounts.base_token_program,
            token22_program: accounts.token22_program,
            memo_program: accounts.memo_program,
            whirlpool_program: accounts.whirlpool_program,
            rent: accounts.rent,
        }
    }
    #[inline(always)]
    pub fn invoke(&self) -> solana_program_entrypoint::ProgramResult {
        self.invoke_signed_with_remaining_accounts(&[], &[])
    }
    #[inline(always)]
    pub fn invoke_with_remaining_accounts(
        &self,
        remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
    ) -> solana_program_entrypoint::ProgramResult {
        self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
    }
    #[inline(always)]
    pub fn invoke_signed(
        &self,
        signers_seeds: &[&[&[u8]]],
    ) -> solana_program_entrypoint::ProgramResult {
        self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
    }
    #[allow(clippy::arithmetic_side_effects)]
    #[allow(clippy::clone_on_copy)]
    #[allow(clippy::vec_init_then_push)]
    pub fn invoke_signed_with_remaining_accounts(
        &self,
        signers_seeds: &[&[&[u8]]],
        remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
    ) -> solana_program_entrypoint::ProgramResult {
        let mut accounts = Vec::with_capacity(35 + remaining_accounts.len());
        accounts.push(solana_instruction::AccountMeta::new(*self.signer.key, true));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.lp_authority.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.bonding_curve.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.quote_mint.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.quote_vault.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.signer_quote_ata.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.lp_authority_quote_ata.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.whirlpool_quote_vault.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.base_mint.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.base_vault.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.lp_authority_base_ata.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.whirlpool_base_vault.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.whirlpool_config.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.fee_tier.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.whirlpool.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.oracle.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.position.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.position_mint.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.position_token_account.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.lp_authority_token_account.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.lower_tick_array.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.upper_tick_array.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.quote_token_badge.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.base_token_badge.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.whirlpool_init_authority.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.whirlpool_update_authority.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new(
            *self.lock_config.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.system_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.ata_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.quote_token_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.base_token_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.token22_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.memo_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.whirlpool_program.key,
            false,
        ));
        accounts.push(solana_instruction::AccountMeta::new_readonly(
            *self.rent.key,
            false,
        ));
        remaining_accounts.iter().for_each(|remaining_account| {
            accounts.push(solana_instruction::AccountMeta {
                pubkey: *remaining_account.0.key,
                is_signer: remaining_account.1,
                is_writable: remaining_account.2,
            })
        });
        let data = borsh::to_vec(&GraduateWhirlpoolInstructionData::new()).unwrap();

        let instruction = solana_instruction::Instruction {
            program_id: crate::WAVEBREAK_ID,
            accounts,
            data,
        };
        let mut account_infos = Vec::with_capacity(36 + remaining_accounts.len());
        account_infos.push(self.__program.clone());
        account_infos.push(self.signer.clone());
        account_infos.push(self.lp_authority.clone());
        account_infos.push(self.bonding_curve.clone());
        account_infos.push(self.quote_mint.clone());
        account_infos.push(self.quote_vault.clone());
        account_infos.push(self.signer_quote_ata.clone());
        account_infos.push(self.lp_authority_quote_ata.clone());
        account_infos.push(self.whirlpool_quote_vault.clone());
        account_infos.push(self.base_mint.clone());
        account_infos.push(self.base_vault.clone());
        account_infos.push(self.lp_authority_base_ata.clone());
        account_infos.push(self.whirlpool_base_vault.clone());
        account_infos.push(self.whirlpool_config.clone());
        account_infos.push(self.fee_tier.clone());
        account_infos.push(self.whirlpool.clone());
        account_infos.push(self.oracle.clone());
        account_infos.push(self.position.clone());
        account_infos.push(self.position_mint.clone());
        account_infos.push(self.position_token_account.clone());
        account_infos.push(self.lp_authority_token_account.clone());
        account_infos.push(self.lower_tick_array.clone());
        account_infos.push(self.upper_tick_array.clone());
        account_infos.push(self.quote_token_badge.clone());
        account_infos.push(self.base_token_badge.clone());
        account_infos.push(self.whirlpool_init_authority.clone());
        account_infos.push(self.whirlpool_update_authority.clone());
        account_infos.push(self.lock_config.clone());
        account_infos.push(self.system_program.clone());
        account_infos.push(self.ata_program.clone());
        account_infos.push(self.quote_token_program.clone());
        account_infos.push(self.base_token_program.clone());
        account_infos.push(self.token22_program.clone());
        account_infos.push(self.memo_program.clone());
        account_infos.push(self.whirlpool_program.clone());
        account_infos.push(self.rent.clone());
        remaining_accounts
            .iter()
            .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));

        if signers_seeds.is_empty() {
            solana_cpi::invoke(&instruction, &account_infos)
        } else {
            solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
        }
    }
}

/// Instruction builder for `GraduateWhirlpool` via CPI.
///
/// ### Accounts:
///
///   0. `[writable, signer]` signer
///   1. `[]` lp_authority
///   2. `[writable]` bonding_curve
///   3. `[]` quote_mint
///   4. `[writable]` quote_vault
///   5. `[writable]` signer_quote_ata
///   6. `[writable]` lp_authority_quote_ata
///   7. `[writable]` whirlpool_quote_vault
///   8. `[writable]` base_mint
///   9. `[writable]` base_vault
///   10. `[writable]` lp_authority_base_ata
///   11. `[writable]` whirlpool_base_vault
///   12. `[]` whirlpool_config
///   13. `[]` fee_tier
///   14. `[writable]` whirlpool
///   15. `[writable]` oracle
///   16. `[writable]` position
///   17. `[writable]` position_mint
///   18. `[writable]` position_token_account
///   19. `[writable]` lp_authority_token_account
///   20. `[writable]` lower_tick_array
///   21. `[writable]` upper_tick_array
///   22. `[]` quote_token_badge
///   23. `[]` base_token_badge
///   24. `[]` whirlpool_init_authority
///   25. `[]` whirlpool_update_authority
///   26. `[writable]` lock_config
///   27. `[]` system_program
///   28. `[]` ata_program
///   29. `[]` quote_token_program
///   30. `[]` base_token_program
///   31. `[]` token22_program
///   32. `[]` memo_program
///   33. `[]` whirlpool_program
///   34. `[]` rent
#[derive(Clone, Debug)]
pub struct GraduateWhirlpoolCpiBuilder<'a, 'b> {
    instruction: Box<GraduateWhirlpoolCpiBuilderInstruction<'a, 'b>>,
}

impl<'a, 'b> GraduateWhirlpoolCpiBuilder<'a, 'b> {
    pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
        let instruction = Box::new(GraduateWhirlpoolCpiBuilderInstruction {
            __program: program,
            signer: None,
            lp_authority: None,
            bonding_curve: None,
            quote_mint: None,
            quote_vault: None,
            signer_quote_ata: None,
            lp_authority_quote_ata: None,
            whirlpool_quote_vault: None,
            base_mint: None,
            base_vault: None,
            lp_authority_base_ata: None,
            whirlpool_base_vault: None,
            whirlpool_config: None,
            fee_tier: None,
            whirlpool: None,
            oracle: None,
            position: None,
            position_mint: None,
            position_token_account: None,
            lp_authority_token_account: None,
            lower_tick_array: None,
            upper_tick_array: None,
            quote_token_badge: None,
            base_token_badge: None,
            whirlpool_init_authority: None,
            whirlpool_update_authority: None,
            lock_config: None,
            system_program: None,
            ata_program: None,
            quote_token_program: None,
            base_token_program: None,
            token22_program: None,
            memo_program: None,
            whirlpool_program: None,
            rent: None,
            __remaining_accounts: Vec::new(),
        });
        Self { instruction }
    }
    /// The signer of the transaction
    #[inline(always)]
    pub fn signer(&mut self, signer: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.signer = Some(signer);
        self
    }
    /// The lp authority of the token
    #[inline(always)]
    pub fn lp_authority(
        &mut self,
        lp_authority: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lp_authority = Some(lp_authority);
        self
    }
    /// The bonding curve account
    #[inline(always)]
    pub fn bonding_curve(
        &mut self,
        bonding_curve: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.bonding_curve = Some(bonding_curve);
        self
    }
    /// The quote token mint account
    #[inline(always)]
    pub fn quote_mint(
        &mut self,
        quote_mint: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.quote_mint = Some(quote_mint);
        self
    }
    /// The quote token vault
    #[inline(always)]
    pub fn quote_vault(
        &mut self,
        quote_vault: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.quote_vault = Some(quote_vault);
        self
    }
    /// The quote token ata account
    #[inline(always)]
    pub fn signer_quote_ata(
        &mut self,
        signer_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.signer_quote_ata = Some(signer_quote_ata);
        self
    }
    /// The lp authority quote token ata account
    #[inline(always)]
    pub fn lp_authority_quote_ata(
        &mut self,
        lp_authority_quote_ata: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lp_authority_quote_ata = Some(lp_authority_quote_ata);
        self
    }
    /// The whirlpool quote vault account
    #[inline(always)]
    pub fn whirlpool_quote_vault(
        &mut self,
        whirlpool_quote_vault: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_quote_vault = Some(whirlpool_quote_vault);
        self
    }
    /// The base token mint account
    #[inline(always)]
    pub fn base_mint(&mut self, base_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.base_mint = Some(base_mint);
        self
    }
    /// The config base vault account
    #[inline(always)]
    pub fn base_vault(
        &mut self,
        base_vault: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.base_vault = Some(base_vault);
        self
    }
    /// The lp authority base token ata account
    #[inline(always)]
    pub fn lp_authority_base_ata(
        &mut self,
        lp_authority_base_ata: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lp_authority_base_ata = Some(lp_authority_base_ata);
        self
    }
    /// The whirlpool base vault account
    #[inline(always)]
    pub fn whirlpool_base_vault(
        &mut self,
        whirlpool_base_vault: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_base_vault = Some(whirlpool_base_vault);
        self
    }
    /// The whirlpool config account
    #[inline(always)]
    pub fn whirlpool_config(
        &mut self,
        whirlpool_config: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_config = Some(whirlpool_config);
        self
    }
    /// The fee tier account
    #[inline(always)]
    pub fn fee_tier(&mut self, fee_tier: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.fee_tier = Some(fee_tier);
        self
    }
    /// The whirlpool account
    #[inline(always)]
    pub fn whirlpool(&mut self, whirlpool: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.whirlpool = Some(whirlpool);
        self
    }
    /// The whirlpool oracle account
    #[inline(always)]
    pub fn oracle(&mut self, oracle: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.oracle = Some(oracle);
        self
    }
    /// The position account
    #[inline(always)]
    pub fn position(&mut self, position: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.position = Some(position);
        self
    }
    /// The position mint account
    #[inline(always)]
    pub fn position_mint(
        &mut self,
        position_mint: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.position_mint = Some(position_mint);
        self
    }
    /// The position token account for the bonding curve
    #[inline(always)]
    pub fn position_token_account(
        &mut self,
        position_token_account: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.position_token_account = Some(position_token_account);
        self
    }
    /// The position token account for the lp authority
    #[inline(always)]
    pub fn lp_authority_token_account(
        &mut self,
        lp_authority_token_account: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lp_authority_token_account = Some(lp_authority_token_account);
        self
    }
    /// The lower tick array account
    #[inline(always)]
    pub fn lower_tick_array(
        &mut self,
        lower_tick_array: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lower_tick_array = Some(lower_tick_array);
        self
    }
    /// The upper tick array account
    #[inline(always)]
    pub fn upper_tick_array(
        &mut self,
        upper_tick_array: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.upper_tick_array = Some(upper_tick_array);
        self
    }
    /// The quote token badge account
    #[inline(always)]
    pub fn quote_token_badge(
        &mut self,
        quote_token_badge: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.quote_token_badge = Some(quote_token_badge);
        self
    }
    /// The base token badge account
    #[inline(always)]
    pub fn base_token_badge(
        &mut self,
        base_token_badge: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.base_token_badge = Some(base_token_badge);
        self
    }
    /// The whirlpool init authority account
    #[inline(always)]
    pub fn whirlpool_init_authority(
        &mut self,
        whirlpool_init_authority: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_init_authority = Some(whirlpool_init_authority);
        self
    }
    /// The whirlpool update authority account
    #[inline(always)]
    pub fn whirlpool_update_authority(
        &mut self,
        whirlpool_update_authority: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_update_authority = Some(whirlpool_update_authority);
        self
    }
    /// The lock config account
    #[inline(always)]
    pub fn lock_config(
        &mut self,
        lock_config: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.lock_config = Some(lock_config);
        self
    }
    /// The system program
    #[inline(always)]
    pub fn system_program(
        &mut self,
        system_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.system_program = Some(system_program);
        self
    }
    /// The ata program
    #[inline(always)]
    pub fn ata_program(
        &mut self,
        ata_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.ata_program = Some(ata_program);
        self
    }
    /// The quote token program
    #[inline(always)]
    pub fn quote_token_program(
        &mut self,
        quote_token_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.quote_token_program = Some(quote_token_program);
        self
    }
    /// The base token program
    #[inline(always)]
    pub fn base_token_program(
        &mut self,
        base_token_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.base_token_program = Some(base_token_program);
        self
    }
    /// The token 22 program
    #[inline(always)]
    pub fn token22_program(
        &mut self,
        token22_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.token22_program = Some(token22_program);
        self
    }
    /// The memo program
    #[inline(always)]
    pub fn memo_program(
        &mut self,
        memo_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.memo_program = Some(memo_program);
        self
    }
    /// The whirlpool program
    #[inline(always)]
    pub fn whirlpool_program(
        &mut self,
        whirlpool_program: &'b solana_account_info::AccountInfo<'a>,
    ) -> &mut Self {
        self.instruction.whirlpool_program = Some(whirlpool_program);
        self
    }
    /// The rent sysvar
    #[inline(always)]
    pub fn rent(&mut self, rent: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
        self.instruction.rent = Some(rent);
        self
    }
    /// Add an additional account to the instruction.
    #[inline(always)]
    pub fn add_remaining_account(
        &mut self,
        account: &'b solana_account_info::AccountInfo<'a>,
        is_writable: bool,
        is_signer: bool,
    ) -> &mut Self {
        self.instruction
            .__remaining_accounts
            .push((account, is_writable, is_signer));
        self
    }
    /// Add additional accounts to the instruction.
    ///
    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
    /// and a `bool` indicating whether the account is a signer or not.
    #[inline(always)]
    pub fn add_remaining_accounts(
        &mut self,
        accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
    ) -> &mut Self {
        self.instruction
            .__remaining_accounts
            .extend_from_slice(accounts);
        self
    }
    #[inline(always)]
    pub fn invoke(&self) -> solana_program_entrypoint::ProgramResult {
        self.invoke_signed(&[])
    }
    #[allow(clippy::clone_on_copy)]
    #[allow(clippy::vec_init_then_push)]
    pub fn invoke_signed(
        &self,
        signers_seeds: &[&[&[u8]]],
    ) -> solana_program_entrypoint::ProgramResult {
        let instruction = GraduateWhirlpoolCpi {
            __program: self.instruction.__program,

            signer: self.instruction.signer.expect("signer is not set"),

            lp_authority: self
                .instruction
                .lp_authority
                .expect("lp_authority is not set"),

            bonding_curve: self
                .instruction
                .bonding_curve
                .expect("bonding_curve is not set"),

            quote_mint: self.instruction.quote_mint.expect("quote_mint is not set"),

            quote_vault: self
                .instruction
                .quote_vault
                .expect("quote_vault is not set"),

            signer_quote_ata: self
                .instruction
                .signer_quote_ata
                .expect("signer_quote_ata is not set"),

            lp_authority_quote_ata: self
                .instruction
                .lp_authority_quote_ata
                .expect("lp_authority_quote_ata is not set"),

            whirlpool_quote_vault: self
                .instruction
                .whirlpool_quote_vault
                .expect("whirlpool_quote_vault is not set"),

            base_mint: self.instruction.base_mint.expect("base_mint is not set"),

            base_vault: self.instruction.base_vault.expect("base_vault is not set"),

            lp_authority_base_ata: self
                .instruction
                .lp_authority_base_ata
                .expect("lp_authority_base_ata is not set"),

            whirlpool_base_vault: self
                .instruction
                .whirlpool_base_vault
                .expect("whirlpool_base_vault is not set"),

            whirlpool_config: self
                .instruction
                .whirlpool_config
                .expect("whirlpool_config is not set"),

            fee_tier: self.instruction.fee_tier.expect("fee_tier is not set"),

            whirlpool: self.instruction.whirlpool.expect("whirlpool is not set"),

            oracle: self.instruction.oracle.expect("oracle is not set"),

            position: self.instruction.position.expect("position is not set"),

            position_mint: self
                .instruction
                .position_mint
                .expect("position_mint is not set"),

            position_token_account: self
                .instruction
                .position_token_account
                .expect("position_token_account is not set"),

            lp_authority_token_account: self
                .instruction
                .lp_authority_token_account
                .expect("lp_authority_token_account is not set"),

            lower_tick_array: self
                .instruction
                .lower_tick_array
                .expect("lower_tick_array is not set"),

            upper_tick_array: self
                .instruction
                .upper_tick_array
                .expect("upper_tick_array is not set"),

            quote_token_badge: self
                .instruction
                .quote_token_badge
                .expect("quote_token_badge is not set"),

            base_token_badge: self
                .instruction
                .base_token_badge
                .expect("base_token_badge is not set"),

            whirlpool_init_authority: self
                .instruction
                .whirlpool_init_authority
                .expect("whirlpool_init_authority is not set"),

            whirlpool_update_authority: self
                .instruction
                .whirlpool_update_authority
                .expect("whirlpool_update_authority is not set"),

            lock_config: self
                .instruction
                .lock_config
                .expect("lock_config is not set"),

            system_program: self
                .instruction
                .system_program
                .expect("system_program is not set"),

            ata_program: self
                .instruction
                .ata_program
                .expect("ata_program is not set"),

            quote_token_program: self
                .instruction
                .quote_token_program
                .expect("quote_token_program is not set"),

            base_token_program: self
                .instruction
                .base_token_program
                .expect("base_token_program is not set"),

            token22_program: self
                .instruction
                .token22_program
                .expect("token22_program is not set"),

            memo_program: self
                .instruction
                .memo_program
                .expect("memo_program is not set"),

            whirlpool_program: self
                .instruction
                .whirlpool_program
                .expect("whirlpool_program is not set"),

            rent: self.instruction.rent.expect("rent is not set"),
        };
        instruction.invoke_signed_with_remaining_accounts(
            signers_seeds,
            &self.instruction.__remaining_accounts,
        )
    }
}

#[derive(Clone, Debug)]
struct GraduateWhirlpoolCpiBuilderInstruction<'a, 'b> {
    __program: &'b solana_account_info::AccountInfo<'a>,
    signer: Option<&'b solana_account_info::AccountInfo<'a>>,
    lp_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
    bonding_curve: Option<&'b solana_account_info::AccountInfo<'a>>,
    quote_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
    quote_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
    signer_quote_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
    lp_authority_quote_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_quote_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
    base_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
    base_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
    lp_authority_base_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_base_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_config: Option<&'b solana_account_info::AccountInfo<'a>>,
    fee_tier: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool: Option<&'b solana_account_info::AccountInfo<'a>>,
    oracle: Option<&'b solana_account_info::AccountInfo<'a>>,
    position: Option<&'b solana_account_info::AccountInfo<'a>>,
    position_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
    position_token_account: Option<&'b solana_account_info::AccountInfo<'a>>,
    lp_authority_token_account: Option<&'b solana_account_info::AccountInfo<'a>>,
    lower_tick_array: Option<&'b solana_account_info::AccountInfo<'a>>,
    upper_tick_array: Option<&'b solana_account_info::AccountInfo<'a>>,
    quote_token_badge: Option<&'b solana_account_info::AccountInfo<'a>>,
    base_token_badge: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_init_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_update_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
    lock_config: Option<&'b solana_account_info::AccountInfo<'a>>,
    system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    ata_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    quote_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    base_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    token22_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    memo_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    whirlpool_program: Option<&'b solana_account_info::AccountInfo<'a>>,
    rent: Option<&'b solana_account_info::AccountInfo<'a>>,
    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
    __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
}
