mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Fixed minor bug
This commit is contained in:
parent
b5b756d8c1
commit
0911656f59
|
@ -251,10 +251,11 @@ contract AaveHelpers is CompoundResolver {
|
||||||
AaveProviderInterface AaveProvider = AaveProviderInterface(getAaveProviderAddress());
|
AaveProviderInterface AaveProvider = AaveProviderInterface(getAaveProviderAddress());
|
||||||
AaveInterface aave = AaveInterface(AaveProvider.getLendingPool());
|
AaveInterface aave = AaveInterface(AaveProvider.getLendingPool());
|
||||||
AaveTokenData memory aaveToken = collateralData(aave, token);
|
AaveTokenData memory aaveToken = collateralData(aave, token);
|
||||||
|
AaveTokenData memory aaveEthToken = collateralData(aave, getEthAddress());
|
||||||
if (!aaveToken.borrowEnabled) return 0;
|
if (!aaveToken.borrowEnabled) return 0;
|
||||||
(uint tokenPrice, uint ethPrice) = getAavePrices(AaveProvider, token);
|
(uint tokenPrice, uint ethPrice) = getAavePrices(AaveProvider, token);
|
||||||
uint ethColl = wmul(ethAmount, ethPrice);
|
uint ethColl = wmul(ethAmount, ethPrice);
|
||||||
uint cf = sub(aaveToken.ltv, 1) * (10 ** 16);
|
uint cf = sub(aaveEthToken.ltv, 1) * (10 ** 16);
|
||||||
ethColl = wmul(ethColl, cf);
|
ethColl = wmul(ethColl, cf);
|
||||||
uint debtCanBorrow = wdiv(ethColl, tokenPrice);
|
uint debtCanBorrow = wdiv(ethColl, tokenPrice);
|
||||||
return debtCanBorrow;
|
return debtCanBorrow;
|
||||||
|
@ -356,6 +357,6 @@ contract DydxFlashloanResolver is DydxFlashloanHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract InstaDydxFlashloanResolver is DydxFlashloanResolver {
|
contract InstaPoolResolver is DydxFlashloanResolver {
|
||||||
string public constant name = "instapool-Resolver-v3";
|
string public constant name = "instapool-Resolver-v3";
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user