austinyearlykim / wolf

:wolf: Binance trading bot for node.js
78 stars 27 forks source link
binance bot cryptocurrency finance javascript node nodejs trading

Project W.O.L.F

Binance trading bot for NodeJS.

IT IS NOT MY RESPONSIBILITY IF YOU GAIN/LOSE MONEY. THERE IS NO SUCH THING AS PERFECT SOFTWARE. PLEASE LOOK THROUGH THE CODEBASE/DOCUMENTATION TO UNDERSTAND THE RISKS YOU ARE TAKING.

Setup

  1. Create an .env file in your root directory.
  2. Copy and paste template.env into .env
  3. Fill out required environment variables
  4. npm test
  5. (Optional) npm run simulator
  6. npm start

Release Notes

v3.6.1 June 13, 2018

v3.6.0 June 12, 2018

v3.5.0 May 27, 2018

v3.4.2 May 23, 2018

v3.4.1 May 22, 2018

v3.4.0 May 19, 2018

v3.3.0 March 26, 2018

v3.2.0 March 10, 2018

Documentation

How it works

W.O.L.F calculates how much to spend per transaction based on your BUDGET. It watches price movements of a particular trading pair (TARGET_ASSET + BASE_ASSET) in real-time and will buy at the current price and sell for a calculated PROFIT_PERCENTAGE.

The synchronous nature of W.O.L.F makes sure that your trades execute as fast and safe as possible. And only sells when it's profitable! Transaction fees are taken account of! Easy peasy!

Brief technical step-by-step:

  1. Wolf calculates quantity of coin to purchase based of BUDGET.
  2. Wolf places a limit buy order at market price.
  3. Wolf populates the queue with the unfilled limit buy order.
    • The queue is as a data store where unfilled orders live until they've been filled.
    • The queue is traversed every tick that's fired from the Binance websocket. About once a second, or faster.
  4. Once the order is filled, Wolf puts the order into the watchlist.
    • The watchlist is a data store where filled orders live until they reach your desired PROFIT_PERCENTAGE, or any other optional .env triggers.
    • The watchlist is traversed every tick from the Binance websocket as well.
  5. Once your order is ready to be sold, Wolf puts an unfilled sell order in the queue.
  6. Once the queue detects that the unfilled sell order has been filled, Wolf will repeat steps 1-6.
.env
REQUIRED
npm start

This command runs tests before starting the bot. It then kicks off a recursive loop of functions that keep track of best BUY/SELL prices updated by the second and executes trades that are favored for you.

Ctrl + C

Pressing these two keys will terminate W.O.L.F and cancel any open orders that W.O.L.F created. It will not cancel any open orders you might already have.

Logs

Queue: SOME_NUMBER, Watchlist: SOME_OTHER_NUMBER

SOME_NUMBER && SOME_OTHER_NUMBER are the number of items in the Queue and Watchlist respectfully.

Purchasing...

Limit Buy Order was PLACED.

PURCHASED.

Limit Buy Order was FILLED.

Selling...

Limit Sell Order was PLACED.

SOLD.

Limit Sell Order was FILLED.

Issues?

Open up a ticket here to have a question answered or to report a bug: https://github.com/austinyearlykim/wolf/issues

Donations

BTC: 13w2zLgzpEfY8o3QYGzdCP1M6qXN9gwn62
LTC: LUKLmXd4oMbJr4RdV1K2hYgo6b43RQper6
ETH: 0x8140fd88fe77907eb96ceb7850751576da214715

Be sure to reach out to me to get listed here after you've made a donation! No donation is too big or small, but >.001btc to get listed as a supporter! Successful pull requests get you there too!

Supporters