Skip to content

Mohitmhatre32/FinRisk_Datathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌊 FinRisk.io: Systemic Risk Intelligence Platform

License: MIT FastAPI React 19 Vite Tailwind CSS

FinRisk.io is a next-generation financial simulation and monitoring platform designed to quantify, visualize, and predict systemic contagion in interbank networks. By blending advanced network topology, predictive machine learning, and behavioral game theory, FinRisk.io offers a comprehensive "Stress Test as a Service" for modern financial ecosystems.


🏗️ Design Vision & Aesthetics

FinRisk.io is built with a "Cyber-Industrial" aesthetic—modern, clean, and highly interactive.

  • Dynamic Glassmorphism: Translucent panels and blur effects for a premium dashboard feel.
  • Vibrant Visuals: Emerald-to-Rose gradients indicating risk levels from healthy to hazardous.
  • Micro-animations: Smooth counting animations, pulsed risk alerts, and interactive graph flows.
  • User-Centric Navigation: A persistent sidebar providing instant access to deep analytics modules.

🚀 Core Features

🕸️ 1. Dynamic Network Simulation

  • Interactive Graph View: Visualize millions in interbank exposures using ReactFlow.
  • Local & Global Views: Toggle between high-level systemic overviews and node-specific "Local Neighborhood" views.
  • Real-time Modifiers: Inject liquidity or simulate partial defaults with instant visual feedback.

🌪️ 2. Shock Propagation & Contagion

  • Cascade Visualization: Watch defaulted debt propagate through the system in real-time.
  • Spectral Stability: Monitor the Systemic Risk Score (Spectral Radius λ_max).
  • Timeline Replay: "Time Travel" through simulation steps to identify the precise moment of systemic failure.

🧠 3. ML Prognostics Engine

  • Inference Intelligence: A Random Forest regressor analyzes 10+ topological features to predict collapse probability.
  • Feature Importance: Understand why the system is at risk (e.g., "Node Degree Variance" vs "Density").
  • Forecast Horizon: Predictive analytics for T+1 to T+3 simulation steps.

🌫️ 4. Fog of War (Information Asymmetry)

  • Realistic Market Opacity: Simulate environments where only direct counterparties are visible.
  • Shadow Node Logic: Backend-driven data masking ensures true information asymmetry for stress-testing transparency.

⚖️ 5. Equilibrium & Game Theory

  • Strategic Analysis: Solve for Nash Equilibrium in the interbank lending game.
  • Payoff Optimization: Analyze how individual bank behaviors (e.g., hoarding liquidity) impact total system welfare.

🤖 6. AI Stability Copilot

  • Strategic Explanations: Gemini AI explains complex graph metrics in human-readable terms.
  • Policy Advisor: LLM-driven regulatory advice based on current systemic stress levels.

🛠️ Technology Stack

Frontend (The Visual Core)

  • React 19 & TypeScript: Typed, high-performance UI foundation.
  • Vite: Lightning-fast build and development environment.
  • Zustand: Lightweight, high-performance state management for simulation data.
  • Tailwind CSS: Utility-first styling with custom themes.
  • ReactFlow: Powerful node-based graph editor for network visualization.
  • Framer Motion: Fluid UI transitions and micro-animations.

Backend (The Calculation Engine)

  • FastAPI & Pydantic: Modern, high-performance Python web framework.
  • NetworkX: Industrial-grade graph algorithms and topology analysis.
  • NumPy & Scikit-learn: Matrix math foundation and ML forecasting models.
  • Google Generative AI: Powering the AI insights and policy guidance.

⚡ Setup & Execution

1. Prerequisites

  • Python 3.10+ (Conda or Venv recommended)
  • Node.js 18+
  • npm (or yarn/pnpm)

2. Backend Orchestration

cd backend
python -m venv venv

# Activation
# Windows:
.\venv\Scripts\activate
# Unix/MacOS:
# source venv/bin/activate

pip install -r requirements.txt
uvicorn app.main:app --reload

Note: Ensure you have configured your .env with a GOOGLE_API_KEY for AI features.

3. Frontend Installation

cd frontend
npm install
npm run dev

The application will be live at: http://localhost:5173


📂 Modular Architecture

├── backend/app/
│   ├── features/
│   │   ├── network/       # Graph generation & logic
│   │   ├── propagation/   # Shock contagious logic
│   │   ├── risk_matrix/   # Heatmap & Var calculations
│   │   ├── ml_engine/     # Scikit-learn models
│   │   └── ai/            # Gemini LLM integration
│   └── core/              # Global configs & math foundations
│
├── frontend/src/
│   ├── pages/             # Layout components (Dashboard, ML, etc.)
│   ├── components/        # Specialized UI modules (Cards, Graphs)
│   ├── store/             # Zustand simulation state
│   └── services/          # Fetch-based API client

🤝 Team CodeSib

Developed for the CodeSib DataThon.

"Quantifying fragility, predicting stability."

About

FinRisk.io is a next-generation financial simulation and monitoring platform designed to quantify, visualize, and predict systemic contagion in interbank networks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors