FTL
Engineering FTL
A live football trading game for the 2026 World Cup. Virtual shares of footballers, prices from real matches. Four posts on how the engine actually ran.
4 parts · 56 min
- 01 0.5ms atomic trades with zero distributed locks: building an AMM inside Redis Lua Every trade touches a wallet, a position, a price, and a leaderboard. Four ways to be half-done. We used zero locks to make that impossible. 14 min 14 min
- 02 Streaming live prices to 50K users on a $200/month budget Staging was burning ₹1,234 a day. Every dashboard was green. Here's how we streamed live prices to 50K phones on a $200 credit. 14 min 14 min
- 03 Redis for speed, Postgres for truth: building a crash-safe write-behind layer We silently dropped 4,364 price ticks. No error, no alert, green dashboards. Here's the design where dropping is impossible by construction. 12 min 12 min
- 04 Your position gapped while you were offline: liquidation fairness via offline replay A phone is off for eight minutes. A goal gaps the price. Their position should have died. At what price do you close it? 16 min 16 min