A tool for making a $100 BTC-USD market purchase on Coinbase Advanced. The $100 purchase can be automated on Coinbase retail for $2.99 per trade. Alternatively, this tool allows the same dollar-cost averaging to be done on Coinbase Advanced for $0.55 per trade. "Very save! WOW. Much nice!"
This tool is without guarantees or warranty and only available on an as is basis. This tool is used at your own risk!
usage: cb-adv-dca.py [-h] [-c COIN] [-f FUNDS] [-l LIMIT] [-d] [--version]
action
Buys digital assets on Coinbase Advanced.
options:
-h, --help show this help message and exit
-d, --debug toggle verbose logging
--version show program's version number and exit
configuring purchases:
action buy|test - live buy or simulation
-c COIN, --coin COIN the asset to purchase, such as b|e|s|BTC|ETH|SOL|BTC-
USD. Default BTC-USD.
-f FUNDS, --funds FUNDS
the amount to spend. Default 100.00.
-l LIMIT, --limit LIMIT
0|1|5 - percent limit order discount. Default 0.0
(market order).
This tool requires an API key for your Coinbase Advanced account. To create an API key:
- Log into https://portal.cdp.coinbase.com/access/api?keyType=trade
- Click the
Create API key
button. - Name the key, choose the account it has access to, and enable
Trade
access. ClickCreate & download
. - Retain the key and secret in a safe manner because it is a bearer token that allows access to your account!
Use the following steps to deploy on a FreeBSD host:
- su - root
- pkg update -f
- pkg install git
- pkg install python
- python -V # Assuming this return v3.9, then:
- pkg install py39-pip
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- vi .cshrc
- Append the following to the PATH export:
$HOME/.cargo/bin
- su - dca # Assuming service account 'dca'
- Append the following to the PATH export:
/root/.cargo/bin
- Log out and log back in to source the new PATH.
- mkdir /coinbase-advanced-dca
- chown dca:dca /coinbase-advanced-dca
- su - dca
- ln -s /coinbase-advanced-dca coinbase-advanced-dca
- rustup default stable
- git clone https://github.com/TMan253/coinbase-advanced-dca.git
- cd coinbase-advanced-dca
- python -m venv foo
- . foo/bin/activate
- pip --version
- pip install --upgrade pip
- pip --version
- pip install coinbase-advanced-py
- vi config.ini
- Add the following contents, but substitute your API key and secret within the quotation marks, and then save the file and exit:
[API]
API Key = "yourKeyHere"
API Secret = "yourSecretHere"
- python cb-adv-dca.py test -c BTC -f 100.00
- mkdir logs
- chmod 744 dca.sh
- crontab -e
- Add the following:
#
# Note: For multi-value, use commas: 3,12,47
# Note: For every X interval, use /: */X
# Note: Aliases: @reboot = once at startup, @hourly
#
#
# +--------- Minute (0-59)
# | +------- Hour (0-23)
# | | +----- Day Of Month (1-31)
# | | | +--- Month (1 -12)
# | | | | +- Day Of Week (0-6) (Sunday = 0)
# | | | | |
# * * * * * COMMAND
#----+----+----+----+----+-----+------------------------------------------------
# * * * * * /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "test -c b -f 100.00"
# 0 16 * * 0,4 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c b -f 100.00"
# 0 16 * * 3,6 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c e -f 100.00"
# 1 16 * * 4,6 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c s -f 100.00"
# 2 16 * * 4 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c SEI-USD -f 50.00"
# 0 16 * * 5 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c SUI-USD -f 50.00"
# 1 16 * * 5 /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "buy -c TIA-USD -f 50.00"
# * * * * * /coinbase-advanced-dca/dca.sh coinbase-advanced-dca/bin/activate "asdf" "[email protected]" "view"
#
#
TBD
Use the following steps to create a local development environment:
- git clone https://github.com/TMan253/coinbase-advanced-dca.git
- cd coinbase-advanced-dca
- python -m venv foo
- source foo/bin/activate # for Linux, or for Windows: foo\Scripts\activate
- pip3 install coinbase-advanced-py
- notepad.exe .\config.ini
- Add the following contents, but substitute your API key and secret within the quotation marks, and then save the file and exit:
[API]
API Key = "yourKeyHere"
API Secret = "yourSecretHere"
- .\foo\Scripts\python.exe .\cb-adv-dca.py test -c BTC -f 100.00 -l 0.2