ahrenstein / docker-sideways-bot

A bot that trades cryptocurrency sideways using a percentage difference from current price.

Home Page:https://hub.docker.com/r/ahrenstein/sideways-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crypto Sideways Bot

This bot is designed to buy and sell cryptocurrency on Coinbase Pro using a USD prefunded portfolio in a sideways fashion.

USE AT YOUR OWN RISK

I run this bot full time against my own personal Coinbase account, however I make no warranties that the bot will function. It could crash and miss some price movement, or it could detect and buy at the wrong prices. So far it has done well for me, but your mileage may vary.
As with any open source code: USE THIS BOT AT YOUR OWN RISK!

Limitations

The logic behind price setting is very basic. This code was written assuming a dedicated Coinbase Pro profile that will buy/sell all of the currency pair only with this bot. Manually touching things may corrupt the bot's plan!

Sideways Movement Method

When the bot detects at least $100 in USD in the portfolio it will set a limit order to buy the currency of choice at the specified percentage less than the current price. It will also store the current price plus the specified percentage in a file in the config folder of the container for selling. When the bot detects any amount of the currency of choice in the portfolio it will read the sell price file and set a limit order to sell at that price.

Running The Bot

To run the bot you will need Docker and docker-compose installed on your computer.

docker-compose up -d

Config File

You will need the following:

  1. Coinbase Pro credentials tied to the portfolio you want to run the bot against
  2. Sideways logic parameters:
    1. The cryptocurrency you want to transact in. (It must support being paired against USD in Coinbase Pro)
    2. The price movement percentage as an integer

The following sections are optional.

  1. Time variables in the bot config
    1. Check cycle frequency in minutes (Default: 15)
  2. AWS credentials:
    1. AWS API keys
    2. SNS topic ARN (us-east-1 only for now)
  3. Optionally you can override the bot name

These settings should be in a configuration file named config.json and placed in ./config. Additionally, you can override the volume mount to a new path if you prefer. The file should look like this:

{
  "bot": {
    "currency": "ETH",
    "movement_percentage": 2.5,
     "cycle_time_minutes": 5,
     "name": "Sideways-Bot"
  },
   "coinbase": {
      "api_key": "YOUR_API_KEY",
      "api_secret": "YOUR_API_SECRET",
      "passphrase": "YOUR_API_PASSPHRASE"
   },
   "aws": {
    "access_key": "YOUR_API_KEY",
    "secret_access_key": "YOUR_API_SECRET",
    "sns_arn": "arn:aws:sns:us-east-1:012345678901:dip_alerts"
  }
}

Running outside of Docker

You can run the bot outside of Docker pretty easily.

python SourceCode/sideways_bot.py -c /path/to/config.json

Logs

The bot will log activity to stdout, so you can review it with docker logs

Donations

I have configured GitHub Sponsors, if you would like to support my work.

About

A bot that trades cryptocurrency sideways using a percentage difference from current price.

https://hub.docker.com/r/ahrenstein/sideways-bot

License:MIT License


Languages

Language:Python 96.9%Language:Dockerfile 3.1%