Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
703 stars 213 forks source link
bitcoin bitmex cryptocurrencies cryptocurrency css deribit ethereum exchange html html5 javascript nodejs trade trading trading-algorithms trading-bot trading-strategies typescript webpack webpack3

WolfBot

This is the source of the Crypto currency trading bot running on: https://wolfbot.org

It is written in TypeScript for NodeJS + MongoDB.

Features

Key trading advantages

Screenshots of the Trading UI:

Trading Chart

Live Strategy data

Strategy configuration

A more detailed list of all features: https://wolfbot.org/features/

The list of supported exchanges: https://wolfbot.org/features/exchanges/

Additionally WolfBot supports over 130 exchanges using CCXT Library (no WebSockets, no margin trading).

The full strategy documentation: https://wolfbot.org/strategy-docs/

Getting Started

Requirements

NodeJS >= 12 && <= 14
MongoDB >= 4.0
TypeScript >= 3.5
yarn >= 1.9.4 (npm should work too, but no support given if you run into errors)
Webpack >= 4 (only for UI modifications)

Installation

git clone https://github.com/Ekliptor/WolfBot
yarn install

You can use the --production flag if you only want to run the bot and not make any code changes.

Start trading

Rename the configLocal-sample.ts file in the project root directory to configLocal.ts and add at least mongoUrl (plus some exchange API keys if you want to trade).

After running TypeScript (automatically in your IDE or run the tsc command in the project root dir) you will see a file:

build/app.js

tsc will show you some errors (due to shared code with missing types between server and client side, I will refactor this later). Just ignore these errors and make sure noEmitOnError is not set (the default) and that you have a build/ dir in the project root as well as for all packages under node_modules/@ekliptor which contain a tsconfig.json file. Use the build directory as the working directory and run:

node app.js --debug --config=Noop --trader=RealTimeTrader --noUpdate --noBrowser

The config parameter must be a JSON file from the config directory. For a list of all parameters look at the top of the app.ts file.

Docker support

To you can install WolfBot with all its dependencies using Docker:

docker-compose up

Writing your own trading strategies

There is documentation available here: https://forum.wolfbot.org/forums/strategy-development.17/

Look into the /src/Strategies folder for more examples.

Incoming trades flow diagram Outgoing trades flow diagram

Modifying the UI

In the project root directory, run:

yarn watch

You should also run the bot with the --uiDev flag so that changes to HTML template files are reloaded from disk.

The UI uses a single persistent WebSocket connection. UI related code is in the following directories:

├ project root
├─── public <- all code shipped to the browser
├────── js <- all TypeScript code to be compiled with WebPack
├─── src
├────── WebSocket <- all server-side logic to push updates to the browser
├─── views <- all HTML templates

REST and WebSocket JSON APIs

If you want to connect WolfBot to your trading terminal, please take a look at the API docs.

This let's you:

Contact

Follow me on Twitter and Memo.

No donations, I actually make money trading;)