Files
vault-dash/app/api/routes.py
Bu5hm4nn 00a68bc767 Initial commit: Vault Dashboard for options hedging
- FastAPI + NiceGUI web application
- QuantLib-based Black-Scholes pricing with Greeks
- Protective put, laddered, and LEAPS strategies
- Real-time WebSocket updates
- TradingView-style charts via Lightweight-Charts
- Docker containerization
- GitLab CI/CD pipeline for VPS deployment
- VPN-only access configuration
2026-03-21 19:21:40 +01:00

29 lines
892 B
Python

"""API routes for dashboard and strategy data."""
from __future__ import annotations
from fastapi import APIRouter, Depends, Request
from app.services.data_service import DataService
router = APIRouter(prefix="/api", tags=["api"])
def get_data_service(request: Request) -> DataService:
return request.app.state.data_service
@router.get("/portfolio")
async def portfolio(symbol: str = "GLD", data_service: DataService = Depends(get_data_service)) -> dict:
return await data_service.get_portfolio(symbol)
@router.get("/options")
async def options(symbol: str = "GLD", data_service: DataService = Depends(get_data_service)) -> dict:
return await data_service.get_options_chain(symbol)
@router.get("/strategies")
async def strategies(symbol: str = "GLD", data_service: DataService = Depends(get_data_service)) -> dict:
return await data_service.get_strategies(symbol)