Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Add getLiqRatio and getLtv to ILendingProvider #438

Open pedrovalido opened 1 year ago

pedrovalido commented 1 year ago

Add getLiqRatio and getLtv to ILendingProvider. After this, add a check in the BorrowingVault constructor to ensure the passed maxLtv and liqRatio are not violating this for any provider

 function _checkMaxLtvAndLiqRatio(uint256 maxLtv_, uint256 liqRatio, ILendingProvider[] memory providers) internal pure {
     for(uint256 i; i<providers.length; i++) {
         if(providers[i].getLtv() < maxLtv || providers[i].getLiqRatio() < liqRatio)
             revert BaseVault__setter_invalidInput();
     }
 }