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
This commit is contained in:
28
app/api/routes.py
Normal file
28
app/api/routes.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user