Bot to check eth prices against other ERC-20 tokens.
Connects to the Uniswap Factory smart contract on Ethereum mainnet via web3.js.
-
Clone project into empty directory:
$ git clone https://github.com/yan-man/eth-bot.git
-
cd
into directory -
Get mainnet Infura RPC URL from: https://infura.io/
-
Copy
example.json
file to createdefault.json
file in rootconfig
directory. UpdateRPC_URL
field.interval
field units are in seconds.
{
"RPC_URL": "https://mainnet.infura.io/v3/______________",
"PORT": 3000
"INTERVAL": 5
}
- Install dependencies:
$ npm install
- Run project:
$ npm run dev
- In console, you should see price comparisons displayed in a table, updating in regular intervals defined by
INTERVAL
field indefault.json
config. NOTE: some prices seem off, probably due to Uniswap V1 implementation.
CRON jobs are set up to poll for data every 1 second. This can be configured in the ./index.js
file - pollingInterval
variable.
The selection of tokens that are included are in ./services/tokens.js
file. Update relevant information to query for other token data.
- Add more ERC-20 tokens to compare
- Add more DEXs to find price spread differences and identify arbitrage opportunities
- Update to UniswapV3 implementation
- Include slippage adjustment
- Perform swaps based on price spread differences
- Add unit tests
- maybe ethers.js instead; easier to work with
node v17.1.0
npm v8.1.3
Yan Man