Flashloan Bot Arbitrage Finder
-
Rename
.env.example
file to.env
inside the bot directory -
Config
.env
file.Here, you need four things.
- Insert your INFURA Project ID. You can create a infura Project ID here.
- Insert your MetaMask (Kovan Testnet) 32byte wallet private key.
- Insert your cotract address(mainnet or kovan)
- Insert UniswapV3 Factory address.
-
Install node modules. Open terminal window and run:
npm install
-
Run bot
- Trade for origin
- trader bot
yarn main-trader dai weth
- finder bot
yarn main-finder * weth yarn main-finder weth usdt * yarn main-finder weth * * yarn main-finder * weth *
- trader bot
- Trade for 0x Exchage API
- trader bot bot
yarn zero-trader dai weth
- finder bot
yarn zero-finder * weth yarn zero-finder weth usdt * yarn zero-finder weth * * yarn zero-finder * weth *
- trader bot bot
- Trade for 1Inch Exchage API
- trader bot bot
yarn one-trader dai weth
- finder bot
yarn one-finder * weth yarn one-finder weth usdt * yarn one-finder weth * * yarn one-finder * weth *
- trader bot bot
- Trade for Dodo Exchage API
- trader bot bot
yarn dodo-trader dai weth
- finder bot
yarn dodo-finder * weth yarn dodo-finder weth usdt * yarn dodo-finder weth * * yarn dodo-finder * weth *
- trader bot bot
- Go to /config and open token.json
- Add the token symbol and its blockchain network token address accordingly
- Doing a "short scan" of the "short" lists
ts-node finder2pairshort
- Added 19th June, 22:20.
-
(/config/dexs.json) Add the DEX name, together with it's Proxy/Router/Quoter/Factory contract address(es) found in the DEX documentation to the /config/dexs.json file.
-
(/abi/NEWDEXNAME.json) Get the ABI code from the individual DEXs GitHub repo or contract address on etherscan.io. And add it to a /abi/DEXNAME.json file. Depending on the DEX it will be the Router/Factory/Exchange/Quoter json files.
-
(/lib/contracts.ts) Create contract instance(constant) with address and ABI for specific DEX in lib/contracts.ts file. If contract address is depended on token pair like Mooniswap, create function to get contract instance for specific token pair.
-
(/lib/NEWDEXNAME) Add the "getCalldata.ts" file under /lib/DEXNAME folder you create if needed. Add functions(get calldatas for price and swap) in getCalldata.ts file.
-
(/lib/contracts.ts): export a new, shorter name as a constant of the DEX in /lib/contracts, by making the constant a combination of the Router/Quoter/Factory/AbiItem, and anything else that is required.
-
(mainnet/origin/common.ts): add the new short name of the router/quoter/dex info in the "import { " section.
Import the "getPriceOnDEXNAME" in the same file as step 6 (around line 25)
As well as adding a new constant export of the DEXs name array to display on screen(around line 35).
Also make sure to add the new DEX with a 2-3 char name as a constant in the "getAllQuotes" section (around line 60).
Modify and add the relevant information/constants in the "const result: Multicall" section. "getAllQuotes" function returns array of quotes and contract instances(router).
- (mainnet/origin/trader):
import "getSwapOnDEXNAME" function for the new dex in the "header".
add the dex to the "const runBot" section as an 'else if' statement by adding it below the rest as a new ID (in order).