Players call whether BTC/USD will be higher or lower when the round ends: +1 for a right call, −1 for a wrong one. The React 19 client streams live Coinbase prices over a WebSocket; the backend is serverless AWS - CloudFront, API Gateway, one Lambda per route, DynamoDB and SQS - all defined in a single CDK stack.
Most of the engineering goes into fair, exactly-once settlement: the server stamps the time and fetches the price itself, a delayed SQS message is the round clock, and conditional DynamoDB writes mean nothing the browser sends can change a result.
Highlights
- A delayed SQS message is the game clock - no cron, no polling.
- Exactly-once settlement through conditional DynamoDB writes; integer cents end to end.
- Least-privilege CDK with one Lambda per route; one CloudFront origin, so no CORS.
- A React 19 client on a live Coinbase WebSocket, charted with lightweight-charts.
- One zod wire contract shared by the client and the Lambdas.
- Three leaderboards, candle replays, queued calls and Shift + ↑ / ↓ shortcuts.
At a glance
- Role
- Creator & sole developer
- Years
- 2026
- Source
- github.com/afmoleirinho96/btc-predictor
- Live
- d24sx7p5i55akg.cloudfront.net
- BTC ticks over WebSockets
- Real-time
- serverless, all in CDK
- 100% AWS
- HTTP routes + SQS resolver
- 12 + 1
- Lambda per route
- 1
Stack
- TypeScript
- React 19
- Vite
- TanStack Query
- Zod
- WebSockets
- AWS CDK
- Lambda
- SQS
- DynamoDB
- CloudFront
- GitHub Actions
Built with TypeScript.