feat: curve regime

This commit is contained in:
OpenSquared
2026-07-25 09:23:26 +02:00
parent 3addea6850
commit ad7ab35d1d
8 changed files with 177 additions and 31 deletions

View File

@@ -66,6 +66,16 @@ def watchlist_quotes():
return {"items": items}
@router.get("/curve-regimes")
def watchlist_curve_regimes():
"""Cached Curve Regime classification (services.curve_regime) per Watchlist instrument —
refreshed on the same cadence as the wavelet cache (services.wavelet_scheduler), not a
live call. Every Watchlist ticker is represented, with a null-regime placeholder for any
never successfully classified yet."""
from services.database import get_all_curve_regime_cache
return {"items": get_all_curve_regime_cache()}
_HISTORY_PERIODS = {
"1w": {"yf": "5d", "days": 7},
"1m": {"yf": "1mo", "days": 30},