feat: cockpit

This commit is contained in:
OpenSquared
2026-07-23 19:29:32 +02:00
parent d3dc85fee9
commit 6eba6ce5f8
5 changed files with 268 additions and 42 deletions

View File

@@ -256,6 +256,16 @@ def portfolio_risk():
return _sanitize(result)
@router.get("/portfolio-risk-radar")
def portfolio_risk_radar():
"""5-axis risk radar (Concentration/Volatility/Correlation/Exposure/Drawdown) for the
Cockpit's Risk card. Separate from /portfolio-risk above — this one makes live
yfinance calls (per-position volatility + a correlation matrix), heavier and slower,
so it's not bundled into the lighter endpoint other pages may poll more often."""
from services.portfolio_risk import compute_portfolio_risk_radar
return _sanitize(compute_portfolio_risk_radar())
class TradeCheckRequest(BaseModel):
underlying: str
strategy: str