US Credit Market Simulator
Build an interactive web-based credit simulator that models the real-world US consumer credit market to help users understand how credit systems work.
Overview
Create a comprehensive educational simulator featuring borrowers, lenders, credit bureaus, loan servicing, securitization, investors, and regulatory compliance. The simulator should demonstrate credit scoring, loan origination, payment flows, delinquency, and the secondary market.
Implementation Steps
1. Research Phase
Before building, search the web and gather information about:
US consumer credit system mechanics (FICO scoring, credit reports)Credit card and loan underwriting processesLoan servicer operations and delinquency managementAsset-backed securities and securitizationRegulatory framework (ECOA, FCRA, TILA, Dodd-Frank)Credit bureau reporting latency and data flowsInvestor behaviors in credit markets2. Architecture Setup
Review the provided TypeScript credit system reference implementationDesign a web-based architecture (React/Next.js recommended)Plan state management for simulation entities (borrowers, loans, bureaus, investors)Design event-driven architecture with eventual consistencyCreate domain models for all credit market participants3. Core Domain Entities
Implement these key components:
**Borrowers:**
Profile with income, expenses, cash on handCredit history and bureau recordsPayment behavior simulation**Credit Products:**
Credit cards, personal loans, auto loans, mortgages, BNPLAPR calculation based on riskOrigination fees and terms**Lenders/Originators:**
Underwriting logic using credit score and debt-to-income ratiosRisk-based pricingTarget return on assets (ROA)**Credit Bureaus:**
Tradeline storage and reportingDynamic credit score calculation (utilization, payment history, account age)Delayed reporting simulation (eventual consistency)**Servicers:**
Monthly payment processingDelinquency tracking (30/60/90+ days late)Default managementBureau reporting with realistic latency**Securitization:**
Loan pooling into securitiesCoupon payments to investorsPrincipal and interest waterfalls**Investors:**
Cost of capital expectationsSecurity subscriptionsReturn calculations**Regulators:**
ECOA compliance (Equal Credit Opportunity Act)FCRA adverse action notices (Fair Credit Reporting Act)TILA disclosures (Truth in Lending Act)Event logging for audit trail4. Event-Driven System
Implement asynchronous message bus:
Event scheduling with delivery delaysDomain events: credit applications, disbursements, payments, delinquencies, bureau updates, securitizationsEvent handlers for each participant typeTime-step simulation (monthly ticks)5. Web Interface
Build interactive UI with:
**Simulation Controls:**
Start/pause/reset buttonsSpeed controls (1x, 5x, 10x)Month counter and timeline**Dashboard Views:**
Borrower panel: credit score trends, loan status, payment historyLender panel: portfolio performance, default rates, ROABureau panel: score distribution, reporting latency visualizationInvestor panel: returns, security performanceRegulator panel: compliance event log**Interactive Features:**
Click borrowers to see detailed credit reportsClick loans to see amortization schedulesClick securities to see collateral poolsScenario controls: trigger defaults, adjust income, apply for new credit**Visualizations:**
Credit score histogramsDelinquency funnel chartsCash flow waterfalls for securitizationsTime-series charts for portfolio metrics6. Educational Features
Add learning enhancements:
Tooltips explaining credit concepts"What-if" scenario builderGuided tutorial mode walking through credit lifecycleGlossary of terms (APR, DTI, utilization, tradeline, etc.)Real-world data comparisons (e.g., "Average US credit score: 716")Quiz mode to test understanding7. Realistic Behaviors
Implement nuanced logic:
Probabilistic default modeling based on cash flow stressIncome volatility for borrowersSeasonal spending patternsCredit score impact decay over timePayment hierarchy (borrowers pay high-APR debts first)Prepayment behaviorsCredit limit increases for good payers8. Advanced Features (Optional)
Consider adding:
Multiple originator strategies (prime vs subprime lenders)Secondary market trading of securitiesCredit card revolving balances vs term loansCo-signer and joint account modelingBankruptcy simulationFraud/identity theft scenariosRegional economic shock eventsTechnical Recommendations
**Frontend:**
React with TypeScriptChart library (Recharts, Chart.js, or D3.js)State management (Zustand or Redux)Styling (Tailwind CSS)**Simulation Engine:**
Deterministic PRNG for reproducibilityImmutable event logSnapshot/restore for save statesWorker threads for heavy computation**Data Persistence:**
LocalStorage for saved simulationsExport/import JSON scenariosShare simulation states via URL parametersConstraints
Keep initial loan amounts realistic ($500-$50,000 range)Credit scores bounded 300-850APR capped at 60% (some states have usury laws)Ensure regulatory events logged for all credit decisionsMaintain eventual consistency between servicer actions and bureau updatesCalculate returns accurately (IRR for investors, ROA for lenders)Success Criteria
The simulator should:
1. Accurately model credit score changes based on payment behavior
2. Demonstrate how late payments cascade into defaults
3. Show how securitization transfers risk to investors
4. Illustrate regulatory compliance requirements
5. Help users understand credit utilization, payment history, and account age
6. Run smoothly for 100+ simulated months
7. Be visually engaging and intuitive for non-experts
Example User Journey
1. User starts simulation with 5 borrowers, 2 lenders, 1 bureau
2. Borrowers apply for credit cards and personal loans
3. System shows underwriting decisions with APR explanations
4. Monthly payments process, credit scores update (with delay)
5. One borrower loses income, starts missing payments
6. User watches score drop and delinquency progress
7. Lender securitizes performing loans
8. Investor subscribes and receives monthly distributions
9. User experiments: "What if this borrower paid down 50% balance?"
10. Simulation rewinds and shows improved score trajectory
Build this simulator to be both technically accurate and pedagogically effective, making the invisible machinery of consumer credit visible and understandable.