pub fn remove_liquidity_pool(
        &self,
        signer: &dyn Signer,
        pool_name: &str,
        ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let mut inst = Vec::<Instruction>::new();
        let _ =
            self.check_pool_accounts(signer, pool_name, 0.0, 0.0, ui_amount, true, &mut inst)?;

        inst.push(self.new_instruction_remove_liquidity_pool(
            &signer.pubkey(),
            pool_name,
            ui_amount,
        )?);

        // check if tokens need to be unwrapped
        let (is_token_a_sol, is_token_b_sol) = self.pool_has_sol_tokens(pool_name)?;
        let (is_token_a_wrapped, is_token_b_wrapped) =
            self.pool_has_saber_wrapped_tokens(pool_name)?;

        if is_token_a_wrapped {
            inst.push(self.new_instruction_unwrap_token(
                &signer.pubkey(),
                pool_name,
                TokenSelector::TokenA,
                0.0,
            )?);
        }
        if is_token_b_wrapped {
            inst.push(self.new_instruction_unwrap_token(
                &signer.pubkey(),
                pool_name,
                TokenSelector::TokenB,
                0.0,
            )?);
        }
        if is_token_a_sol || is_token_b_sol {
            inst.push(self.new_instruction_close_token_account(&signer.pubkey(), "SOL")?);
        }

        self.sign_and_send_instructions(&[signer], inst.as_slice())
    }
/// Removes liquidity from the Pool.
/// If the amount is set to zero entire balance will be removed from the pool.
Removes liquidity from the Pool.
If the amount is set to zero entire balance will be removed from the pool.
Removes liquidity from the Pool . If the amount is set to zero entire balance will be removed from the pool .
pub fn remove_liquidity_pool(
        &self,
        signer: &dyn Signer,
        pool_name: &str,
        ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let mut inst = Vec::<Instruction>::new();
        let _ =
            self.check_pool_accounts(signer, pool_name, 0.0, 0.0, ui_amount, true, &mut inst)?;
        inst.push(self.new_instruction_remove_liquidity_pool(
            &signer.pubkey(),
            pool_name,
            ui_amount,
        )?);
        // check if tokens need to be unwrapped
        let (is_token_a_sol, is_token_b_sol) = self.pool_has_sol_tokens(pool_name)?;
        let (is_token_a_wrapped, is_token_b_wrapped) =
            self.pool_has_saber_wrapped_tokens(pool_name)?;
        if is_token_a_wrapped {
            inst.push(self.new_instruction_unwrap_token(
                &signer.pubkey(),
                pool_name,
                TokenSelector::TokenA,
                0.0,
            )?);
        }
        if is_token_b_wrapped {
            inst.push(self.new_instruction_unwrap_token(
                &signer.pubkey(),
                pool_name,
                TokenSelector::TokenB,
                0.0,
            )?);
        }
        if is_token_a_sol || is_token_b_sol {
            inst.push(self.new_instruction_close_token_account(&signer.pubkey(), "SOL")?);
        }
        self.sign_and_send_instructions(&[signer], inst.as_slice())
    }
pub fn remove_liquidity_pool ( & self , signer : & dyn Signer , pool_name : & str , ui_amount : f64 , ) -> Result < Signature , FarmClientError > { let mut inst = Vec :: < Instruction > :: new ( ) ; let _ = self . check_pool_accounts ( signer , pool_name , 0.0 , 0.0 , ui_amount , true , & mut inst ) ? ; inst . push ( self . new_instruction_remove_liquidity_pool ( & signer . pubkey ( ) , pool_name , ui_amount , ) ? ) ; // check if tokens need to be unwrapped let ( is_token_a_sol , is_token_b_sol ) = self . pool_has_sol_tokens ( pool_name ) ? ; let ( is_token_a_wrapped , is_token_b_wrapped ) = self . pool_has_saber_wrapped_tokens ( pool_name ) ? ; if is_token_a_wrapped { inst . push ( self . new_instruction_unwrap_token ( & signer . pubkey ( ) , pool_name , TokenSelector :: TokenA , 0.0 , ) ? ) ; } if is_token_b_wrapped { inst . push ( self . new_instruction_unwrap_token ( & signer . pubkey ( ) , pool_name , TokenSelector :: TokenB , 0.0 , ) ? ) ; } if is_token_a_sol || is_token_b_sol { inst . push ( self . new_instruction_close_token_account ( & signer . pubkey ( ) , " " ) ? ) ; } self . sign_and_send_instructions ( & [ signer ] , inst . as_slice ( ) ) }
Removes liquidity from the Pool.
Removes liquidity from the Pool .
&self
signer
&dyn Signer
pool_name
&str
ui_amount
f64
&self
signer
&dyn Signer
pool_name
&str
ui_amount
f64