yan-man / eth-bot

bot to check eth prices, perform actions, etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eth Bot Price Checker v0.1.0

Bot to check eth prices against other ERC-20 tokens.

Connects to the Uniswap Factory smart contract on Ethereum mainnet via web3.js.

Quickstart

  1. Clone project into empty directory:

    $ git clone https://github.com/yan-man/eth-bot.git
    
  2. cd into directory

  3. Get mainnet Infura RPC URL from: https://infura.io/

  4. Copy example.json file to create default.json file in root config directory. Update RPC_URL field. interval field units are in seconds.

{
  "RPC_URL": "https://mainnet.infura.io/v3/______________",
  "PORT": 3000
  "INTERVAL": 5
}
  1. Install dependencies:
$ npm install
  1. Run project:
$ npm run dev
  1. In console, you should see price comparisons displayed in a table, updating in regular intervals defined by INTERVAL field in default.json config. NOTE: some prices seem off, probably due to Uniswap V1 implementation.

image info

Details

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.

Further:

  • 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

Requirements

  • node v17.1.0
  • npm v8.1.3

Author

Yan Man

About

bot to check eth prices, perform actions, etc


Languages

Language:JavaScript 100.0%