Karura (crypto bot)

Home > Portfolio > Karura

What was Karura?

This will be a bit of a read, but in 2020 I had a burnout which lasted until early 2022. I got interested in cryptocurrencies and the stock market as I didn’t have the energy to apply myself to real full-time work. After I got released from my contract in 2021 I started writing this crypto bot to help me understand what is going on behind the flashy charts.

A crypto bot starting up...

Karura was a bot that could pull info from a crypto exchange, run calculations and then spit the results out on Telegram. It never progressed to the point where it could buy and sell on its own. But writing it was a trip! I learned about indicators and API’s and subtle intricacies of certain coins.

The source code can be found on my GitHub.

The nerdy bit

Like Majorak, Karura was written in PHP. The goal was to learn and to get back into the swing of things after not doing much for close to one-and-a-half years. I decided not to use a framework, as I figured that it wouldn’t be needed. In hindsight it was probably easier to go with one.

Pulling info from Kraken, my exchange at the time, turned out to be very difficult as they went down often. After realizing this I even implemented an automatic reconnect feature to help remedy this. It wasn’t enough and I switched to Binance, which never skipped a beat.

Likewise I also did not use PHP’s trader extension… Preferring instead to dig deep into the algorithms behind the indicators like RSI or support & resistance. This turned out to be a good decision as I learned a lot about optimizing and even multithreading (which was overkill and never made it in!) Other madness soon followed. I realized that looking at a screen is really boring and I’d like to take it on the go…

Deciding on Telegram, I had rough prototype code running and sending messages to my phone in intervals decided on by me.

And… What then?

It worked! Really well! It ran for over 4 months without pause. Eventually I learned to do what I had told the bot to do so it became obsolete. To this day I find the code to be written really well. I can take bits out and plop them in other projects and it still works flawlessly.