This bot trades based on the price change from the last buy/sell action. First, it sets the base price to the current, and update it when the bot executes trade. Here is an example of how this would trade when trading Matic and DAI. It sets the threshold as 3%.
Run the following command.
git clone https://github.com/yuichiroaoki/1inch-trading-bot.git
Right now this repo only works with hardhat mainnet fork.
You'll need an ALCHEMY_POLYGON_RPC_URL environment variable. You can get one from Alchemy website for free.
Also you need to add your PRIVATE_KEY environment variable, with a private key from you wallet.
*Note: If using metamask, you'll have to add a 0x to the start of your private key)
Then, you can create a .env file with the following.
ALCHEMY_POLYGON_RPC_URL=<your-own-alchemy-polygon-rpc-url>
PRIVATE_KEY=<your-private_key>
Run the following command.
yarn install
Change the config in src/config.ts if you want.
yarn start
You can also deploy with docker.