Coder Social home page Coder Social logo

fdoperezi / 1inch-trading-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuichiroaoki/1inch-trading-bot

0.0 2.0 0.0 835 KB

Trading bot on polygon using 1inch api

Home Page: https://yuichiroaoki.medium.com/building-a-trading-bot-with-1inch-api-on-polygon-9747aedf2f83

License: MIT License

TypeScript 96.11% Shell 1.47% Dockerfile 2.42%

1inch-trading-bot's Introduction

Simple 1inch Trading Bot

Trading Strategy

image

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

Installation and Setup

1. Install Node.js & yarn, if you haven't already.

2. Clone This Repo

Run the following command.

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 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>

2. Install Dependencies

Run the following command.

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.

1inch-trading-bot's People

Contributors

yuichiroaoki avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.