trustline-inc / probity

A transparent asset-based lending protocol implemented for the EVM.
https://docs.trustline.co
Other
3 stars 1 forks source link

Precision loss in collectInterest is preventing from closing the equity position fully. #373

Closed shine2lay closed 2 years ago

shine2lay commented 2 years ago
         // @todo evaluate how loss of precision can impact here
        vaults[assetId][msg.sender].normEquity -= interestAmount / equityAccumulator;

This line can create a situation where normEquity * equityAccumulator != initialEquity. This is an issue because user will never be able to fully close their equity position.