Real-Time Transaction & Balance Locking Engine — 2025

Tech Stack
Designed wallet management, live odds updates, and settlement logic under high concurrency.
2025 • Real-time Systems Demo
YatiBet is a comprehensive real-time betting simulation platform developed to demonstrate advanced transaction handling, concurrency control, and settlement workflows in a high-stakes environment. The problem it solves is providing a safe, educational sandbox to model the complex financial mechanics required in live betting applications—specifically addressing race conditions, atomic operations, and real-time state synchronization across distributed clients. The system's architecture leverages Next.js on the frontend and Django with PostgreSQL and Redis on the backend. A core architectural requirement was ensuring absolute data integrity for financial transactions. I utilized PostgreSQL's robust ACID compliance, implementing atomic database transactions with row-level locking (using SELECT ... FOR UPDATE). This guarantees that user wallet balances are strictly locked during a bet placement, preventing any possibility of double-spending or race conditions when multiple bets are placed simultaneously. Live match odds and system events are pushed to connected clients via WebSockets, managed by Django Channels and a Redis backing store. One of the most complex challenges was designing the automated settlement pipeline. When a match concludes, the system must process thousands of pending bets, calculate payouts based on locked odds, and update wallet balances simultaneously without locking up the entire database. I solved this by implementing batch processing strategies and celery-backed background tasks that handle settlements asynchronously. The outcome is a highly resilient, real-time platform that successfully models enterprise-grade financial transaction safety and distributed system synchronization.
What I Built
Key Highlights
Balance locking and rollback mechanisms prevent double-spending.
Real-time IPL match odds streamed via WebSockets.
Automated bet resolution and payout processing post-match.




Interested?
A real-time transaction engine built with Next.js, Django, and Redis. Features atomic wallet balances, row-level locking (SELECT FOR UPDATE), WebSocket odds streaming, and automated settlement pipelines.