Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuichiroaoki/1inch-trading-bot
Trading bot on polygon using 1inch api
https://github.com/yuichiroaoki/1inch-trading-bot
1inch bot ethereum polygon trading
Last synced: 3 months ago
JSON representation
Trading bot on polygon using 1inch api
- Host: GitHub
- URL: https://github.com/yuichiroaoki/1inch-trading-bot
- Owner: yuichiroaoki
- License: mit
- Created: 2021-10-09T02:25:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T06:10:11.000Z (about 3 years ago)
- Last Synced: 2023-03-03T22:44:05.470Z (almost 2 years ago)
- Topics: 1inch, bot, ethereum, polygon, trading
- Language: TypeScript
- Homepage: https://yuichiroaoki.medium.com/building-a-trading-bot-with-1inch-api-on-polygon-9747aedf2f83
- Size: 815 KB
- Stars: 19
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple 1inch Trading Bot
## Trading Strategy
![image](https://user-images.githubusercontent.com/45054071/136684673-0bda3848-459a-47a3-8bff-92e65f1c3144.png)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%.
![image](https://user-images.githubusercontent.com/45054071/136684280-3c249357-cfd3-402d-b92c-3d61c2ba378d.png)
## Installation and Setup
### 1. Install [Node.js](https://nodejs.org/en/) & [yarn](https://classic.yarnpkg.com/en/docs/install/#windows-stable), if you haven't already.
### 2. Clone This Repo
Run the following command.
```console
git clone https://github.com/yuichiroaoki/1inch-trading-bot.git
```## Quickstart
Right now this repo only works with hardhat mainnet fork.
### 1. Setup Environment Variables
You'll need an ALCHEMY_POLYGON_RPC_URL environment variable. You can get one from [Alchemy website](https://alchemy.com/?r=33851811-6ecf-40c3-a36d-d0452dda8634) 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=
PRIVATE_KEY=
```### 2. Install Dependencies
Run the following command.
```console
yarn install
```### 3. Set Config (Optional)
Change the config in src/config.ts if you want.
### 4. Run Bot
```
yarn start
```You can also deploy with docker.