fn compound_interest(
        &mut self,
        current_borrow_rate: Rate,
        slots_elapsed: u64,
    ) -> Result<Rate, ProgramError> {
        let slot_interest_rate: Rate = current_borrow_rate.try_div(SLOTS_PER_YEAR)?;
        let compounded_interest_rate = Rate::one()
            .try_add(slot_interest_rate)?
            .try_pow(slots_elapsed)?;
        self.cumulative_borrow_rate_wads = self
            .cumulative_borrow_rate_wads
            .try_mul(compounded_interest_rate)?;
        Ok(compounded_interest_rate)
    }
/// Compound current borrow rate over elapsed slots
Compound current borrow rate over elapsed slots
Compound current borrow rate over elapsed slots
fn compound_interest(
        &mut self,
        current_borrow_rate: Rate,
        slots_elapsed: u64,
    ) -> Result<Rate, ProgramError> {
        let slot_interest_rate: Rate = current_borrow_rate.try_div(SLOTS_PER_YEAR)?;
        let compounded_interest_rate = Rate::one()
            .try_add(slot_interest_rate)?
            .try_pow(slots_elapsed)?;
        self.cumulative_borrow_rate_wads = self
            .cumulative_borrow_rate_wads
            .try_mul(compounded_interest_rate)?;
        Ok(compounded_interest_rate)
    }
fn compound_interest ( & mut self , current_borrow_rate : Rate , slots_elapsed : u64 , ) -> Result < Rate , ProgramError > { let slot_interest_rate : Rate = current_borrow_rate . try_div ( SLOTS_PER_YEAR ) ? ; let compounded_interest_rate = Rate :: one ( ) . try_add ( slot_interest_rate ) ? . try_pow ( slots_elapsed ) ? ; self . cumulative_borrow_rate_wads = self . cumulative_borrow_rate_wads . try_mul ( compounded_interest_rate ) ? ; Ok ( compounded_interest_rate ) }
Compound current borrow rate over elapsed slots
Compound current borrow rate over elapsed slots
&mut self
current_borrow_rate
Rate
slots_elapsed
u64