Kasama Chenkaow
2 min readJan 29, 2023

The story of my overnight crypto bot

It has been more than a year since then

I remember that around a year ago, when I was also in the hype of crypto industry, learning manual trading, tried and failed badly.

Until I realized that setting up a bot shouldn’t be that hard.

So, I wrote the below mindmap (kinda casual component diagram) and flowchart of the core logics, and then I made it overnight! (Of course, I have been tuning it a lot after that, but at least after that night, it could be up and trading automatically)

My final tech stack was
- Core code: lambda (NodeJS TS)
- Cron job: cloudwatch invokes lambda every 1 minute
- Metrics: cloudwatch
- Logging: cloudwatch
- Cloudwatch dashboard
- Noti / alert: Line
- Market api: ftx
- At first, I tried the ssm parameter store, then changed to the dynamodb to store configs, but I found later that it’s a bit overkill, so I removed it
- Backtesting: elasticsearch/kibana docker local containers (I didn’t do this at the beginning, which was a big mistake)
- Repo / CICD: Github
- IaaC: Serverless framework

This solution was almost fit in the free-tier (I got charged less than 5$ a month from using KMS (key management system), which was used behind the scenes in many services).

I was running / tuning it for more than 9 months and it was giving great results.

Until the dead came to FTX, and since my solution was super dependent to it so it also died that day with all the profit gone with it

I hope one day I’ll have free time to refactor and revamp it again! 😅

performance