A simple bot that automates averaging down the cost of your crypto asset. (i.e. every time the price of ETH falls 5% buy $200 worth)
This is not an endorsement of any strategy or this program itself. This code is, open source, and you assume all risks from its use
Simply put, you can specify a percentage and when the crypto you select falls from a relative peak or recent purchase price by that fixed percentage it will trigger an order to buy more.
-
You need to have NodeJS. Download the latest version for your device here: https://nodejs.org/en/download/
-
You need to have git installed. Your computer likely already has this.
-
You need to set up an account on coinbase pro. (https://pro.coinbase.com)
- Open your preferred terminal program (
Command Prompt
on Windows andTerminal
on MacOS) and run the following:This will download the project code onto your computergit clone https://github.com/abir-taheer/coinbase-pro-average-down.git
- Enter the project directory:
cd coinbase-pro-average-down
- Download dependencies (make sure you have node installed):
npm install
- Sign in to https://pro.coinbase.com
(Optional)
Make a separate portfolio for this app. This will help you isolate any actions taken by this app in particular.- To make a separate portfolio, go to https://pro.coinbase.com/portfolios and click on where it says
Create
on the top left. - Give this portfolio a name
- Deposit the amount of USD that you want this bot to have access to into this portfolio from your default portfolio or from your bank
- To make a separate portfolio, go to https://pro.coinbase.com/portfolios and click on where it says
- Go to the api keys page: https://pro.coinbase.com/profile/api
- Next to the
+ New API Key
button, make sure you have the correct portfolio selected if you created a new one - Click on the
+ New API Key
button - Give it a nickname
- Give it permissions to
View
andTrade
- The passphrase field has a value. You can leave it as-is or enter your own. Make sure to write it down somewhere.
- For the IP whitelist, enter your current IP address (google:
what is my ip address
)
- If you are running on a remote server enter the ip address of the server.
- If your ip address will change often, you can set the value to
0.0.0.0
but be careful because if your api key is stolen, anyone will be able to use it.
- Next to the
-
Go back to your terminal and make sure you're at the root of the project directory (you should be if you haven't touched it after installing dependencies)
-
There's a file in the project called
example.env
, rename it to.env
with the following commandmv .example.env .env
-
Now edit the file in your preferred text editor. On Windows you can open the file in notepad by doing:
- To open in Notepad on Windows:
-
notepad .env
- To open in TextEdit on MacOS:
-
open -a TextEdit .env
-
Add your API Key, Secret, and Passphrase in the places indicated
-
Change the trading settings to your desires or leave them as-is if you're fine with them
-
Save the file
Cmd + S
on MacOS orCtrl + S
on Windows
To run the app simply use the following command:
npm start
Leave the app and your pc (or server) running, so the app can monitor prices