pub fn accrue_interest(&mut self, current_slot: Slot) -> ProgramResult {
        let slots_elapsed = self.update_slot(current_slot);
        if slots_elapsed > 0 {
            let current_borrow_rate = self.current_borrow_rate()?;
            let compounded_interest_rate =
                self.compound_interest(current_borrow_rate, slots_elapsed)?;
            self.liquidity.borrowed_amount_wads = self
                .liquidity
                .borrowed_amount_wads
                .try_mul(compounded_interest_rate)?;
        }
        Ok(())
    }
/// Update borrow rate and accrue interest
Update borrow rate and accrue interest
Update borrow rate and accrue interest
pub fn accrue_interest(&mut self, current_slot: Slot) -> ProgramResult {
        let slots_elapsed = self.update_slot(current_slot);
        if slots_elapsed > 0 {
            let current_borrow_rate = self.current_borrow_rate()?;
            let compounded_interest_rate =
                self.compound_interest(current_borrow_rate, slots_elapsed)?;
            self.liquidity.borrowed_amount_wads = self
                .liquidity
                .borrowed_amount_wads
                .try_mul(compounded_interest_rate)?;
        }
        Ok(())
    }
pub fn accrue_interest ( & mut self , current_slot : Slot ) -> ProgramResult { let slots_elapsed = self . update_slot ( current_slot ) ; if slots_elapsed > 0 { let current_borrow_rate = self . current_borrow_rate ( ) ? ; let compounded_interest_rate = self . compound_interest ( current_borrow_rate , slots_elapsed ) ? ; self . liquidity . borrowed_amount_wads = self . liquidity . borrowed_amount_wads . try_mul ( compounded_interest_rate ) ? ; } Ok ( ( ) ) }
Update borrow rate and accrue interest
Update borrow rate and accrue interest
&mut self
current_slot
Slot