Submitted by 0xCiphky
The FeeManager contract allows the master address to modify the pool fee. This can be done to a single pool using the setPoolFee function or multiple pools at once using the setPoolFeeBulk function. This fee is used in the the syncPool modifier, specifically the _updatePseudoTotalAmounts function which updates the interest amounts of the borrow and lending pools.
The issue is that the setPoolFee function modifies the pool fee without invoking the syncPool modifier beforehand. Consequently, the next sync operation incorrectly applies the updated pool fee to the period between the previous call and the change in the pool fee. Although the impact of changing the fee for a single pool may be minimal, using the setPoolFeeBulk function to alter fees for multiple pools could have a bigger impact.
Depending on whether the pool fee is increased or decreased, the protocol or its users may end up paying additional fees or receiving reduced fees.
Likelihood: Low. This situation arises solely in instances where there is a change in the pool fee.
Add the following code to update fees accurately before implementing changes:
Context
vm06007 (Wise Lending) commented:
Trust (judge) commented:
Foon256 (Wise Lending) commented:
Trust (judge) commented:
vm06007 (Wise Lending) commented:
Trust (judge) commented:
Wise Lending commented:
