feat: saxo

This commit is contained in:
OpenSquared
2026-07-19 00:55:46 +02:00
parent 38d9ddfd53
commit d4fb15ca9a
8 changed files with 205 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ from pydantic import BaseModel
from services import saxo_auth
from services.saxo_scheduler import get_watchlist, set_watchlist, get_snapshot_minutes, set_snapshot_minutes, run_snapshot_pass
from services.database import (
get_saxo_snapshots, get_saxo_snapshot_symbols,
get_saxo_snapshots, get_saxo_snapshot_symbols, dedupe_saxo_snapshots,
get_saxo_catalog, get_saxo_catalog_summary, upsert_saxo_catalog_rows,
)
@@ -148,6 +148,13 @@ def snapshot_now(symbol: str):
return {"symbol": symbol.upper(), "rows_saved": len(rows)}
@router.post("/history/dedupe")
def dedupe_history():
"""Collapses consecutive stored snapshots that carry the same bid/ask/mid/IV as the row
right before them — cleans up bloat from before save-time dedup existed."""
return {"rows_deleted": dedupe_saxo_snapshots()}
@router.get("/quote/{symbol}")
def quote(symbol: str, asset_type: str = Query("FxSpot")):
"""Basic (non-options) price test — isolates whether NoDataAccess is options-specific