This bot is designed to buy and sell cryptocurrency on Coinbase Pro using a USD prefunded portfolio in a sideways fashion.
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!
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!
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.
To run the bot you will need Docker and docker-compose installed on your computer.
docker-compose up -d
You will need the following:
- Coinbase Pro credentials tied to the portfolio you want to run the bot against
- Sideways logic parameters:
- The cryptocurrency you want to transact in. (It must support being paired against USD in Coinbase Pro)
- The price movement percentage as an integer
The following sections are optional.
- Time variables in the bot config
- Check cycle frequency in minutes (Default: 15)
- AWS credentials:
- AWS API keys
- SNS topic ARN (us-east-1 only for now)
- 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"
}
}
You can run the bot outside of Docker pretty easily.
python SourceCode/sideways_bot.py -c /path/to/config.json
The bot will log activity to stdout, so you can review it with docker logs
I have configured GitHub Sponsors, if you would like to support my work.