Coder Social home page Coder Social logo

rolfmetzger / binance-mm-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timothyosm/binance-market-maker-js

1.0 1.0 0.0 516 KB

Market making bot for Binance to maintain a fixed spread and fixed portfolio exposure for any given period

JavaScript 75.75% Shell 24.25%

binance-mm-js's Introduction

Binance-Market-Maker-JS

Market making bot for binance, written in JavaScript

To Install:

git clone https://github.com/Dylan-Phoon/Binance-Market-Maker-JS
cd Binance-Market-Maker-JS
chmod u+x ./install.sh
./install.sh

Quick start:

./binance_market_maker_js.sh --apiKey=<your API Key> --apiSecret=<your API Secret> --spread=3 --exposure=2 --base=BTC --stock=ETH

Parameters

./binance_market_maker_js.sh takes in 6 required arguments;

  • --apiKey=: Your API Key
  • --apiSecret=: Your API Secret
  • --spread=: The spread percentage on the asset you would like to market make on
  • --exposure= or -e=: The maximum percentage of your account you want in the order book at any given time
  • --base= or -b=: The base asset (e.g. in ETHBTC, BTC is the base asset)
  • --stock= or -s=: The stock asset (e.g. in ETHBTC, ETH is the stock asset)

How it works

The bot will maintain a spread of a given percentage in the order book, based on the last price traded. It will recalculate the spread and orders, when either your buy or sell maker order gets filled or partially filled.

For example given an order book that looks this;

16.8	| -- (your order) (s_1)
15.8	| -- sell orders
15.7	|

15.5 	| -- Last price traded

14.5	| -- (your order) (b_1)
14.124 	| -- buy orders 
12.5	|

If someone then does a single market buy up to 17, b_1 will be canceled, s_1 will be filled, and the bot will then rebalance so that the new order book looks like this;

18.00	| -- (your new order) (s_2)

17.00	| -- Last price traded

16.00	| -- (your new order) (b_2)
14.124 	| -- buy orders 
12.5	|

The amount in each order is dependent on the --exposure= parameter. It will calculate the total {stock | base} balance * (exposure / 100). For example;

Exposure percentage (e) = 1
Base asset balance (b) = 10
Stock asset balance (s) = 15

buy order amount = b(10) * (e(1) / 100)
sell order amount = s(15) * (e(1) / 100)  

binance-mm-js's People

Contributors

outdoteth avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.