img

I spent the last 3 years building a Cryptocurrency Trading Bot Platform

img
valuezone 12 May 2024

I spent the last 3 years building a Cryptocurrency Trading Bot Platform

I’ve always loved programming as far back as I can remember, but my journey into programming hasn’t been straightforward.

When I was about 13 or so, I started playing around with WordPress and building basic websites. I remember finally finding the source code files containing my website’s code. Probably one of the first times I ever saw code outside of the computer science class.

I could only understand what the code meant in relation to the component it represented. Finding a specific word on the page, and then looking for it in the code is how I started deciphering what the code means, and I remember I was instantly hooked by this.

From there, I continued to learn the basics: HTML, CSS and JS but it wasn’t until much later that I seriously got into backend programming.

It wasn’t until about 4 years ago, I decided to brush up on my backend programming skills. I had only very briefly used Python before. After trying working on some smaller projects, I decided to convert some of the trading bots that I had built on MetaTrader into Python.

Some Backstory

The first couple of bots I built were functional, but the code would probably cause you to have a stroke just by reading it. Nothing gets you to cringe more than your old code.

As I got a bit more confident with the language, I decided to open source one of the bots that I had been working on — the Binance Volatility Trading Bot (BVTB).

The idea behind this bot is that it would help you detect cryptocurrencies that are just about to moon by constantly analysing all coins on Binance. The bot would look at the price change in % over a certain period of time, and if any coin breaks that threshold — it would buy it.

So — for instance you could Build trading strategies that work like this:

BUY any coin on Binance that gains more than 4% within 2 minutes.

From here on, all that was left to do was run multiple bots at the same time and figure out what the sweet spot is in the current market.

I shared my idea, and tool on Reddit and it went nuts. The project has over 3000 starts on GitHub and it’s still available today.

As months went by, a group of core devs was informally created that would maintain the tool and add new features. But one of the big limitations of the BVT bot was that it wasn’t really easy to use, or run.

You’d need to be willing to have your computer run 24/7 or have access to a Raspberry Pi. You’d also need to be comfortable with Python, and with the general idea of running scripts you find from strangers online.

That’s when we decided we’d turn this into a SaaS. Fast forward 3 years — algo crypto trading platform Aesir was born.

Building an algo crypto trading bot platform

Going from a python script you can run locally, to a scalable web application with user authentication is a completely different ball game. One that I would not have been able to pull off without the amazing team that we established in the early BVTB days.

We all met through that project, but we had the perfect mix of people to pull this off. We had 3 full stack developers, 2 devops and security experts and a business admin.

Before building the application, we looked at existing algorithmic trading apps like HummingBot and 3Commas. We also had numerous conversations on Reddit and Discord trying to understand what features people want the most, and how we can innovate on the formula.

With a roadmap in mind, it was time to figure out how to actually build an application that scales.

We initially decided to keep the engine in Python and build around it. By engine, I mean the part of the application that actually does the buying, selling and portfolio management.

It was 6 months in, and we had the overall architecture in place — A cloudfront, an EC2 for the website, and various microservices passing messages to one another.

And it turned out that Python is an absolute memory hog and makes the application extremely inefficient to run at scale — not to mention slow.

It was back to the drawing board and I was pretty much hands off the engine at this point and instead moved to front end. The engine was now in the hands of our capable backend devs, who decided on converting the engine to C#.

A few more months in, and this was absolutely the right call. C# is great for memory management and speed, so it was no surprise that our core was running lean, more than 50% leaner in fact. Aesir was slowly getting there.

The testing

After about a year in development, we were ready to proceed with our closed beta, and let me tell you — nothing prepares you for that moment when you first open up your application to other users. The rush of mixed emotions running through you is almost like a mushroom trip.

Naturally there were a lot of bugs, and our closed beta testers were instrumental in helping us identify these bugs and squash them.

We went through several weeks of closed beta, and at the end of it we had a pretty substantial thing to do.

Once all the closed beta testing was completed, it was time to take the application offline start squashing the long list of bugs that we identified. Fast forward a few hard months of bugfixing and internal testing and it was time to announce the open beta, where everyone would be able to participate.

This time around everything was looking a lot more positive and we had a lot more confidence in the application’s stability at this point.

Three months after that, we officially released the application as an MVP in May 2023.

We had to spend all this time in order to ensure that the application is as stable and as bug-free as possible.

Aesir Core features

Fast forward to today and we have a growing community of about 2k members on Discord, and just over 2.4k on Reddit (you’re welcome to join us on there!).

We officially released Aesir in May last year, making it just over 10 months old! Since then, we’ve been focusing on adding new features and improving existing ones. Today, although still very young, Aesir offers some of the best crypto trading bots on the market.

Here are some of the highlights:

Social Hub


The Social Hub shows you the top configurations that other traders have created, along with their overall profitability split by 30, 60 and 90 days. If a configuration is public, users can Clone it and use it themselves with a single click.

Visual Bot Builder


The visual builder takes you through a step by step process, helping you easily build your own crypto trading bot from scratch. It allows you to set the logic and behavior of your trading bot from the amount you spend per trade, to your trailing stop loss and the signals to look for.

The visual builder allows you to choose between 3 main logic layers: Volscan, Computed Indicators and Advanced.

Volscan is basically the volatility scanner of the BVTB that I mentioned earlier in the article. It analyses a % change over a window of time, and buys any coin (or just the ones specified) that reaches that thresholds.

Computed Indicators uses TradingView indicators in order to easily build and act on trading signals. Simply select the indicators you want to analyse, and the bot will place buy orders when some of them return a buy signal.

The Advanced layer allows your to build complex conditional logic based on Indicators or kline data.

Advanced Exit Strategy


A good exit strategy is instrumental for every good trading bot, and we’ve been building some unique exit strategy features to give users an edge.

The first feature we’ve added is simply called Stale Asset Selloff and it lets you select a time limit that when reached, the trading bot will automatically sell stale assets. This works in combination with Trailing Stop Loss and Trailing Take Profit.

Some strategies are only effective if the asset moves in the predicted direction within a certain time window. For instance, trading based on the Golden Cross pattern assumes that the chart will continue to move up.


If the 50 day SMA goes back down below the 200 day SMA, the setup has lost its efficiency and you probably want to close the position.

Stale asset selloff allows you to do just that.

Another way to close down underperforming positions on Aesir is what we call Stop Loss and Take Profit Decay. This lets you gradually reduce your TP and SL in time, so that it becomes tighter, and thus more likely to close.

For instance, if you’ve set your TP and SL to 20% and you have a Decay of 50% every day, you’ll basically reduce your TP and SL in half every day.

Decay is useful when an asset just isn’t really moving at the rate that you’re expecting so automatically decaying your TP and SL, will help that order to close, and free up liquidity so the bot may place other orders.