Simple Stock Bot End-of-Life

After over 5 years my Simple Stock Bot is being sunset. The popular Telegram and Discord Bots will soon no longer work.

Simple Stock Bot logo edited so that the Discord and Telegram Icons are upside down with a skull above them
Honestly the bots had a great run

Me and my friends were huge fans of Google Allo, specifically its integration with the stock and cryptocurrency markets. Bringing live market data directly in our group chats majorly enhanced related conversations. Allo was very popular and loved by users so of course Google axed it, Rest in Peace. Once its end-of-life was announced my group chat began searching for a new home.

So, in 2018 in my dorm room I started working on a Discord chat bot that could help bridge some of the gaps left by losing access to the Google Assistant in our chats. At that point the bot API was very open and I don't think there were any privileged endpoints. However, Discord sucks if you only goal is a group chat with friends. So the group went down with the USS Allo ⛴️, and when it finally went offline we made the last second judgement call to move to Telegram. With that Simple Stock Bot was born.

Telegram is an incredible app for group chats and for bot development. I liked the idea of the stock market bot, so I decided to refactor the codebase so that it could support multiple frontends with a single backend that handled routing requests to the correct market API. Something like this:

flowchart LR subgraph frontend [Frontends] telegram(Telegram) discord(Discord) end subgraph common_code [Common Code] symbol_router(Symbol Router) end subgraph cloud [The Cloud] backend1[Stock Market API Backend] backend2[Crypto API Backend] end telegram --> symbol_router discord --> symbol_router symbol_router --> backend1 symbol_router --> backend2 classDef frontend fill:#f9f,stroke:#333,stroke-width:2px; classDef common_code fill:#ccf,stroke:#333,stroke-width:2px; classDef cloud fill:#cff,stroke:#333,stroke-width:2px;

This worked really well early on, and let me easily test new data providers. I had high hopes of adding different frontends like Twitter, Reddit, maybe even selling dashboards of real-time bot usage, but keeping up with the demands of my Telegram and Discord users proved plenty of work for me. The project quickly grew to about 15k monthly active users completely organically which made getting stock market data really difficult. I found that most of my users were from southeast Asia. Why they care about American markets I have no idea, but a lion's share of usage was for US stock market data.

Back then, the market data was costing me $30-$50 a month which was a stretch but reasonable enough that the occasional donor was making me cut just about even. Luckily cryptocurrency data at that time was very high quality and free so my only other cost was servers. I was mostly able to run for free off of my Digital Ocean referral program at that time. I put in a lot of effort to make sure it was seamless for anyone else to run their own bot so that referral did quite well. Seeing this referral program do so well made me happy thinking that I was introducing people to running their own service which was one of the most rewarding parts of this project.

The first big hit to the product was Discord constantly changing its API, and making me apply for certain permissions. This led to a lot of downtime since I would have to wait for my dependencies to update and then I would have to go through the application process and update my code. To be fair the application process was always very quick and this is mostly on me for not keeping up to date, but the instability caused a lot of headaches for me and the maintainers.

Eventually the bots main interaction with users, putting a $ stock ticker in any message and getting a price, was blocked behind a privileged intent that they wouldn't grant me access to. To be fair this required letting the bot read every single message in any Discord server that the bot was part of which is a lot of data for bad actors, but they weren't interested in if I was actually storing the data.

Unfortunately, I am denying your Message Content Privileged Intent request. This is because we are only providing access to our privileged gateway intents to power unique, compelling, user-facing functionality, and we do not believe your use-case meet this criteria.

This change, while not totally unreasonable, pretty much killed my Discord userbase. Shortly after the maintainer for eventually burned out pretty hard and ended up killing the project: The Future of This wasn't very encouraging for me since I was feeling the same fatigue towards working Discord, and while I was able to switch to a fork, it was one of the final updates I made to make the bot work on Discord. It still mostly works today I imagine its days are numbered.

The final nail in the coffin for the bots was the sharp price increase in stock market data. I was using IEX Cloud for a long time who offered a high quality, very reasonably priced service. To switch my bot back to their service today would cost a whopping $2700 per month. Still cheaper than most of the competition but well beyond a hobby project. There are alternatives like the Yahoo Finance API, or doing web scraping, or even using an API with personal licensing. However, I think all of those are going to be impossible to maintain long term, and breaking a terms of service with something this valuable is scary.

Crypto data has similar woes. The Coin Gecko API is starting to be very restricted, licensing no longer allows commercial usage for free, and I've noticed a degradation in their service.

While it's disappointing to say goodbye to this project, I'm incredibly proud of what I accomplished. Building a service that reached so many people and taught me so much about software development has been an amazing experience. This project could likely thrive as a proper startup or company, but I have time for neither. For now, it's time to explore new ideas, but I'll always cherish the journey of Simple Stock Bot and the community it created.