- Published on
HyperTrade - Distributed cryptocurrency trading bot
3 min read
- Authors
- Name
- Karan Pratap Singh
- @karan_6864
Table of Contents
Hi everyone, I wanted to share a recent weekend project of mine. HyperTrade, a ready to deploy, distributed cryptocurrency trading bot. I had a lot of fun building this and recently opensourced it.
Note: use this software at your own risk. The author assumes no liability for your trading outcomes
💡 Motivation
A few months ago I got into the crypto market. It was all new and fascinating to me. The idea of this project originally came from a script I used to automate buying and selling of fiat assets.
I was curious and wanted to scale it into a real system which can execute trades for me. I had a lot of fun building this. I got to play with lots of different technologies while growing my financial knowledge.
Feel free to reach out to me if you have any additional questions. There are lots of fixes and features to be done!
It is important to note that this project is under active development and was developed as an experiment. Currently, only Binance is supported but contributions are welcome!
🔍 Overview
Here's a short overview of the project.
📷 Screenshots
Here are some screenshots from the web interface.
✨ Features
This system has lots of features such as:
- Web UI: Real-time access for charts, technical indicators, and portfolio.
- Configurable: Supports assets and strategies customization easily without touching any code!
- Portable: Export your trades and real-time data frame to CSV.
- Multiple Assets: Trade multiple crypto assets simultaneously!
- Telegram Support: On the move? Use Telegram bot to receive real-time notifications and much more.
- Ready to deploy: Comes with Infrastructure as Code which is ready to deploy to Digital Ocean.
- Easy to upgrade: Modify the system easily to your needs.
⚡️ Technologies
🏭 Architecture
It's a microservices based architecture with event driven approach for decoupling. It uses distributed streams and messaging which keeps the system simple yet robust to make sure it can grow in future.
Note: Kubernetes diagram was generated using Lens - The Kubernetes IDE
Why so many technologies?
This started as an all Go project, but then I decided to add Python to the mix as it has a really good ecosystem for technical indicators and mathematical use cases.
For the web, I used React as it's easy and TypeScript provides some sanity to JavaScript projects!
Nginx and Postgres fit right in as the use case grew. As always, use what's right for the project!
Why event driven?
Originally I made this using HTTP REST, but systems like this are event driven by nature. Plus this approach helps to decouple services even more.
How do services communicate?
All the messaging infrastructure use cases are handled by NATS. Inter-service communications are mainly via publish-subscribe and request-reply patterns. Essentially, NATS acts as our service mesh!
We also use JetStream for real-time, persisted data streams.
Read more about Distributed communication patterns with NATS
💬 Conclusion
Hope you liked the idea! Feel free to reachout to me if you have any questions. Getting started and the deployment guide for this project can be found in this repository.