Configuration

Bitcoin DCA uses environment variables to configure the inner workings of the tool. An environment variable looks like this: SOME_CONFIGURATION_KEY=valuehere.

Getting Started Template

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
##################################################################################
# GENERIC APPLICATION SETTINGS
##################################################################################

# You can either use this or WITHDRAW_XPUB. Choosing this one will make the tool withdraw to the same Bitcoin address
# every time.
WITHDRAW_ADDRESS=

# You can either use this or WITHDRAW_ADDRESS. Choosing this one will make the tool withdraw to a new receiving address
# every time a withdrawal is being made by the tool. It’ll start at the first address at index 0, so make sure to
# generate a new account or key when using this method.
# WITHDRAW_XPUB=

# Choose the cryptocurrency exchange this Bitcoin DCA tool will operate on. The default value is "bl3p".
# Available options: bl3p, bitvavo, kraken
EXCHANGE=bl3p

# This setting is for the base currency you're buying in. Options are:
# BL3P:     EUR
# Bitvavo:  EUR
# Kraken:   USD EUR CAD JPY GBP CHF AUD
BASE_CURRENCY=EUR

##################################################################################
# BL3P exchange settings
##################################################################################

# This is the identifying part of the API key that you created on the BL3P exchange. You can find it there under the
# name Identifier Key.
BL3P_PUBLIC_KEY=

# This is the private part of your API connection to BL3P. It’s an encoded secret granting access to your BL3P account.
BL3P_PRIVATE_KEY=

##################################################################################
# Bitvavo exchange settings
# > no trading fees up to the first € 1000,- if you use my affiliate link: https://bitvavo.com/?a=DE4151B112
##################################################################################

# This is the identifying part of the API key that you created on the Bitvavo exchange.
# BITVAVO_API_KEY=

# This is the private part of your API connection to Bitvavo. It’s an encoded secret granting access to your Bitvavo account.
# BITVAVO_API_SECRET=


##################################################################################
# Kraken exchange settings
##################################################################################

# This is the identifying part of the API key that you created on the Kraken exchange.
# KRAKEN_API_KEY=

# This is the private part of your API connection to Kraken. It’s an encoded secret granting access to your Kraken account.
# KRAKEN_PRIVATE_KEY=

# Kraken secured the platform by limiting API usage to pre-whitelisted withdrawal addresses.
# This makes it a lot more secure but unfortunately limits the tool to one withdrawal address
# thus disabling XPUB generation. On Kraken, go to Funding and create a new Bitcoin withdrawal
# address and for description use something without special symbols or spaces. Configure the
# value here.
#
# [!] This option overrides any configured withdrawal address
# KRAKEN_WITHDRAW_DESCRIPTION=bitcoin-dca

# When you request to buy 100 EUR/USD from Kraken they assume you want to buy a minimum of 100
# by default. If the fee would be 0.30 that would be added to the 100, resulting in 100.30 being
# deducted from your EUR/USD balance. If you're transferring a fixed amount of money for a fixed
# amount of DCA cycles this would result in a lack of balance for the final complete DCA purchase
# of that cycle.
#
# include (default): deducts the fee estimation from your order, this will ensure you have enough
#                    balance left for the final DCA cycle.
# exclude:           Kraken default, the tool will order for 100 and Kraken will pay the fee with
#                    the remainder of your balance.
# KRAKEN_FEE_STRATEGY=include
#
# ONLY FOR GERMAN RESIDENTS:
# If your Kraken account is verified with a German address, you will need to accept a trading agreement
# in order to place market and margin orders.
#
# See https://support.kraken.com/hc/en-us/articles/360036157952
#
# KRAKEN_TRADING_AGREEMENT=agree

Available Configuration

This part of the documentation is split up in generic application settings that decide how the tool should act for Dollar Cost Averaging. The last part is for exchange specific configuration like API keys.

DCA Settings

WITHDRAW_ADDRESS

You can either use this or WITHDRAW_XPUB. Choosing this one will make the tool withdraw to the same Bitcoin address every time.

Example: WITHDRAW_ADDRESS=3AT3tf4cVfGRaQ87HpGQppTYmMrb5kpGQb

WITHDRAW_XPUB

You can either use this or WITHDRAW_ADDRESS. Choosing this one will make the tool withdraw to a new receiving address every time a withdrawal is being made by the tool. It’ll start at the first address at index 0, so make sure to generate a new account or key when using this method.

Example: WITHDRAW_XPUB=ypub6Y4RxNmNrdnwdwxERYnXa9rGd4upqeeJ3ixkJQUCQL8UcwYtXj86eXS5fVGU5xsmuuwRp3pKcdci89yiCmA9t2Mhi8cyEDD5P6w2NbfmWqT

EXCHANGE

This configuration value determines which exchange will be used for buys and withdrawals. The default value is BL3P.

Available options: bl3p, bitvavo, kraken

Example: EXCHANGE=bl3p

Exchange: BL3P

BL3P_PUBLIC_KEY

This is the identifying part of the API key that you created on the BL3P exchange. You can find it there under the name Identifier Key.

Example: BL3P_PUBLIC_KEY=0a12345b-01a1-1a1a-012a-a1bc23ef45bg

BL3P_PRIVATE_KEY

This is the private part of your API connection to BL3P. It’s an encoded secret granting access to your BL3P account.

Example: BL3P_PRIVATE_KEY=aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==

BL3P_API_URL (optional)

The endpoint where the tool should connect to.

Example: BL3P_API_URL=https://api.bl3p.eu/1/

Exchange: Bitvavo

BITVAVO_API_KEY

This is the identifying part of the API key that you created on the Bitvavo exchange.

Example: BITVAVO_API_KEY=1006e89gd84e8f3a5209b2762d1bbef36eds5e6108e7696f6117556830b0e3dy

BITVAVO_API_SECRET

This is the private part of your API connection to Bitvavo.

Example: BITVAVO_API_SECRET=aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==

BITVAVO_API_URL (optional)

The endpoint where the tool should connect to.

Example: BITVAVO_API_URL=https://api.bitvavo.com/v2/

Exchange: Kraken

KRAKEN_API_KEY

This is the identifying part of the API key that you created on the Kraken exchange.

Example: KRAKEN_API_KEY=1006e89gd84e8f3a5209b2762d1bbef36eds5e6108e7696f6117556830b0e3dy

KRAKEN_PRIVATE_KEY

This is the private part of your API connection to Kraken. It’s an encoded secret granting access to your Kraken account.

Example: KRAKEN_PRIVATE_KEY=aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==

KRAKEN_WITHDRAW_DESCRIPTION

Kraken secured the platform by limiting API usage to pre-whitelisted withdrawal addresses. This makes it a lot more secure but unfortunately limits the tool to one withdrawal address thus disabling XPUB generation. On Kraken, go to Funding and create a new Bitcoin withdrawal address and for description use something without special symbols or spaces. Configure the value here.

Example: KRAKEN_WITHDRAW_DESCRIPTION=bitcoin-dca

KRAKEN_API_URL (optional)

The endpoint where the tool should connect to.

Default: KRAKEN_API_URL=https://api.kraken.com/

KRAKEN_FEE_STRATEGY (optional)

When you request to buy 100 EUR/USD from Kraken they assume you want to buy a minimum of 100 by default. If the fee would be 0.30 that would be added to the 100, resulting in 100.30 being deducted from your EUR/USD balance. If you’re transferring a fixed amount of money for a fixed amount of DCA cycles this would result in a lack of balance for the final complete DCA purchase of that cycle.

Option include (default): deducts the fee estimation from your order, this will ensure you have enough balance left for the final DCA cycle. Option exclude: Kraken default, the tool will order for 100 and Kraken will pay the fee with the remainder of your balance.

Default: KRAKEN_FEE_STRATEGY=include

KRAKEN_TRADING_AGREEMENT (only for German residents)

If your Kraken account is verified with a German address, you will need to accept a trading agreement in order to place market and margin orders.

See https://support.kraken.com/hc/en-us/articles/360036157952

If you agree, fill this value with agree, like this: KRAKEN_TRADING_AGREEMENT=agree

Feeding configuration into the DCA tool

Using a configuration file

When handling multiple environment variables, things can get messy. For easier management you can create a simple configuration file somewhere on your disk and use that to provide the tool with the correct configuration.

For example, creating a new configuration file in your home directory: nano /home/username/.bitcoin-dca

Note

You can find out where your home directory is using $ echo $HOME.

/home/username/.bitcoin-dca
BL3P_PUBLIC_KEY=....
BL3P_PRIVATE_KEY=....
WITHDRAW_ADDRESS=....

Now, when running the tool you can use --env-file like this:

Providing configuration with Docker’s –env-file
$ docker run --rm -it --env-file=/home/username/.bitcoin-dca jorijn/bitcoin-dca:latest balance

Using inline arguments

For maximum control, you can also feed configuration into the tool like this:

Note

While this gives you more control, it will also allow other people who have access your machine to see the arguments with which you’ve started the Docker container, thus revealing your API keys.

Providing configuration by specifying each configuration item separately
$ docker run --rm -it -e BL3P_PUBLIC_KEY=abcd -e BL3P_PRIVATE_KEY=abcd WITHDRAW_ADDRESS=abcd jorijn/bitcoin-dca:latest balance