On receiving msg.payload the DCA node provides the internal functionality to carry out
dollar cost average
investing to help build a custom savings plan.
The node calculates how much of each given coin to purchase during a month and selects random time points to purchase by considering minimum order amounts and the current bidding/asking price besides various other metrics in order to meet the expected configured monthly quote amount.
info
The dca node is great for building custom savings plans.
It is also possible to reverse the direction to selling instead of buying.
This is great to take profits during greedy market times.
Configuration
Name optional
optional name for this node
Exchange select
select the exchange you wish to connect to
Quote Currency select
select quote currency for investing. This defines the currency for which each given amount is invested every month. This is not the coin that will be purchased. This can be any currency on the selected exchange, i.e. all fiat currencies, cryptocurrencies, and stable coins.
Monthly Amount integer
provide the monthly amount of total quote currency to be invested every month. A buy order will be generated if >0 and a sell order will be generated if <0.
Coins table
click add coin at the bottom left of the coins table to add a coin to the DCA investment functionality. If multiple coins are added, select desired weighting (i.e. what % of monthly quote currency to invest in each coin). Weightings are automatically rounded.
Formula used for calculating chance:
Choose base currency based on user configured coin weights
Input
_repeat integer
This is the expected frequency in seconds. Note, the
inject node
automatically adds this property when Repeat is enabled.
Output
The message will be enriched by dca and order properties:
msg:
payload string
Human-readable representation, e.g. buying 0.0001 on BTC/EUR (calculated chance was 6%)
msg.dca:
dca.exchange string
Exchange, e.g. kraken
dca.monthlyQuoteAmount integer
The monthly amount of total quote currency to be invested every month, e.g. 300
dca.coins object
Configured coins with their respective weights
dca.baseCurrency string
Randomly selected base currency based on configured weights, e.g. BTC
dca.quoteCurrency string
Configured quote currency, e.g. EUR
dca.market string
Randomly selected market based on base and quote currencies, e.g. BTC/EUR
dca.weight integer
Weight of randomly selected base currency, e.g. 30
dca.calculatedChance float
Chance that was calculated for this configuration, e.g. 0.06217420715451037; range [0-1], cf. formula used above
The dca properties are only added for informative purposes.
msg.order:
order.exchange string
Exchange on which order should be placed, e.g. kraken; same as dca.exchange
order.market string
Market, e.g. BTC/EUR; same as dca.market
order.side string
Whether to buy or sell, e.g. buy; will be automatically inferred by Monthly Amount, i.e. buy for positive values and sell for negative values.
order.amountType string
It is always base
order.orderType string
For now, it is always market
The order properties can be automatically consumed by the
create order node
.
Example message
{"payload":"buying 0.0001 on BTC/EUR (calculated chance was 6%)","dca":{"exchange":"kraken","monthlyQuoteAmount":300,"coins":[{"id":"ETH","coin":"ETH","weight":50},{"id":"BTC","coin":"BTC","weight":30},{"id":"DOT","coin":"DOT","weight":20}],"baseCurrency":"BTC","quoteCurrency":"EUR","market":"BTC/EUR","weight":30,"calculatedChance":0.06217420715451037},"order":{"exchange":"kraken","market":"BTC/EUR","side":"buy","amountType":"base","amount":0.0001,"orderType":"market"}}
Info
Please ensure that your exchange account is funded appropriately every month in order for this node to be able to trade on the selected exchange.
To invest a 0.01 BTC recurrently every month set the quote currency as BTC and Monthly Amount as 0.01.
Then select the coins you wish to invest in separately at the bottom of the node editor.