In this post I describe a basic way of doing crypto Dollar Cost Average on Binance and Kraken. I am doing this strategy using a toy Ruby on Rails application on Heroku. The application has some other interesting parts, but here I am focusing on DCA.
I use the Heroku scheduler add-on and run a specific task every day which executes an order. I will show some code and give a description, but I will not give the complete application. It is basic enough that I think it is worth trying to build it yourself.
Basic settings
I use a Setting model with the EAV pattern. It is a common Rails model with a key field and a jsonb value field. I store the necessary settings per case there.
Read the Setting migration on GitHub Gist.
Binance
For connecting to Binance you need a valid Binance account. Then you need an API key from account > API Management. You have to enable Spot & Margin trading during creation.
For the Ruby part, add the binance-connector-ruby gem and initialize it so it can be used across the app.
Read the Binance DCA code on GitHub Gist.
I store the actual amount of money to invest each day, the euro price left and the total BTC volume in settings. If there is less than five times the daily amount in euros, it alerts me to deposit more money on Binance. Another useful addition is a reminder to regenerate the API key when it gets close to expiring.
Kraken
Kraken API is similar. I used the kraken_ruby_client gem, initialized a Kraken client and then used a market buy order.
KrakenClient.add_order(volume: quantity, type: "buy", pair: "BTCEUR", ordertype: "market")
Conclusion
This is a basic automation approach for DCA with Kraken and Binance. In my app I also added a form for changing the price and displaying the variables. I currently use Binance because the fees are better than Kraken, not by a huge amount but enough to matter. Kraken is simpler and its API is easier, so depending on your preference it may be the better choice.