pub fn borrow(&mut self, borrow_amount: u64) -> ProgramResult {
        if borrow_amount > self.available_amount {
            return Err(LendingError::InsufficientLiquidity.into());
        }

        self.available_amount -= borrow_amount;
        self.borrowed_amount_wads = self
            .borrowed_amount_wads
            .try_add(Decimal::from(borrow_amount))?;
        Ok(())
    }
/// Add new borrow amount to total borrows
Add new borrow amount to total borrows
Add new borrow amount to total borrows
pub fn borrow(&mut self, borrow_amount: u64) -> ProgramResult {
        if borrow_amount > self.available_amount {
            return Err(LendingError::InsufficientLiquidity.into());
        }
        self.available_amount -= borrow_amount;
        self.borrowed_amount_wads = self
            .borrowed_amount_wads
            .try_add(Decimal::from(borrow_amount))?;
        Ok(())
    }
pub fn borrow ( & mut self , borrow_amount : u64 ) -> ProgramResult { if borrow_amount > self . available_amount { return Err ( LendingError :: InsufficientLiquidity . into ( ) ) ; } self . available_amount -= borrow_amount ; self . borrowed_amount_wads = self . borrowed_amount_wads . try_add ( Decimal :: from ( borrow_amount ) ) ? ; Ok ( ( ) ) }
Add new borrow amount to total borrows
Add new borrow amount to total borrows
&mut self
borrow_amount
u64