DCA with kinda low fees kinda easily

Link to repo: [](

Put this together a while back and thought it may be useful to the broader community. Basically provides a CLI (command line interface) for purchasing bitcoin from coinbase pro (can be used for any other USD pair if you so choose). The use case I had in mind at the time was a cheaper way to DCA. I’ve been running it on a scheduled interval (every night at 1:00 AM EST) in my personal AWS account using [AWS lambda]( for about a month and a half at this point without issue.

A couple highlights:
coinbase pro maker / taker fees are both 0.5% at low volume. This compares favorably to other options I considered (coinbase custodial is minimum 1.5%, swanbitcoin is minimum 0.99%, but 1.99% at my volume), not to mention the spread in the spot price you get.
– comes with example terraform for automating the scheduled execution use case
– can be used locally if you’d rather just make a one off purchase via command line instead of web UI, which came in handy during the most recent dip.
– will initiate an autodeposit for the amount to be purchased if your USD account isn’t sufficient (verified coinbase pro accounts have instant usd transfers)
– added ability to optionally “weigh” purchase amount. Basically increase the purchase amount by some factor if the current market price is less than what you’ve been paying recently to help lower cost basis. More heavily weigh your lower cost purchases.

Some drawbacks:
– requires a bit of technical know how to get everything setup
– Pure DCA, no restrictions. Once setup, the purchase happens regardless of current price (I think my purchase from 4/13 or 4/14 was within 1% of current ATH).
– Comes from a random dude on the internet, but feel free to comb through the source code or fork as you please (MIT)

Future plans:
– add ability to auto withdraw btc balance to hardware wallet once certain threshhold is reached
– maybe look into a “max price” where the purchase won’t execute
– maybe some other stuff, not sure

More info and links are provided in the README.

As always, all of this comes with no guarantees and I am not a financial advisor and don’t invest what you wouldn’t mind losing and all that.

View Reddit by swhite24View Source


Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings


  1. Great project and great job. I did a similar tool but my buys were a bit more complex. I choose to do this as a scheduled job on my desktop since I didn’t want to share my CB-Auth-Token with AWS.

    I decided, instead, to use GPG to encrypt my CB-Auth-Token and pipe the decryption into my script for execution. My GPG auth is embedded in a card-reader so that my decryption key is not housed anywhere on the drive.

    It requires my card be plugged in and my machine to be powered on, but I’d rather miss a buy or two than to expose any secrets.

    Again… Well done!



What do you think?

How newbies must fell after last night’s crash

TeraBlock Secures $2.4 Million to Build a Newbie-Friendly Crypto Exchange Powered by Machine Learning

TeraBlock Secures $2.4 Million to Build a Newbie-Friendly Crypto Exchange Powered by Machine Learning