HLD-329·Payments & Ledger
Hard · 1,500 ptsMulti-Currency Merchant Clearing, Rolling Reserve & Payout Engine
Design a Stripe Connect / Adyen-style merchant clearing and T+2 payout settlement engine that aggregates millions of captured charges, refunds, FX conversions, and chargeback rolling reserves into balanced daily ACH/SEPA payout batches.
Max p99
≤ 70 ms
Availability
≥ 99.7%
Budget
≤ $9,800
Functional Requirements
- FR-1POST /v1/ledger/postings — Appends idempotent double-entry debit/credit journal lines across pending, reserve, and available merchant sub-accounts.
- FR-2GET /v1/merchants/{merchant_id}/balance-summary — Serves real-time available, pending-clearing, and rolling-reserve balances per currency.
- FR-3POST /v1/merchants/{merchant_id}/payouts — Locks available balance, mints idempotent bank rail payout instruction, and handles async return reversals.
- FR-4Must enforce RPO = 0 immutable double-entry accounting (zero duplicate payouts or penny drift) across primary ledger crashes.
Workload Profile
Continuous Capture Clearing48,000 Balance & Reconciliation Read RPS / 12,000 Journal Posting Write RPS
UTC Cutoff T+2 Payout Sweep132,000 Read RPS / 29,000 Journal & Payout Write RPS
Active Working Set44 GB hot merchant sub-account balances & idempotency keys
Audit InvariantStrict serializable double-entry balance lock + RPO = 0 quorum persistence
Consistency Model
Serializable double-entry posting + atomic available-balance debit on payout creation with synchronous/quorum replication.
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words