From 0911656f59993814f431e842b98b8a8cce8fca92 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Wed, 23 Sep 2020 21:47:22 +0530 Subject: [PATCH] Fixed minor bug --- contracts/protocols/instapool.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/protocols/instapool.sol b/contracts/protocols/instapool.sol index b9c9ce4..0f96010 100644 --- a/contracts/protocols/instapool.sol +++ b/contracts/protocols/instapool.sol @@ -251,10 +251,11 @@ contract AaveHelpers is CompoundResolver { AaveProviderInterface AaveProvider = AaveProviderInterface(getAaveProviderAddress()); AaveInterface aave = AaveInterface(AaveProvider.getLendingPool()); AaveTokenData memory aaveToken = collateralData(aave, token); + AaveTokenData memory aaveEthToken = collateralData(aave, getEthAddress()); if (!aaveToken.borrowEnabled) return 0; (uint tokenPrice, uint ethPrice) = getAavePrices(AaveProvider, token); 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); uint debtCanBorrow = wdiv(ethColl, tokenPrice); 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"; } \ No newline at end of file