Skip to content

Commit

Permalink
Make more precise comment on _updateIndexes()
Browse files Browse the repository at this point in the history
  • Loading branch information
eboadom committed Nov 4, 2022
1 parent 9a68e2a commit efdaf63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/protocol/libraries/logic/ReserveLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ library ReserveLogic {
reserve.liquidityIndex = reserveCache.nextLiquidityIndex.toUint128();
}

// Variable borrow side only gets updated if there is any accrual of variable debt
// Variable borrow index only gets updated if there is any variable debt.
// We assume that in that case the variable borrow rate is positive, to avoid
// over-optimization
if (reserveCache.currScaledVariableDebt != 0) {
uint256 cumulatedVariableBorrowInterest = MathUtils.calculateCompoundedInterest(
reserveCache.currVariableBorrowRate,
Expand Down

0 comments on commit efdaf63

Please sign in to comment.