mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Update
This commit is contained in:
parent
be564539a3
commit
051b9029f7
|
@ -470,7 +470,7 @@ contract Helpers is DSMath {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMaxBorrow(Protocol target, address token, uint rateMode) internal returns (uint amt) {
|
function getMaxBorrow(Protocol target, address token, CTokenInterface ctoken, uint rateMode) internal returns (uint amt) {
|
||||||
AaveV1Interface aaveV1 = AaveV1Interface(getAaveProvider().getLendingPool());
|
AaveV1Interface aaveV1 = AaveV1Interface(getAaveProvider().getLendingPool());
|
||||||
AaveV2DataProviderInterface aaveData = getAaveV2DataProvider();
|
AaveV2DataProviderInterface aaveData = getAaveV2DataProvider();
|
||||||
|
|
||||||
|
@ -480,8 +480,7 @@ contract Helpers is DSMath {
|
||||||
} else if (target == Protocol.AaveV2) {
|
} else if (target == Protocol.AaveV2) {
|
||||||
amt = getPaybackBalanceV2(aaveData, token, rateMode);
|
amt = getPaybackBalanceV2(aaveData, token, rateMode);
|
||||||
} else if (target == Protocol.Compound) {
|
} else if (target == Protocol.Compound) {
|
||||||
address cToken = InstaMapping(getMappingAddr()).cTokenMapping(token);
|
amt = ctoken.borrowBalanceCurrent(address(this));
|
||||||
amt = CTokenInterface(cToken).borrowBalanceCurrent(address(this));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +555,7 @@ contract CompoundHelpers is Helpers {
|
||||||
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
||||||
|
|
||||||
if (amt == uint(-1)) {
|
if (amt == uint(-1)) {
|
||||||
amt = getMaxBorrow(target, address(token), rateMode);
|
amt = getMaxBorrow(target, address(token), ctoken, rateMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
||||||
|
@ -619,7 +618,7 @@ contract CompoundHelpers is Helpers {
|
||||||
uint initalBal = isEth ? address(this).balance : token.balanceOf(address(this));
|
uint initalBal = isEth ? address(this).balance : token.balanceOf(address(this));
|
||||||
require(ctoken.redeem(ctoken.balanceOf(address(this))) == 0, "withdraw-failed");
|
require(ctoken.redeem(ctoken.balanceOf(address(this))) == 0, "withdraw-failed");
|
||||||
uint finalBal = isEth ? address(this).balance : token.balanceOf(address(this));
|
uint finalBal = isEth ? address(this).balance : token.balanceOf(address(this));
|
||||||
amt = finalBal - initalBal;
|
amt = sub(finalBal, initalBal);
|
||||||
} else {
|
} else {
|
||||||
require(ctoken.redeemUnderlying(amt) == 0, "withdraw-failed");
|
require(ctoken.redeemUnderlying(amt) == 0, "withdraw-failed");
|
||||||
}
|
}
|
||||||
|
@ -675,6 +674,7 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
uint fee;
|
uint fee;
|
||||||
Protocol target;
|
Protocol target;
|
||||||
TokenInterface[] tokens;
|
TokenInterface[] tokens;
|
||||||
|
CTokenInterface[] ctokens;
|
||||||
uint[] amts;
|
uint[] amts;
|
||||||
uint[] borrowRateModes;
|
uint[] borrowRateModes;
|
||||||
uint[] paybackRateModes;
|
uint[] paybackRateModes;
|
||||||
|
@ -685,6 +685,7 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
uint fee,
|
uint fee,
|
||||||
Protocol target,
|
Protocol target,
|
||||||
TokenInterface token,
|
TokenInterface token,
|
||||||
|
CTokenInterface ctoken,
|
||||||
uint amt,
|
uint amt,
|
||||||
uint borrowRateMode,
|
uint borrowRateMode,
|
||||||
uint paybackRateMode
|
uint paybackRateMode
|
||||||
|
@ -694,7 +695,7 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
||||||
|
|
||||||
if (amt == uint(-1)) {
|
if (amt == uint(-1)) {
|
||||||
amt = getMaxBorrow(target, address(token), paybackRateMode);
|
amt = getMaxBorrow(target, address(token), ctoken, paybackRateMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
||||||
|
@ -715,6 +716,7 @@ contract AaveV1Helpers is CompoundHelpers {
|
||||||
data.fee,
|
data.fee,
|
||||||
data.target,
|
data.target,
|
||||||
data.tokens[i],
|
data.tokens[i],
|
||||||
|
data.ctokens[i],
|
||||||
data.amts[i],
|
data.amts[i],
|
||||||
data.borrowRateModes[i],
|
data.borrowRateModes[i],
|
||||||
data.paybackRateModes[i]
|
data.paybackRateModes[i]
|
||||||
|
@ -847,15 +849,34 @@ contract AaveV2Helpers is AaveV1Helpers {
|
||||||
uint fee;
|
uint fee;
|
||||||
Protocol target;
|
Protocol target;
|
||||||
TokenInterface[] tokens;
|
TokenInterface[] tokens;
|
||||||
|
CTokenInterface[] ctokens;
|
||||||
uint[] amts;
|
uint[] amts;
|
||||||
uint[] rateModes;
|
uint[] rateModes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct AaveV2PaybackData {
|
||||||
|
AaveV2Interface aave;
|
||||||
|
AaveV2DataProviderInterface aaveData;
|
||||||
|
uint length;
|
||||||
|
TokenInterface[] tokens;
|
||||||
|
uint[] amts;
|
||||||
|
uint[] rateModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AaveV2WithdrawData {
|
||||||
|
AaveV2Interface aave;
|
||||||
|
AaveV2DataProviderInterface aaveData;
|
||||||
|
uint length;
|
||||||
|
TokenInterface[] tokens;
|
||||||
|
uint[] amts;
|
||||||
|
}
|
||||||
|
|
||||||
function _aaveV2BorrowOne(
|
function _aaveV2BorrowOne(
|
||||||
AaveV2Interface aave,
|
AaveV2Interface aave,
|
||||||
uint fee,
|
uint fee,
|
||||||
Protocol target,
|
Protocol target,
|
||||||
TokenInterface token,
|
TokenInterface token,
|
||||||
|
CTokenInterface ctoken,
|
||||||
uint amt,
|
uint amt,
|
||||||
uint rateMode
|
uint rateMode
|
||||||
) internal returns (uint) {
|
) internal returns (uint) {
|
||||||
|
@ -863,7 +884,7 @@ contract AaveV2Helpers is AaveV1Helpers {
|
||||||
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
|
||||||
|
|
||||||
if (amt == uint(-1)) {
|
if (amt == uint(-1)) {
|
||||||
amt = getMaxBorrow(target, _token, rateMode);
|
amt = getMaxBorrow(target, _token, ctoken, rateMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
|
||||||
|
@ -888,6 +909,7 @@ contract AaveV2Helpers is AaveV1Helpers {
|
||||||
data.fee,
|
data.fee,
|
||||||
data.target,
|
data.target,
|
||||||
data.tokens[i],
|
data.tokens[i],
|
||||||
|
data.ctokens[i],
|
||||||
data.amts[i],
|
data.amts[i],
|
||||||
data.rateModes[i]
|
data.rateModes[i]
|
||||||
);
|
);
|
||||||
|
@ -953,15 +975,16 @@ contract AaveV2Helpers is AaveV1Helpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _aaveV2Withdraw(
|
function _aaveV2Withdraw(
|
||||||
AaveV2Interface aave,
|
AaveV2WithdrawData memory data
|
||||||
AaveV2DataProviderInterface aaveData,
|
|
||||||
uint length,
|
|
||||||
TokenInterface[] memory tokens,
|
|
||||||
uint[] memory amts
|
|
||||||
) internal returns (uint[] memory) {
|
) internal returns (uint[] memory) {
|
||||||
uint[] memory finalAmts = new uint[](length);
|
uint[] memory finalAmts = new uint[](data.length);
|
||||||
for (uint i = 0; i < length; i++) {
|
for (uint i = 0; i < data.length; i++) {
|
||||||
finalAmts[i] = _aaveV2WithdrawOne(aave, aaveData, tokens[i], amts[i]);
|
finalAmts[i] = _aaveV2WithdrawOne(
|
||||||
|
data.aave,
|
||||||
|
data.aaveData,
|
||||||
|
data.tokens[i],
|
||||||
|
data.amts[i]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return finalAmts;
|
return finalAmts;
|
||||||
}
|
}
|
||||||
|
@ -987,15 +1010,16 @@ contract AaveV2Helpers is AaveV1Helpers {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _aaveV2Payback(
|
function _aaveV2Payback(
|
||||||
AaveV2Interface aave,
|
AaveV2PaybackData memory data
|
||||||
AaveV2DataProviderInterface aaveData,
|
|
||||||
uint length,
|
|
||||||
TokenInterface[] memory tokens,
|
|
||||||
uint[] memory amts,
|
|
||||||
uint[] memory rateModes
|
|
||||||
) internal {
|
) internal {
|
||||||
for (uint i = 0; i < length; i++) {
|
for (uint i = 0; i < data.length; i++) {
|
||||||
_aaveV2PaybackOne(aave, aaveData, tokens[i], amts[i], rateModes[i]);
|
_aaveV2PaybackOne(
|
||||||
|
data.aave,
|
||||||
|
data.aaveData,
|
||||||
|
data.tokens[i],
|
||||||
|
data.amts[i],
|
||||||
|
data.rateModes[i]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1196,6 +1220,7 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
uint[] memory paybackAmts;
|
uint[] memory paybackAmts;
|
||||||
|
|
||||||
TokenInterface[] memory tokens = getTokenInterfaces(length, data.tokens);
|
TokenInterface[] memory tokens = getTokenInterfaces(length, data.tokens);
|
||||||
|
CTokenInterface[] memory _ctokens = getCtokenInterfaces(length, data.tokens);
|
||||||
|
|
||||||
if (data.source == Protocol.Aave && data.target == Protocol.AaveV2) {
|
if (data.source == Protocol.Aave && data.target == Protocol.AaveV2) {
|
||||||
AaveV2BorrowData memory _aaveV2BorrowData;
|
AaveV2BorrowData memory _aaveV2BorrowData;
|
||||||
|
@ -1205,6 +1230,7 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
_aaveV2BorrowData.fee = data.debtFee;
|
_aaveV2BorrowData.fee = data.debtFee;
|
||||||
_aaveV2BorrowData.target = data.source;
|
_aaveV2BorrowData.target = data.source;
|
||||||
_aaveV2BorrowData.tokens = tokens;
|
_aaveV2BorrowData.tokens = tokens;
|
||||||
|
_aaveV2BorrowData.ctokens = _ctokens;
|
||||||
_aaveV2BorrowData.amts = data.borrowAmts;
|
_aaveV2BorrowData.amts = data.borrowAmts;
|
||||||
_aaveV2BorrowData.rateModes = data.borrowRateModes;
|
_aaveV2BorrowData.rateModes = data.borrowRateModes;
|
||||||
|
|
||||||
|
@ -1213,7 +1239,6 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
depositAmts = _aaveV1Withdraw(aaveV1, aaveCore, length, tokens, data.withdrawAmts);
|
depositAmts = _aaveV1Withdraw(aaveV1, aaveCore, length, tokens, data.withdrawAmts);
|
||||||
_aaveV2Deposit(aaveV2, aaveData, length, data.collateralFee, tokens, depositAmts);
|
_aaveV2Deposit(aaveV2, aaveData, length, data.collateralFee, tokens, depositAmts);
|
||||||
} else if (data.source == Protocol.Aave && data.target == Protocol.Compound) {
|
} else if (data.source == Protocol.Aave && data.target == Protocol.Compound) {
|
||||||
CTokenInterface[] memory _ctokens = getCtokenInterfaces(length, data.tokens);
|
|
||||||
_compEnterMarkets(length, _ctokens);
|
_compEnterMarkets(length, _ctokens);
|
||||||
|
|
||||||
CompoundBorrowData memory _compoundBorrowData;
|
CompoundBorrowData memory _compoundBorrowData;
|
||||||
|
@ -1234,22 +1259,43 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
} else if (data.source == Protocol.AaveV2 && data.target == Protocol.Aave) {
|
} else if (data.source == Protocol.AaveV2 && data.target == Protocol.Aave) {
|
||||||
|
|
||||||
AaveV1BorrowData memory _aaveV1BorrowData;
|
AaveV1BorrowData memory _aaveV1BorrowData;
|
||||||
|
AaveV2PaybackData memory _aaveV2PaybackData;
|
||||||
|
AaveV2WithdrawData memory _aaveV2WithdrawData;
|
||||||
|
|
||||||
|
{
|
||||||
_aaveV1BorrowData.aave = aaveV1;
|
_aaveV1BorrowData.aave = aaveV1;
|
||||||
_aaveV1BorrowData.length = length;
|
_aaveV1BorrowData.length = length;
|
||||||
_aaveV1BorrowData.fee = data.debtFee;
|
_aaveV1BorrowData.fee = data.debtFee;
|
||||||
_aaveV1BorrowData.target = data.source;
|
_aaveV1BorrowData.target = data.source;
|
||||||
_aaveV1BorrowData.tokens = tokens;
|
_aaveV1BorrowData.tokens = tokens;
|
||||||
|
_aaveV1BorrowData.ctokens = _ctokens;
|
||||||
_aaveV1BorrowData.amts = data.borrowAmts;
|
_aaveV1BorrowData.amts = data.borrowAmts;
|
||||||
_aaveV1BorrowData.borrowRateModes = data.borrowRateModes;
|
_aaveV1BorrowData.borrowRateModes = data.borrowRateModes;
|
||||||
_aaveV1BorrowData.paybackRateModes = data.paybackRateModes;
|
_aaveV1BorrowData.paybackRateModes = data.paybackRateModes;
|
||||||
|
|
||||||
paybackAmts = _aaveV1Borrow(_aaveV1BorrowData);
|
paybackAmts = _aaveV1Borrow(_aaveV1BorrowData);
|
||||||
_aaveV2Payback(aaveV2, aaveData, length, tokens, paybackAmts, data.paybackRateModes);
|
}
|
||||||
depositAmts = _aaveV2Withdraw(aaveV2, aaveData, length, tokens, data.withdrawAmts);
|
|
||||||
|
{
|
||||||
|
_aaveV2PaybackData.aave = aaveV2;
|
||||||
|
_aaveV2PaybackData.aaveData = aaveData;
|
||||||
|
_aaveV2PaybackData.length = length;
|
||||||
|
_aaveV2PaybackData.tokens = tokens;
|
||||||
|
_aaveV2PaybackData.amts = paybackAmts;
|
||||||
|
_aaveV2PaybackData.rateModes = data.paybackRateModes;
|
||||||
|
_aaveV2Payback(_aaveV2PaybackData);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
_aaveV2WithdrawData.aave = aaveV2;
|
||||||
|
_aaveV2WithdrawData.aaveData = aaveData;
|
||||||
|
_aaveV2WithdrawData.length = length;
|
||||||
|
_aaveV2WithdrawData.tokens = tokens;
|
||||||
|
_aaveV2WithdrawData.amts = data.withdrawAmts;
|
||||||
|
depositAmts = _aaveV2Withdraw(_aaveV2WithdrawData);
|
||||||
|
}
|
||||||
_aaveV1Deposit(aaveV1, aaveCore, length, data.collateralFee, tokens, depositAmts);
|
_aaveV1Deposit(aaveV1, aaveCore, length, data.collateralFee, tokens, depositAmts);
|
||||||
} else if (data.source == Protocol.AaveV2 && data.target == Protocol.Compound) {
|
} else if (data.source == Protocol.AaveV2 && data.target == Protocol.Compound) {
|
||||||
CTokenInterface[] memory _ctokens = getCtokenInterfaces(length, data.tokens);
|
|
||||||
_compEnterMarkets(length, _ctokens);
|
_compEnterMarkets(length, _ctokens);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1266,8 +1312,27 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
paybackAmts = _compBorrow(_compoundBorrowData);
|
paybackAmts = _compBorrow(_compoundBorrowData);
|
||||||
}
|
}
|
||||||
|
|
||||||
_aaveV2Payback(aaveV2, aaveData, length, tokens, paybackAmts, data.paybackRateModes);
|
AaveV2PaybackData memory _aaveV2PaybackData;
|
||||||
depositAmts = _aaveV2Withdraw(aaveV2, aaveData, length, tokens, data.withdrawAmts);
|
|
||||||
|
_aaveV2PaybackData.aave = aaveV2;
|
||||||
|
_aaveV2PaybackData.aaveData = aaveData;
|
||||||
|
_aaveV2PaybackData.length = length;
|
||||||
|
_aaveV2PaybackData.tokens = tokens;
|
||||||
|
_aaveV2PaybackData.amts = paybackAmts;
|
||||||
|
_aaveV2PaybackData.rateModes = data.paybackRateModes;
|
||||||
|
|
||||||
|
_aaveV2Payback(_aaveV2PaybackData);
|
||||||
|
|
||||||
|
{
|
||||||
|
AaveV2WithdrawData memory _aaveV2WithdrawData;
|
||||||
|
|
||||||
|
_aaveV2WithdrawData.aave = aaveV2;
|
||||||
|
_aaveV2WithdrawData.aaveData = aaveData;
|
||||||
|
_aaveV2WithdrawData.length = length;
|
||||||
|
_aaveV2WithdrawData.tokens = tokens;
|
||||||
|
_aaveV2WithdrawData.amts = data.withdrawAmts;
|
||||||
|
depositAmts = _aaveV2Withdraw(_aaveV2WithdrawData);
|
||||||
|
}
|
||||||
_compDeposit(length, data.collateralFee, _ctokens, tokens, depositAmts);
|
_compDeposit(length, data.collateralFee, _ctokens, tokens, depositAmts);
|
||||||
} else if (data.source == Protocol.Compound && data.target == Protocol.Aave) {
|
} else if (data.source == Protocol.Compound && data.target == Protocol.Aave) {
|
||||||
|
|
||||||
|
@ -1278,20 +1343,18 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
_aaveV1BorrowData.fee = data.debtFee;
|
_aaveV1BorrowData.fee = data.debtFee;
|
||||||
_aaveV1BorrowData.target = data.source;
|
_aaveV1BorrowData.target = data.source;
|
||||||
_aaveV1BorrowData.tokens = tokens;
|
_aaveV1BorrowData.tokens = tokens;
|
||||||
|
_aaveV1BorrowData.ctokens = _ctokens;
|
||||||
_aaveV1BorrowData.amts = data.borrowAmts;
|
_aaveV1BorrowData.amts = data.borrowAmts;
|
||||||
_aaveV1BorrowData.borrowRateModes = data.borrowRateModes;
|
_aaveV1BorrowData.borrowRateModes = data.borrowRateModes;
|
||||||
_aaveV1BorrowData.paybackRateModes = data.paybackRateModes;
|
_aaveV1BorrowData.paybackRateModes = data.paybackRateModes;
|
||||||
|
|
||||||
paybackAmts = _aaveV1Borrow(_aaveV1BorrowData);
|
paybackAmts = _aaveV1Borrow(_aaveV1BorrowData);
|
||||||
{
|
{
|
||||||
CTokenInterface[] memory _ctokens = getCtokenInterfaces(length, data.tokens);
|
|
||||||
_compPayback(length, _ctokens, tokens, paybackAmts);
|
_compPayback(length, _ctokens, tokens, paybackAmts);
|
||||||
depositAmts = _compWithdraw(length, _ctokens, tokens, data.withdrawAmts);
|
depositAmts = _compWithdraw(length, _ctokens, tokens, data.withdrawAmts);
|
||||||
}
|
}
|
||||||
_aaveV1Deposit(aaveV1, aaveCore, length, data.collateralFee, tokens, depositAmts);
|
_aaveV1Deposit(aaveV1, aaveCore, length, data.collateralFee, tokens, depositAmts);
|
||||||
} else if (data.source == Protocol.Compound && data.target == Protocol.AaveV2) {
|
} else if (data.source == Protocol.Compound && data.target == Protocol.AaveV2) {
|
||||||
CTokenInterface[] memory _ctokens = getCtokenInterfaces(length, data.tokens);
|
|
||||||
|
|
||||||
AaveV2BorrowData memory _aaveV2BorrowData;
|
AaveV2BorrowData memory _aaveV2BorrowData;
|
||||||
|
|
||||||
_aaveV2BorrowData.aave = aaveV2;
|
_aaveV2BorrowData.aave = aaveV2;
|
||||||
|
@ -1299,6 +1362,7 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
_aaveV2BorrowData.fee = data.debtFee;
|
_aaveV2BorrowData.fee = data.debtFee;
|
||||||
_aaveV2BorrowData.target = data.source;
|
_aaveV2BorrowData.target = data.source;
|
||||||
_aaveV2BorrowData.tokens = tokens;
|
_aaveV2BorrowData.tokens = tokens;
|
||||||
|
_aaveV2BorrowData.ctokens = _ctokens;
|
||||||
_aaveV2BorrowData.amts = data.borrowAmts;
|
_aaveV2BorrowData.amts = data.borrowAmts;
|
||||||
_aaveV2BorrowData.rateModes = data.borrowRateModes;
|
_aaveV2BorrowData.rateModes = data.borrowRateModes;
|
||||||
|
|
||||||
|
@ -1333,10 +1397,10 @@ contract RefinanceResolver is MakerHelpers {
|
||||||
|
|
||||||
if (data.target == Protocol.Aave) {
|
if (data.target == Protocol.Aave) {
|
||||||
_aaveV1DepositOne(aaveV1, aaveCore, data.collateralFee, token, depositAmt);
|
_aaveV1DepositOne(aaveV1, aaveCore, data.collateralFee, token, depositAmt);
|
||||||
_aaveV1BorrowOne(aaveV1, data.debtFee, Protocol.AaveV2, dai, borrowAmt, data.borrowRateMode, 2);
|
_aaveV1BorrowOne(aaveV1, data.debtFee, Protocol.AaveV2, dai, CTokenInterface(address(0)), borrowAmt, data.borrowRateMode, 2);
|
||||||
} else if (data.target == Protocol.AaveV2) {
|
} else if (data.target == Protocol.AaveV2) {
|
||||||
_aaveV2DepositOne(aaveV2, aaveData, data.collateralFee, token, depositAmt);
|
_aaveV2DepositOne(aaveV2, aaveData, data.collateralFee, token, depositAmt);
|
||||||
_aaveV2BorrowOne(aaveV2, data.debtFee, Protocol.AaveV2, dai, borrowAmt, data.borrowRateMode);
|
_aaveV2BorrowOne(aaveV2, data.debtFee, Protocol.AaveV2, dai, CTokenInterface(address(0)), borrowAmt, data.borrowRateMode);
|
||||||
} else if (data.target == Protocol.Compound) {
|
} else if (data.target == Protocol.Compound) {
|
||||||
address[] memory tokens = new address[](2);
|
address[] memory tokens = new address[](2);
|
||||||
tokens[0] = address(dai);
|
tokens[0] = address(dai);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user