You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Julien
I watch you flashloan course, run the code .
I have some question about this code
`
if(arbInfo.direction == Direction.KyberToUniswap) {
//Buy ETH on Kyber
dai.approve(address(kyber), balanceDai);
(uint expectedRate, ) = kyber.getExpectedRate(
dai,
IERC20(KYBER_ETH_ADDRESS),
balanceDai
);
kyber.swapTokenToEther(dai, balanceDai, expectedRate);
//Sell ETH on Uniswap
address[] memory path = new address[](2);
path[0] = address(weth);
path[1] = address(dai);
uint[] memory minOuts = uniswap.getAmountsOut(address(this).balance, path);
uniswap.swapExactETHForTokens.value(address(this).balance)(
minOuts[1],
path,
address(this),
now
);
}
`
why sell all eth balance at uniswap?
Why not the quantity of eth bought from kybar in the previous step?
The text was updated successfully, but these errors were encountered:
Hi Julien
I watch you flashloan course, run the code .
I have some question about this code
`
if(arbInfo.direction == Direction.KyberToUniswap) {
//Buy ETH on Kyber
dai.approve(address(kyber), balanceDai);
(uint expectedRate, ) = kyber.getExpectedRate(
dai,
IERC20(KYBER_ETH_ADDRESS),
balanceDai
);
kyber.swapTokenToEther(dai, balanceDai, expectedRate);
`
why sell all eth balance at uniswap?
Why not the quantity of eth bought from kybar in the previous step?
The text was updated successfully, but these errors were encountered: