pub fn deposit_liquidity(&mut self, liquidity_amount: u64) -> Result<u64, ProgramError> {
        let collateral_exchange_rate = self.collateral_exchange_rate()?;
        let collateral_amount =
            collateral_exchange_rate.liquidity_to_collateral(liquidity_amount)?;

        self.liquidity.available_amount += liquidity_amount;
        self.collateral.mint_total_supply += collateral_amount;

        Ok(collateral_amount)
    }
/// Record deposited liquidity and return amount of collateral tokens to mint
Record deposited liquidity and return amount of collateral tokens to mint
Record deposited liquidity and return amount of collateral tokens to mint
pub fn deposit_liquidity(&mut self, liquidity_amount: u64) -> Result<u64, ProgramError> {
        let collateral_exchange_rate = self.collateral_exchange_rate()?;
        let collateral_amount =
            collateral_exchange_rate.liquidity_to_collateral(liquidity_amount)?;
        self.liquidity.available_amount += liquidity_amount;
        self.collateral.mint_total_supply += collateral_amount;
        Ok(collateral_amount)
    }
pub fn deposit_liquidity ( & mut self , liquidity_amount : u64 ) -> Result < u64 , ProgramError > { let collateral_exchange_rate = self . collateral_exchange_rate ( ) ? ; let collateral_amount = collateral_exchange_rate . liquidity_to_collateral ( liquidity_amount ) ? ; self . liquidity . available_amount += liquidity_amount ; self . collateral . mint_total_supply += collateral_amount ; Ok ( collateral_amount ) }
Record deposited liquidity and return amount of collateral tokens to mint
Record deposited liquidity and return amount of collateral tokens to mint
&mut self
liquidity_amount
u64