Regulated Fintech & Multi-Platform Chitfund Auction Platform
End-to-end financial transaction platform: web portal, two native mobile applications, state-machine backend, and automated ledger settlement engine.
Unified 3 client surfaces (Web, Subscriber iOS/Android, Agent App) on a single deterministic API.
Zero-drift double-entry ledger state machine with strict ACID transactional invariants.
Sub-150ms auction bidding cycle processing under concurrent real-time subscriber loads.
Engineering Breakdown
Executive overview with technical depth. Scroll for full architecture details.
Situation
A financial services operator running an offline, highly regulated peer-to-peer savings and auction (chitfund) system needed a complete digital transformation. The business involved scheduled multi-party bidding rounds, strict payment reconciliation, and decentralized field cash collections — all managed through manual processes and paper records.
The initiative demanded end-to-end engineering ownership: architectural discovery, financial ledger modeling, cloud infrastructure design, a web operations portal, and two distinct mobile applications for subscribers and field agents.
Problem
The core challenge was modeling a complex, regulation-sensitive financial workflow as reliable software:
-
State Machine Rigor: Auctions operate on strict finite-state phases (Bidding Open, Proxy Bids Evaluated, Winner Selected, Verification, Payout Approval). Invalid state transitions or concurrent double-bids would violate financial compliance. There was no tolerance for race conditions or data inconsistency.
-
Offline-Tolerant Field Workflows: Field agents collect installment payments in areas with intermittent connectivity. Transactions required deterministic local queuing with idempotent server synchronization. A missed or duplicated sync could corrupt the ledger.
-
Double-Entry Financial Invariants: All balances, installment receipts, commission deductions, and prize disbursements had to be modeled as immutable debit/credit journal entries ensuring the fundamental accounting invariant:
SUM(debits) - SUM(credits) == 0. -
Multi-Surface Consistency: Three distinct client applications (web admin portal, subscriber mobile app, agent field app) needed to share a single source of truth with strict API contracts and no drift between surfaces.
Constraints
- Financial regulatory compliance required immutable audit trails
- Field agents operated in low-connectivity environments
- Concurrent auction bids required serialized, conflict-free processing
- The system handled real money — zero tolerance for ledger discrepancies
- Two mobile platforms plus a web portal needed to stay in lockstep
Architecture
+-----------------------------------------------------------------------------------+
| CLIENT SURFACES |
| [ Web Admin / Ops Portal ] [ Subscriber Mobile App ] [ Agent Field App ] |
+------------------------------------------+----------------------------------------+
| HTTPS / WSS
v
+-----------------------------------------------------------------------------------+
| SECURE EDGE GATEWAY & AUTH |
| - Cloudflare Edge Security & WAF |
| - JWT Session Validation & Biometric Mobile Tokens |
+------------------------------------------+----------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| CORE TRANSACTIONAL SERVICES |
| +------------------------+ +------------------------+ +---------------------+ |
| | Auction Engine | | Double-Entry Ledger | | KYC & Verification | |
| | - Time-windowed rounds | | - Strict ACID post | | - Document pipeline | |
| | - Concurrency locks | | - Invariant validator | | - Operator reviews | |
| +------------------------+ +------------------------+ +---------------------+ |
+------------------------------------------+----------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| PERSISTENCE & REPLICATED INFRASTRUCTURE |
| [ Primary PostgreSQL (ACID) ] <---> [ Edge Cache & Read Replicas ] |
+-----------------------------------------------------------------------------------+
Key Engineering Decisions
1. Finite State Machine for Auction Lifecycles
Rather than relying on loose cron jobs or untyped database status columns, auction rounds were modeled as an explicit state machine with guarded transitions:
- State transitions execute inside serialized database transactions
- Bids are validated against participant eligibility rules, maximum discount caps, and timestamp windows
- Any conflicting concurrent bid triggers deterministic transaction retries with pessimistic row locks on the auction record
This eliminated an entire class of race conditions that plague financial bidding systems.
2. Double-Entry Immutable Ledger
Financial integrity was guaranteed by strictly avoiding in-place balance updates:
- Every payment, penalty, dividend, and payout creates an atomic journal entry with balanced debit and credit legs
- User balances are derived from indexed ledger views, eliminating race conditions and rounding drift
- Automated daily reconciliation jobs verify ledger invariants against payment webhooks
The ledger passed end-to-end accounting audits with 0% drift across all test and live bidding cycles.
3. Multi-Platform Mobile Architecture
To ensure high performance and maintainable shared code:
- Two focused mobile experiences: a consumer app for subscribers (KYC, auction bidding, passbook, online installments) and an agent app (subscriber onboarding, offline receipt generation, field collections)
- Shared TypeScript validation schemas and API clients ensured contracts remained in lockstep between web and mobile
- Offline-tolerant workflows with idempotent synchronization handled intermittent field connectivity
Implementation
- Edge-First Security: Deployed behind Cloudflare edge security rules with Turnstile verification on sensitive endpoints and rate limiting on bidding routes
- Biometric & Token Refresh: Mobile authentication uses short-lived JWT access tokens paired with cryptographically secure biometric refresh tokens stored in secure device enclaves
- Automated Settlement Pipelines: Scheduled batch jobs calculate subscriber dividends, compute operator commission, generate electronic receipts, and trigger automated payout approvals
What We Learned
Financial systems demand a different engineering posture than typical web applications. The cost of a race condition isn’t a UI glitch — it’s money in the wrong account. Every design decision was filtered through: “What happens if this runs twice? What happens if this runs concurrently? What happens if the network drops mid-request?”
The state machine approach to auction lifecycles was the single most important architectural decision. It transformed an ambiguous business process into a deterministic system with clear, testable invariants at every stage.
Facing a similar engineering challenge?
Stonewasp provides end-to-end engineering ownership for complex software systems. Let's discuss your project.