An experimental bot to automatically trade on coinbase
Notice that, being based on the use of workers (more details here), it required to use node version 16.2.0 at least, in order to do so, run the following command to check the current version being used locally:
node -v
if the version is below 16.2 proceed as follows:
run the following command to see the list of node environments
nvm ls
if you already have version 16.2.0 run:
nvm use v16.2.0
else install it (it will set 16.2.0 as default automatically)
nvm install v16.2.0
The core part of the bot is the main.js file, in order to start it, load a set of strategies in the all_strategies.js file (under the strategies folder) and then export as environment variables the authentication data for codebase:
export key=<your-api-key>
export secret=<your-api-secret>
export name=<your-api-name>
for more details on how to create the values above, refer to the wiki.
To run the bot, type:
node main.js --conf=/path/to/the/configuration/yaml/file.yaml
Unit tests are, as you probably guessed, in the 'test' directory, to run all the unit tests:
npm test
to run the test and measure the coverage:
npm run test-coverage
after running the above command, coverage is shown in the coverage/index.html file:
to run the test continuously whilst you are developing:
npm run test-dev
you can also run continuous testing on a particular test (quite handy to have the results fast)
npm run test-dev path/to/your/test/file
Going further down, you can also continuously running a particular single test:
npm run test-dev-one --test_file=<file containing the test>
--pattern='<Pattern in the description>'
Botbase makes use of mkdocs and github pages to keep its documentation in a tidy state.
Documentation is kept in the docs folder, to locally see the current documentation:
mkdocs serve
The website will be visible on your local environment
A few tools are used to ensure code quality:
To locally run codeclimate:
codeclimate analyze