AAVE V2 FlashLoan contract + UniswapV2 Bot which searches for profitable oppurtunities, and executes when called upon.
- Solidity (FlashLoan contract itself)
- NodeJS (Truffle scripts)
- Truffle (Development Framework)
- Ganache-cli (For Local Blockchain)
- Infura RPC (For forking the Ethereum mainnet)
- Install NodeJS, I recommend using node version 16.5.0 to avoid any potential dependency issues
- Install Truffle, In your terminal, you can check to see if you have truffle by running
truffle --version
. To install truffle runnpm i -g truffle
. - Install Ganache-cli. To see if you have ganache-cli installed, in your command line type
ganache-cli --version
. To install, in your command line typenpm install ganache-cli --global
$ git clone https://github.com/benreichman/AAVE-V2-FlashLoan-Uniswap-V2-Arbitrage.git
$ cd AAVE-V2-FlashLoan-Uniswap-V2-Arbitrage/
$ npm install
To start a local ganche fork on your machine, In your terminal run:
ganache-cli -f https://mainnet.infura.io/v3/<YOUR_INFURA_KEY_GOES_HERE> -m <mnemonic_here> -p 7545
Replace Your-App-Key with your Infura Project ID located in the settings of your project. Replace Your-Mnemonic-Phrase with your own mnemonic phrase. If you don't have a mnemonic phrase to include, you can omit it.
In a new terminal, type and run:
truffle migrate --network development
Make sure to copy the address of the deployed contract, as you will need it to successfully run the script.
$ truffle exec ./scripts/FlashLoanBotMainnet.js