feat: add remaining 5 endpoints (VWAP, relative rotation, fred-regional, primary dealer)

Complete all 67 planned endpoints:
- VWAP and Relative Rotation technical indicators
- FRED regional data (by state/county/MSA)
- Primary dealer positioning (Fed data)
This commit is contained in:
Yaojia Wang
2026-03-19 17:31:08 +01:00
parent 87260f4b10
commit 615f17a3bb
4 changed files with 111 additions and 0 deletions

View File

@@ -141,6 +141,35 @@ async def get_central_bank_holdings() -> list[dict[str, Any]]:
return []
async def get_fred_regional(
series_id: str, region: str | None = None,
) -> list[dict[str, Any]]:
"""Get geographically disaggregated FRED data (by state, county, MSA)."""
try:
kwargs: dict[str, Any] = {"symbol": series_id, "provider": "fred"}
if region:
kwargs["region_type"] = region
result = await asyncio.to_thread(
obb.economy.fred_regional, **kwargs
)
return to_list(result)
except Exception:
logger.warning("FRED regional failed for %s", series_id, exc_info=True)
return []
async def get_primary_dealer_positioning() -> list[dict[str, Any]]:
"""Get primary dealer net positions in treasuries, MBS, corporate bonds."""
try:
result = await asyncio.to_thread(
obb.economy.primary_dealer_positioning, provider="federal_reserve"
)
return to_list(result)
except Exception:
logger.warning("Primary dealer positioning failed", exc_info=True)
return []
async def get_fomc_documents(year: int | None = None) -> list[dict[str, Any]]:
"""Get FOMC meeting documents (minutes, projections, etc.)."""
try: