Building a Pure Small Savings Bank in Public.
Engineering notes, architectural trade-offs, and progress logs as we build
The Monsoon Bank: a strictly retail small-savings bank ($1,000/mo KYCed exchange inflow cap, unrestricted outgoing spending) powered by ring-fenced 14%–16% APR proprietary trading margin facilities.
End-to-End System Blueprint
How our Alloy-6-proved specification, 10-library symbolic TypeScript toolchain, 5 on-chain Solana Anchor programs, and off-exchange MPC prop sub-accounts work together.
Asymmetric 2-of-2 Transit Wallet
Every saver gets an isolated, deterministic Solana PDA co-owned by Key 1 (User Hardware WebAuthn Passkey) and Key 2 (Bank Enclave HSM Policy Daemon).
- Strict Inflow Gate: Only accepts transfers from the customer's verified KYCed exchange (with a 48h re-bind timelock) up to a hard
$1,000/monthSmall Savings cap. - Unrestricted Gasless Outflow: Customers freely send or spend interest and principal to any self-custody wallet, card, POS merchant, or CEX with zero SOL gas fees—screened in
<15msagainst multi-hop OFAC peel chains.
TypeScript BIGINT Double-Entry Ledger
Built on Node.js 22 LTS + TypeScript + PostgreSQL 16 (Drizzle ORM) with SERIALIZABLE isolation and strict principal/interest sub-account segregation.
- Zero Floating-Point Math: All balances use 6-decimal atomic
bigintunits (1_000_000n = $1.00) with invariantDebits == Creditsconservation. - Hard Reserve Buffers: Enforces a minimum
20%liquid US T-Bill/Cash buffer and a15%First-Loss Bank Equity Reserve at all times.
8.0%–16.0% Prop Margin Sub-Accounts
Senior fixed-rate institutional credit facilities settled via Off-Exchange MPC Custody (Copper ClearLoop / Fireblocks Off-Exchange) with a hard <= 35% single-venue concentration cap.
- Zero Borrower Withdrawal Custody: Borrowers receive trade-only API keys restricted to Top-10 liquid pairs (
BTC,ETH,SOL). - 25%–30% First-Loss Collateral: Prop house posts
>= 25%cash margin first to absorb any drawdown. - 110% Halt / 105% Auto-Liquidation: Sub-second risk loop halts new orders at
< 110%and deterministically revokes trade keys & liquidates to cash at<= 105%health.
Alloy 6 Proofs & CHR.ts Policy Engine
All 42 regulatory, accounting, and security invariants (9 Pillars) are mathematically proved in Alloy 6 (SAT4J) before backend code is written, then compiled 1-to-1 into CHR.ts.
- Zero Counterexamples: 5 Non-Vacuity Witnesses (
SAT) and 28 Exhaustive Safety Assertions (UNSAT), including Linear Temporal Logic (LTL) flash-crash liquidation proofs. - Sub-15ms Runtime Gate:
@monsoonbank/complianceevaluates all 42 invariants and multi-hop OFAC graph closures in<15msbeforeKey 2co-signs any transaction.
10-Library Symbolic TypeScript Stack
Powered by our zero-dependency neuro-symbolic TypeScript toolchain for deterministic banking operations, treasury optimization, and regulatory auditability.
- Self-Healing Sagas & DAGs (
step.ts): Orchestrates reverse-order compensation on partial settlement failures (step.saga) and sub-200ms parallel liquidation DAGs (step.auto). - Constructive Audit Proofs: Combines
eyeprolog.ts(ISO Prolog +CLP(Z)Mermaid proof trees),yalps.ts(MILP treasury optimizer),temporal.ts,dcg.ts,clsp.ts, andapl.ts.
Zero-Omnibus & On-Chain Circuit Breakers
Engineered specifically so a state-sponsored DevOps laptop or backend container compromise can steal $0 of customer funds.
- Zero Omnibus Hot Wallets & Delegation Ban: Per-saver isolated PDAs require physical
Key 1hardware signatures;EIP-7702(SetCode), SPLApprove, andSetAuthorityare categorically rejected. - On-Chain Rust Velocity Breaker: Solana program automatically pauses withdrawals if hourly outflow exceeds
2%of TVL, backed by4-of-6Squads hardware multisig +72htimelock and 100% issuer-freezable Tier-1 assets (USDC,USDT,PYUSD,EURC,PAXG).
Net Interest Margin & "Yield-as-CAC" Sandbox
Test how The Monsoon Bank generates a 3%–4% net profit spread while paying early small savers up to 8.85% APY (SBI MCLR parity)—and remains cash-flow positive even if prop borrowing drops in a bear market.
At $1,000/mo max deposit, $100M AUM represents ~20,000–40,000 granular retail savers with zero whale bank-run concentration risk.