Giter Site home page Giter Site logo

thibaultyou / grid-bot Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 9.0 53 KB

A dynamic grid bot implementation for FTX cryptocurrency exchange using limit orders

License: MIT License

Dockerfile 0.79% Python 99.21%
ftx grid bot trading limit order ccxt cryptocurrency

grid-bot's Introduction

FTX grid bot

A dynamic grid bot implementation using limit orders to trade futures on FTX cryptocurrency exchange.

⚠️⚠️⚠️ This project is under construction, expect to encounter problems or strange behavior.

Trading is very risky, neither the developer nor the contributors can be held responsible for your actions.

Beware of the fees associated with trading on FTX, a small grid size or currencies with high slippage could kill your account balance quickly.

Please understand your risk before running this tool ⚠️⚠️⚠️

Install

Refresh apt definitions and update:

sudo apt update -y
sudo apt upgrade -y

You may need to reboot your instance after updating

Clone repo:

git clone [email protected]:thibaultyou/grid-bot.git

Install Docker:

sudo apt install docker.io -y
sudo apt install docker-compose -y

Usage

Create .env.btc env file for BTC (as example):

cd grid-bot
cp .env.sample .env.btc

Edit .env.btc file:

nano .env.btc

Adjust settings to your needs like the following example, add 4 different API keys with secrets to allow credentials rotations (all the variables are needed):

MARKET=BTC-PERP
BASE_ORDER_SIZE=10
BUYING_RATIO=1
SELLING_RATIO=1.1
GRID_SIZE=5
GRID_STEP=1
FTX_SUBACCOUNT=BTC
FTX_KEY_1=kEy_1
FTX_SECRET_1=SeCrEt_1
FTX_KEY_2=kEy_2
FTX_SECRET_2=SeCrEt_2
FTX_KEY_3=kEy_3
FTX_SECRET_3=SeCrEt_3
FTX_KEY_4=kEy_4
FTX_SECRET_4=SeCrEt_4

Edit docker-compose.yml file:

nano docker-compose.yml

Adjust to your needs, for example two grids here with BTC and XRP (don't forget to create corresponding env files):

version: '3'
services:
  btc:
    build: .
    restart: unless-stopped
    volumes:
      - ./logs:/code/logs
      - ./.env.btc:/code/.env # you need this to bind your env file to this grid instance

  # you can add as many instance you want as long you have different API keys between each and enough RAM on your server
  xrp:
    build: .
    restart: unless-stopped
    volumes:
      - ./logs:/code/logs
      - ./.env.xrp:/code/.env

Right now only futures are supported by this tool

Run:

sudo docker-compose up --build -d

If you have issues updating your config you can recreate the instances:

sudo docker-compose stop
sudo docker-compose rm
sudo docker-compose up --build -d

Monitor:

tail -f ./logs/<MARKET>.log

grid-bot's People

Contributors

thibaultyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grid-bot's Issues

It cannot be executed except btc-perp

1、The docker compose file is as follows:
image
2、.evn. eth files are as follows:
image
3、eth log files are as follows:
image
4、If I trade btc-perp is OK, I can't do anything except BTC's trading right

Fix grid step recalculation

If the grid is reset because no more buy / sell orders is present, use current step value instead of a new calculated one

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.