Building a Fiat & Crypto Settlement Hub: Java Design Patterns by Example
Building a real Java payment and wallet platform from scratch, and identifying design patterns naturally along the way.
People learn things by identifying and understanding patterns in what they do day to day. Yet almost every design pattern book or tutorial works backwards. It hands you a pattern name first, shows a diagram, and forces a toy example around it.
That rarely sticks. In this series, we are doing it the natural way: building one real system together from scratch, solving each engineering problem cleanly as it comes up, and then stepping back to recognize and label the pattern we just used.
Animal extends Pet textbook before building anything real.The Running Domain (Learn It Once)
Instead of resetting to a new toy example every week, every post builds on the same product: a Multi-Tenant Fiat & Crypto Settlement Hub. Partner fintechs share one platform to hold fiat and stablecoin/crypto balances, calculate fees, and settle transfers across bank/card gateways and blockchain RPC nodes.
You only need to learn five core concepts once:
- Tenant: A partner business or fintech app using the platform (
tenantId). - Wallet: Holds fiat (
USD,LKR) or crypto (USDC,ETH) balances, separatingavailablefromlockedfunds. - Transfer: A deposit, payout, or wallet-to-wallet settlement with fees, FX/gas quotes, and lifecycle states.
- Rail: The external network moving funds, such as a REST card/bank gateway or a blockchain JSON-RPC node.
- LedgerEntry: The append-only record explaining every single cent or token change.
Project Roadmap
The Settlement Hub sits at the center, surrounded by every milestone and design pattern built on top of it. Click any tile below to jump straight to that blog post.
Settlement Hub Milestones
How Every Blog Post Works
Each blog post follows four focused steps without long trial-and-error detours:
- The situation: A real requirement in the Settlement Hub.
- What we need to write: The behavior, constraints, and edge cases we need to handle.
- Writing it cleanly: Building the solution step by step in Java and justifying why we structured the code that way, without naming any pattern upfront.
- Spot the pattern: Stepping back to look at the shape of the code, naming the pattern, and calling out its trade-offs and when it would be overkill.
Follow Along in the Repo
Every post maps directly to real, compiling commits in the companion Java repository (modern Java LTS):
- Repository: github.com/chandimab/fiat-and-crypto-settlement-hub
- Commit convention:
[Phase] - [Milestone] - Descriptionso every milestone stays easy to trace ingit log.
Bookmark this page. Every new blog post links back here, and this graph updates as soon as each milestone goes live.