Package: nash-makerbot
The makerbot is a cryptocurrency market-maker bot that is easy to understand and customize. Its goal is to create a useful practical tool to begin trading digital assets algorithmically. The bot provides a skeleton to build upon for traders wanting to perform market-maker strategies. Its default configuration should allow for trading on Nash out of the box, so users can start quickly.Requires Python 3.7This software is a beta. It works as intended but several improvements are expected in the near term.Quick install guideFirst you will need a Nash (https://nash.io) account with 2FA disabled.
The login credentials will be asked after starting the bot.Install a Python 3 package manager if you do not already have one:On Ubuntu/Debian:sudo apt installpython3-pipOn Fedora/CentOS:sudo dnf installpython3-pipOn Mac OSX, first install Homebrew, then Python 3:/usr/bin/ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"brew install python3Using pip, install the bot:as a user:pip3 install--usernash-makerbotas root:pip3 install-Unash-makerbotGet the example configuration file provided here:$ wgethttps://gitlab.com/nash-io-public/nash-makerbot/raw/master/default.iniUpdate your $PATH to include the makerbot command by either re-entering the terminal or:source~/.bashrcStart the bot:makerbot start eth_usdc--config=default.iniHow it worksThis bot implements a simple symmetric market-maker algorithm. It is based on the idea that there is intrinsic volatility within a market, as shown in the image below, and will trade within a fixed spread.When the bot starts, it watches the order book for the chosen market until it getsmin_history_pointsupdates or a maximum time ofmax_loading_timepasses. The order book is stored in theOrderBookSeriesobject. This is aNamedTuplewith two fields wrapping around twoNumPy.Arrays, oneobs.tthat contains the time in which each snapshot of the order book was recorded and anotherobs.datathat contains the snapshots of the order book.The bot will place the first buy order, thescrum buy. It is defined assetup_scrum_buy.If the price goes up, thescrum buyorder will be filled. In that case, the bot will place a new buy orderbuy 1with a pricebuy_down_intervallower than the microprice.At the same time as placingbuy 1, a sell order corresponding to the scrum buysell (sb)will be placed at a pricestraddlehigher thanbuy 1. The bot has now become a market maker, since it has both buy and sell orders open in the limit order book.As the market continues to move, the bot will place buy and sell orders according to its volatility. For each new buy order, a corresponding sell order will be placed.Users are invited to take a closer look at the functions the bot follows when placing its orders:should_rebuy,should_place_buy,get_buy_orderandsize_order.should_rebuydetermines if the bot should cancel the current open buy order. This is needed, for example, if the spread between the lowest sell and the current buy is too big or if the market has moved up and the probability of the buy order executing is now low.should_place_buylooks at market microstructure and determines if now is a good moment to place a new buy order.get_buy_orderdetermines the price of buy orders.size_orderdetermines the size of buy orders.Todo[ ] Refactor to make code more pythonic and clean[ ] Add testing everywhere[ ] Generalize for custom strategy[ ] Create web UI[ ] Add historical data collection[ ] Allow simulation of a strategy and track expected performance.LicenseThis software uses the MIT License. You are free to use it for profit or
include it in other closed-source projects.History0.1.5 (2019-12-12)Fix top bid check0.1.4 (2019-12-08)Adjust timingsMake retry use pg backoffRespect min base amount on orders0.1.3 (2019-12-06)Fix typos0.1.1 (2019-12-06)Add basic documentationBump nash-api requirement to 1.0.6 to allow LINK tradingRemove some dead code0.1.0 (2019-12-04)Public release