Skip to content

0xm1kr/cbp-twitter-bot

Repository files navigation

TypeScript version Node.js version APLv2 Build Status - GitHub Actions

Coinbase Pro Twitter Bot

WARING: THIS WILL LOSE YOU MONEY IN IT'S CURRENT FORM.

THIS PROJECT IS ONLY INTENDED FOR EDUCATIONAL PURPOSES/TO BE USED AS A BOILERPLATE.


Overview

This project makes use of rudimentary statistics (Exponential Moving Average) and Twitter sentiment analysis to long or short a cryptocurrency on Coinbase Pro.

Getting Started

Setup

  1. Get Coinbase Pro Sandbox Credentials
  2. Get Twitter Credentials
  3. cp .env.example .env, then copy credentials to this file
  4. npm i
  5. npm run build - build the code
  6. npm link - link the node script
  7. cbp-bot - run it

Commands

CBP

  • cbp viewBalances: shows current balances
  • cbp viewBook [product]: view a snapshot of a product book (e.g. "BTC-USD")
  • cbp watchTicker [product]: watch a product ticker
  • cbp watchBook [product]: watch a product book
  • cbp purchase [product] [amount]: market order purchase a token (amount is in quote)

Twitter

  • twitter [keyword]: stream tweet sentiment based on a keyword

Algorithm

  • run [product] [keyword]: run trading algorithm using a Twitter keyword

Development

Available Scripts

  • clean - remove coverage data, Jest cache and transpiled files,
  • build - transpile TypeScript to ES6,
  • build:watch - interactive watch mode to automatically transpile source files,
  • lint - lint source files and tests,
  • test - run tests,
  • test:watch - interactive watch mode to automatically re-run tests

Services

Dependencies

  • TypeScript [3.9][typescript-39]
  • ESLint with some initial rules recommendation
  • Jest for fast unit testing and code coverage
  • Type definitions for Node.js and Jest
  • Prettier to enforce consistent code style
  • NPM scripts for common operations
  • Simple example of TypeScript code and unit test
  • .editorconfig for consistent file format
  • Reproducible environments thanks to Volta
  • Example configuration for Travis CI

Volta?

This project uses Volta:

"node": "12.18.2",
"npm": "6.14.5"

Volta's toolchain always keeps track of where you are, it makes sure the tools you use always respect the settings of the project you’re working on. This means you don’t have to worry about changing the state of your installed software when switching between projects. Pretty cool stuff.

License

🤲 Free as in speech: available under the APLv2 license.

Licensed under the APLv2. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published