How aakib10101/vantage-risk works
Vantage Risk is a portfolio-management and quantitative risk analytics web application. A user enters through the browser dashboard or API, authenticates, manages portfolios and holdings, and requests analytics; risk routes obtain portfolio returns before invoking the calculation engine. Market prices are cached in the database and fetched from yfinance when needed. The README documents additional analytics and UI capabilities beyond the sampled implementation. Some subsystem links are based on README architecture documentation because their source was not excerpted.
Main entry points: main.py FastAPI application · routes_risk.py Risk routes · base.py Async DB sessions · routes_auth.py Authentication routes
Components 21
Application entry
- Terminal dashboard
risk_dashboard.html - FastAPI application
app/main.py
API workflows
- Authentication routes
app/api/routes_auth.py - Portfolio routes
app/api/routes_portfolios.py - Securities routes
app/api/routes_securities.py - Risk routes
app/api/routes_risk.py - Auth schemas
app/schemas/auth.py - Portfolio schemas
app/schemas/portfolio.py - Risk schemas
app/schemas/risk.py
Market data
- Price cache
app/services/price_cache.py - Market data provider
app/services/data_provider.py - FX service
app/services/fx_service.py
Portfolio analytics
- Return aggregation
app/services/portfolio_service.py - Risk calculations
app/services/risk_engine.py
Security and storage
- JWT and passwords
app/core/security.py - Application settings
app/config.py - Async DB sessions
app/db/base.py - Domain and cache models
app/db/models.py
Other components
- User / browser
- yfinance
- SQL database
Connections 31
- User / browser → FastAPI application: accesses
README.md - FastAPI application → Terminal dashboard: serves
app/main.py - FastAPI application → Authentication routes: registers
app/main.py - FastAPI application → Securities routes: registers
app/main.py - FastAPI application → Portfolio routes: registers
app/main.py - FastAPI application → Risk routes: registers
app/main.py - Authentication routes → JWT and passwords: uses
app/api/routes_auth.py - Authentication routes → Async DB sessions: queries
app/api/routes_auth.py - Portfolio routes → Market data provider: searches
app/api/routes_portfolios.py - Portfolio routes → Async DB sessions: reads and writes
app/api/routes_portfolios.py - Risk routes → Return aggregation: requests returns
app/api/routes_risk.py - Risk routes → Risk calculations: calculates analytics
app/api/routes_risk.py - Risk routes → Async DB sessions: loads portfolio
app/api/routes_risk.py - Securities routes → Price cache: gets prices
app/api/routes_securities.py - Securities routes → Market data provider: searches and fetches
app/api/routes_securities.py - Return aggregation → Price cache: gets prices
app/services/portfolio_service.py - Price cache → Market data provider: fetches missing data
app/services/price_cache.py - Market data provider → yfinance: requests market data
app/services/data_provider.py - Return aggregation → Domain and cache models: reads holdings
app/services/portfolio_service.py - Price cache → Domain and cache models: reads and stores bars
app/services/price_cache.py - Authentication routes → Domain and cache models: reads and creates users
app/api/routes_auth.py - Portfolio routes → Domain and cache models: manages portfolios
app/api/routes_portfolios.py - Async DB sessions → SQL database: connects
app/db/base.py - Domain and cache models → Async DB sessions: uses base
app/db/models.py - Async DB sessions → Application settings: loads database URL
app/db/base.py - JWT and passwords → Application settings: loads token settings
app/core/security.py - Risk routes → Portfolio schemas: uses models
- Portfolio routes → Portfolio schemas: validates responses
app/api/routes_portfolios.py - Authentication routes → Auth schemas: validates responses
app/api/routes_auth.py - Risk routes → Risk schemas: uses schemas
- FX service → Market data provider: uses provider
app/services/fx_service.py