feat: saxo

This commit is contained in:
OpenSquared
2026-07-18 22:20:33 +02:00
parent b0b7f9bfda
commit 0d3a6a6fad
5 changed files with 93 additions and 1 deletions

View File

@@ -242,6 +242,15 @@ def _snapshot_via_subscription(uic: int, asset_type: str = "StockOption") -> Dic
return snapshot
def debug_chain_raw(symbol: str) -> Dict[str, Any]:
"""Returns the raw (unparsed) options-chain subscription response for one symbol —
diagnostic only, used to pin down exactly where Mid/Greeks/Spot live in Saxo's real
payload instead of guessing field names blind."""
instrument = resolve_instrument(symbol)
subscription = _snapshot_via_subscription(instrument["uic"], asset_type=instrument["asset_type"] or "StockOption")
return {"instrument": instrument, "raw": subscription}
def snapshot_options_chain(symbol: str, target_days: int = 30) -> List[Dict[str, Any]]:
"""
Returns normalized rows ready for services/database.save_saxo_snapshot_rows: