- Notifications
You must be signed in to change notification settings - Fork5
A Python app to automate buying cryptocurrency on the Coinbase Pro exchange. Runs in a Docker container for convenience.
License
queball99/CoinbasePro-Recurring-Buy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Have you ever wanted to automate recurring purchases via Coinbase Pro instead of Coinbase? I did too, so I built a Bot to do it! The Bot can be setup to make recurring purchases weekly or every X number of days/seconds. Funds can be automatically added from your default funding account in Coinbase Pro or from Coinbase. Notifications about buys and funding can be sent to a Discord channel via webhook.
Built in Python and includes the following modules:
CoinbasePro byAlex Contryman
Discord byRapptz
Schedule byDan Bader
Theconfig.json
file is where all settings come from. The Bot checks for the config file at/config/config.json
when it starts up.
Example config file available here:https://github.com/queball99/CoinbasePro-Recurring-Buy/blob/main/config.example.json
To get started copy theconfig.example.json
file to a folder that will be mapped to a Docker volume. Rename the file toconfig.json
and edit the settings based on your needs. See Configuration Options below.
Creating a Coinbase Pro API Key
Creating a Discord Webhook
The Coinbase Pro API Key will need a minimum of 'View' and 'Trade' permissions. If you want to enable Auto-Funding you will also need to grant it 'Transfer' permissions.
Section | Type | Description | Required |
---|---|---|---|
API | |||
Key | String | API Key from Coinbase Pro | Yes |
Secret | String | API Secret from Coinbase Pro | Yes |
Passphrase | String | API Passphrase from Coinbase Pro | Yes |
API-URL | String | Coinbase Pro API URL You can use the production or sandbox URL. Available Options: https://api.pro.coinbase.com orhttps://api-public.sandbox.pro.coinbase.com | Yes |
Schedule | |||
Scheduled-Run | String | How often should the recurring buy be run. Available Options: seconds ,days ,weekday | Yes |
Day | String | Day of the week to make the recurring buy. Available Options: sunday ,monday ,tuesday ,wednesday ,thursday ,friday ,saturday | If Scheduled-Run is set toweekday |
Time | String | The time to make the recurring buy. Specified in 24hr time asHH:MM . | If Scheduled-Run is set toweekday ordays . |
Repeat-Time | Integer | Delay between runs. Will be X days or X seconds depending on if Scheduled-Run is set todays orseconds . | If Scheduled-Run is set todays orseconds |
Funding | |||
Enable-Funding | Boolean | Enable automatic funding. Available Options: true orfalse | Yes |
Currency | String | The currency to fund your account with. Examples: USD ,GBP ,EUR | If Enable-Funding is set totrue |
Max-Fund | Integer | The maximum amount of currency you want to allow the bot to fund at one time. | If Enable-Funding is set totrue |
Fund-Source | String | The source to fund your Coinbase Pro account from to make the purchase. Available Options: default will fund from your primary Banking account in Coinbase Pro.coinbase will transfer currency from your Coinbase portfolio. | If Enable-Funding is set totrue |
Crypto | |||
Buy-Pair | String | Crypto buy pair in Coinbase Pro. Examples: BTC-USD ,ETH-USD ,BTC-GBP , etc. | Yes |
Buy-Amount | Integer | The amount of crypto to buy, specified in your currency. Example: Specifying 20 andBTC-USD will buy 20 USD worth of BTC. | Yes |
Alerts | |||
Alert-Channel | String | Enables sending alert messages to Discord or Pushover. Available Options: discord ,pushover or leave empty for no notifications. | Yes |
Discord-Webhook | String | The webhook URL you create in your Discord server. | If Alert-Channel is set todiscord |
Pushover-API-Token | String | Pushover API Token. | If Alert-Channel is set topushover |
Pushover-User-Key | String | Pushover user key. | If Alert-Channel is set topushover |
You can have alerts about funding and buys sent to Discord via a Webhook. See thisDiscord support article for how to setup a Webhook.
You can have alerts about funding and buys sent via the Pushover push notification service.
What is Pushover and how do I use it?
Architecture |
---|
x86-64 |
Tag | Description |
---|---|
latest | Latest stable release |
development | New features will be added and tested here |
Compatible with docker-compose v2 schemas.
---version:"2.1"services:coinbase-pro-buy:image:queball/coinbase-pro-recurring-buycontainer_name:coinbase-pro-recurring-buyenvironment: -TZ=America/New_Yorkvolumes: -/path/to/folder:/configrestart:unless-stopped
docker run -d \ --name=coinbase-pro-recurring-buy \ -e TZ=America/New_York \ -v /path/to/folder:/config \ --restart unless-stopped \ queball/coinbase-pro-recurring-buy
Parameter | Function |
---|---|
TZ | Specify a timezone to use. Default isAmerica/New_York |
- Update all images:
docker-compose pull
- or update a single image:
docker-compose pull coinbase-pro-recurring-buy
- or update a single image:
- Let compose update all containers as necessary:
docker-compose up -d
- or update a single container:
docker-compose up -d coinbase-pro-recurring-buy
- or update a single container:
- You can also remove the old dangling images:
docker image prune
- Update the image:
docker pull queball/coinbase-pro-recurring-buy
- Stop the container:
docker stop coinbase-pro-recurring-buy
- Delete the container:
docker rm coinbase-pro-recurring-buy
- Recreate a new container with the same docker run parameters from above. Your
/config
folder containing the config.json folder will not be changed. - You can remove old images with:
docker image prune
If you want to build the container locally:
git clone https://github.com/queball99/CoinbasePro-Recurring-Buy.gitcd CoinbasePro-Recurring-Buydocker build.
About
A Python app to automate buying cryptocurrency on the Coinbase Pro exchange. Runs in a Docker container for convenience.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.