Smart contract that flash borrows from Aave and uses the flash liquidity for arbitrage between Sushiswap and UniswapV2 within the same transaction
Solidity
312
12 commits
updated May 17, 2021
This is a simple working example of a flash arbitrage smart contract, whereby within a single transaction it:
Before you start playing with this I highly recommend to have a read of the Aave Flash Loan mechanism and get an indepth conceptual understanding, as it's equally important as understanding the code.
Since Sushiswap is a fork of UniswapV2, I also suggest familiarising yourself with the Uniswap V2 guide on trading via smart contracts, particularly if you plan on adding more swaps to your arbitrage strategy.
The contract can be plonked directly onto Remix, using solidity compiler 0.6.12, and Metamask using Injected Web3.
On deployment, set the following parameters:
On execution, set the following parameters:
If all goes well, a successful execution of this contract looks like this (Ropsten testnet).
If you found this useful and would like to send me some gas money:
0xef03254aBC88C81Cb822b5E4DCDf22D55645bCe6
Thanks, @fifikobayashi
12 commits
Solidity
100.0%
Smart contract that flash borrows from Aave and uses the flash liquidity for arbitrage between Sushiswap and UniswapV2 within the same transaction
Solidity
312
12 commits
updated May 17, 2021
This is a simple working example of a flash arbitrage smart contract, whereby within a single transaction it:
Before you start playing with this I highly recommend to have a read of the Aave Flash Loan mechanism and get an indepth conceptual understanding, as it's equally important as understanding the code.
Since Sushiswap is a fork of UniswapV2, I also suggest familiarising yourself with the Uniswap V2 guide on trading via smart contracts, particularly if you plan on adding more swaps to your arbitrage strategy.
The contract can be plonked directly onto Remix, using solidity compiler 0.6.12, and Metamask using Injected Web3.
On deployment, set the following parameters:
On execution, set the following parameters:
If all goes well, a successful execution of this contract looks like this (Ropsten testnet).
If you found this useful and would like to send me some gas money:
0xef03254aBC88C81Cb822b5E4DCDf22D55645bCe6
Thanks, @fifikobayashi
12 commits
Solidity
100.0%