A distributed system for manageing your cryptocurrencies.
Crypto-currencies are gaining rapid popularity as equity for trading and investing. These currencies are extremely volatile and often require lots of attention and oversight for traders to leverage peaks and valleys. The previously stated attributes of crypto lead to many individuals developing software scripts(often called a “bot”) that autonomously trade stock or cryptocurrency without human intervention. These “bots” alleviate some of the attention a trader has to allocate to their equities when performing high-frequency trading, which has made bots quite popular for those who are capable of building and deploying such pieces of software.
The purpose of this project is to develop a platform that utilizes networking protocols to help crypto-traders easily deploy and manage their own trading bots. This platform is intended to extrapolate the system infrastructure away from the actual trading logic of each bot, so users of the platform can focus on what matters, creating profitable trading strategies. The platform utilizes the master-worker paradigm to deploy and manage a collection of trading bots. This system is intended to be fault-tolerant, easily scalable, and makes use of networking protocols such as WebSockets for controlling and deploying workers in the network.
There are endless Medium articles overviewing how to build a trading bot as well as GitHub repositories that have already built out trading bots. The objective of this project is to establish a system architecture for users to easily deploy their own trading strategies on the platform. “Real-time autonomous trading system” is a paper that outlines the implementation of a real-time trading system and covers networking performance for socket communications. The system architecture in this paper differs from mine since it does not focus on scaling the number of traders, and does not implement an autonomous master node.
Binance has been selected as an appropriate exchange for purchasing and selling Crypto-currencies. They offer a variety of cryptocurrencies, a well-documented trading API, and have been utilized in similar projects to this.
WebSockets will be used for 2 purposes in this platform. The first application of WebSockets is for receiving a stream of cryptocurrency values from the exchange. After reviewing several different options for cryptocurrency value sockets, I settled Binance's Websocket Market Streams. This ended up being the best option because it was free and because after developing an interface for the Binance Exchange API, I was familiar with some of the data patterns Binance used. Moreover, it seemed advantageous to only have data coming in from one source, meaning one API key, and consistency between the ticker values coming in through the stream and on the exchange.
A system schema has been designed to allow for later extrapolating bots to isolated containers on a network. The master module is intended to deploy and manage isolated trading bots as the project progresses.
Unit testing has been put in place to assure that modules are working correctly. So far Configuration, Bot, and Master classes have been tested for basic functionality. The Binance Exchange interface is a WIP as well as the