Search
 Coin Explorers
Search
 Coin Explorers

Portfolio

Markets

Project Reviews

Founder Stories

Features

Guides

News

Videos

Let’s stay in touch:

News

I just published a bot that lets you dollar cost average Bitcoin on GDAX

gdax-dca-bot - A bot for dollar cost averaging Bitcoin, Ethereum, and Litecoin on GDAX

Dec 18, 2017 · 5 min read
  • Share on X
  • Share on Facebook
  • Share on Linkedin
I just published a bot that lets you dollar cost average Bitcoin on GDAX

Features This bot provides a hands-off approach to cryptocurrency investing. It lets you set recurring buys for Bitcoin, Ethereum, and Litecoin at intervals ranging from every minute to once a day. The shorter the interval, the closer you can get to achieving a true dollar cost average. The bot currently supports USD and EUR and trades on the US based exchange, GDAX. It places market orders that carry percentage based fees of 0.25% for BTC and 0.30% for ETH and LTC. Considering there are recurring buy services out there that tack on fees of 10%+, you could potentially save a lot of money. If you’re just interested in playing around with the bot, it has a sandbox mode that uses fake money. You can read more about it below. Dollar Cost Averaging Dollar cost averaging is the strategy of buying a fixed dollar amount of an investment at a specific interval. It is thought to reduce risk, especially in volatile markets. Since cryptocurrency markets tend to be rather volatile it has become a pretty popular practice in the space. Dollar cost averaging is a slightly controversial topic, as there is an ongoing debate of whether or not it actually beats lump sum investing. There is strong math on both sides, however, I think its effectiveness ultimately boils down to the particular use case. I encourage you to read up on this if you're interested. Getting started Set up GDAX/Coinbase account Sign up for an account on GDAX if you haven’t already (a Coinbase account will also work), then deposit funds. Currently the best way to do this is with an ACH transfer (USD) or SEPA transfer (EUR) which are both free, otherwise, you’ll probably end up paying unnecessary fees. Create API Key Navigate to the API section of your dashboard and create an API key that has “Trade” permissions. This will generate a key, secret, and passphrase. You will need these later so write them down or store them safely. Set up locally Make sure you have Node.js 8.0+ installed then run git clone https://github.com/WhiteRiceWill/gdax-dca-bot.git cd gdax-dca-bot npm install Configure bot Create a .env file in your project’s root directory, then copy paste the code below into it. #API Authentication API_KEY= API_SECRET= API_PASSPHRASE= #Bitcoin INTERVAL_INVESTMENT_AMOUNT_BTC= INVESTMENT_INTERVAL_BTC= #Ethereum INTERVAL_INVESTMENT_AMOUNT_ETH= INVESTMENT_INTERVAL_ETH= #Litecoin INTERVAL_INVESTMENT_AMOUNT_LTC= INVESTMENT_INTERVAL_LTC= #Other FIAT_CURRENCY= SANDBOX_MODE= Fill out each section as specified. If you’re having trouble, you can take a look at the env.example file that shows what a filled out version looks like. API Authentication This is where to use the key, secret, and passphrase you generated earlier. #API Authentication API_KEY=[your API key] API_SECRET=[your API secret] API_PASSPHRASE=[your API passphrase] Currency Specific Settings The interval investment amount is the amount in US Dollars or Euros that you want the bot to invest at each interval. The investment interval is how often you want the bot to buy. #Bitcoin INTERVAL_INVESTMENT_AMOUNT_BTC=[amount in fiat] INVESTMENT_INTERVAL_BTC=[‘min’, ‘tenmins’, ‘hour’, ‘sixhours’, ‘day’] #Ethereum INTERVAL_INVESTMENT_AMOUNT_ETH=[amount in fiat] INVESTMENT_INTERVAL_ETH=[‘min’, ‘tenmins’, ‘hour’, ‘sixhours’, ‘day’] #Litecoin INTERVAL_INVESTMENT_AMOUNT_LTC=[amount in fiat] INVESTMENT_INTERVAL_LTC=[‘min’, ‘tenmins’, ‘hour’, ‘sixhours’, ‘day’] For example, if you want to invest $1.50 into bitcoin every 10 minutes you would put #Bitcoin INTERVAL_INVESTMENT_AMOUNT_BTC=1.50 INVESTMENT_INTERVAL_BTC=tenmins The bot is set to not buy if an amount of less than 1 dollar is entered as per the GDAX trading rules. So for example, if you wanted to invest in Bitcoin and Ethereum, but not Litecoin, for Litecoin you would put #Litecoin INTERVAL_INVESTMENT_AMOUNT_LTC=0.00 INVESTMENT_INTERVAL_LTC=day In this case, it doesn’t matter what you put for the investment interval because the bot isn’t going to buy. Also, you can put fractions of a cent (example: 1.2534) and it should work. Other Set the currency you are using and whether or not the bot is in sandbox mode. #Other FIAT_CURRENCY=[‘USD’, ‘EUR’] SANDBOX_MODE=[‘true’, ‘false’] Test To test that the bot is set up correctly turn it on (Caution: it will actually start buying). In the project’s root directory run node bot.js Then check your GDAX dashboard to make sure everything is working as expected. The bot uses your computer’s internal clock, so for example, if you have it set to makes buys hourly, it will buy at 1:00,2:00,3:00 etc… You should also note that the bot has a randomized, artificial delay of up to one minute on each buy. This is so that if this bot becomes popular, the exchange won’t be flooded with a large batch of market orders all at the same time. The bot also offers a sandbox mode for those who want to try it out with fake money first. To use this feature create an API key in the Sandbox GDAX instead of the actual site. Then set SANDBOX_MODE in the .env file to true. This can also be helpful for debugging if you're having trouble getting it to work. While in sandbox mode the bot will print error messages to the console if something is wrong and a confirmation message every time a market order is successfully placed. Deploy If you’re planning on running the bot for a long period of time it makes sense to deploy to a server. To minimize latency I recommend using Amazon’s US East N. Virginia data center where GDAX’s primary servers are running as well. Plus an EC2 t2.micro instance is free for the first year. Also, it's a good idea to install PM2, a production process manager for Node.js that will keep the bot up and running safely. Lastly, take precautions to not expose your .env file. Never commit it to a public repository for example. Strategies The most common approach to dollar cost averaging cryptocurrencies is to do it over a long period of time (often years) and then hold your investment and wait. That isn’t the only option though. Because buys on GDAX incur a percentage based fee, and because this bot provides the option to set very short intervals, there is an opportunity for testing out new investment strategies. For example, if you wanted to, you could dollar cost average into a position over a 3 hour period. I have no idea whether or not that is a good idea, however, I do think there are some interesting experiments that could be done. If your plan is more long-term, I recommend transferring your coins to a hardware wallet every once in a while. Contributing This bot is an experiment and contributions are welcome. If you have a suggestion or find a bug, either create an issue or reach out to me on Twitter @WhiteRiceWill Disclaimer Dollar cost averaging is not a sure-fire strategy, and this bot is experimental. Invest at your own risk. License MIT License


  • Share on X
  • Share on Facebook
  • Share on Linkedin

Related News

Bitcoin has officially entered the Guinness World Records for a number of entries, the first of which is being recognized as the First Decentralized Cryptocurrency
News

Bitcoin has officially entered the Guinness World Records for a number of entries, the first of which is being recognized as the First Decentralized Cryptocurrency

Bitcoin now has multiple entries in the Guinness Book of World Records, including most valuable and the first decentralized cryptocurrency.

Oct 19, 2022

740 Million in Bitcoin exits exchanges, the biggest outflow since June's BTC price crash
News

740 Million in Bitcoin exits exchanges, the biggest outflow since June's BTC price crash

The technical outlook, however, remains bearish for Bitcoin, with the price eyeing a run-down toward $14,000 in Q4/2022.

Oct 18, 2022

Bitcoin Wins the Guinness World Record for First Decentralized Cryptocurrency
News

Bitcoin Wins the Guinness World Record for First Decentralized Cryptocurrency

Bitcoin has been honored as the oldest and most valuable crypto, while El Salvador is recognized as the first country to adopt it as legal tender. 

Oct 18, 2022

 Coin Explorers

PortfolioMarketsProject ReviewsFounder StoriesFeaturesGuidesNewsVideosTerms & ConditionsPrivacy Policy

Powered by

 Coin Explorers

Copyright © 2025 - All Rights Reserved