paymatrix
Full-Stack Architecture · Native Android · Systems · 2026
Flagship shared-expense PWA and native Android app engineered with integer-paise financial arithmetic, Gemini Vision receipt extraction, O(N log N) greedy debt simplification, and zero-trust UPI intent settlement.
Problem
Multi-party expense sharing suffers from three structural engineering failures: IEEE 754 floating-point drift across fractional shares, combinatorial settlement friction where an N-member group faces up to N(N-1)/2 individual transactions, and unsafe payment confirmation flows that naively treat external mobile deep-link returns as proof of settled money.
Approach
paymatrix resolves these directly at the data and architecture layers. All financial calculations execute in integer paise with deterministic remainder allocation, ensuring sum(shares) === total without sub-rupee rounding leakage. A greedy min-cash-flow graph solver collapses net balances into minimal bilateral transfers in O(N log N) time. Receipt digitization uses structured Gemini Vision multimodal parsing with client-side boundary validation, while settlement flows enforce a strict payment boundary: signed upi://pay URI intents and desktop dynamic QRs hand off to payment apps, but transactions remain unconfirmed pending explicit two-party settlement verification.
Features
- Deterministic Integer-Paise Math — Computes all monetary shares in integer paise with deterministic remainder distribution, eliminating binary floating-point roundoff errors across arbitrary split topologies.
- Greedy Graph Debt Simplification — Implements an O(N log N) min-cash-flow pairing pass between net creditors and net debtors, reducing transactional friction by up to 80% without altering individual net positions.
- Zero-Trust UPI Settlement Protocol — Constructs compliant upi://pay intents with dynamic QR fallback. Acknowledges OS return boundaries: transfers remain unconfirmed pending explicit multi-party verification.
- Multimodal Receipt Extraction — Integrates Gemini Vision to parse raw paper receipts into structured JSON schemas, with client-side subtotal verification and proportional tax/tip redistribution.
- Dual-Surface PWA & Native Android — Built on React 19 and Vite with an offline-tolerant Firestore syncing layer, complemented by a native Android runtime (com.paymatrix.app) for low-latency on-device expense entry.
- Real-Time Collaborative Ledger — Bi-directional reactive state propagation across group members with atomic write batches, ensuring concurrent expense additions never corrupt group balance integrity.
Outcome
Available on Google Play for Android and on the web at paymatrixapp.online. Shared-expense tracking brings receipt scanning, precise splits, simplified balances, and user-confirmed settlements into one flow.
Stack
React 19, Kotlin / Jetpack Compose, Firebase, Gemini Vision, Tailwind CSS
Links
Live site · GitHub
All projects · Harshil Patel