feat: saxo connector

This commit is contained in:
OpenSquared
2026-07-18 21:07:17 +02:00
parent d359480302
commit b986c8c525
4 changed files with 38 additions and 13 deletions

View File

@@ -253,7 +253,10 @@ def snapshot_options_chain(symbol: str, target_days: int = 30) -> List[Dict[str,
space = get_option_space(root_uic)
legs = _extract_option_legs(space)
snapshot = _snapshot_via_subscription(root_uic, asset_type=instrument["asset_type"] or "StockOption")
subscription = _snapshot_via_subscription(root_uic, asset_type=instrument["asset_type"] or "StockOption")
# The POST response is the streaming-subscription envelope (ContextId/ReferenceId/Format/
# RefreshRate/InactivityTimeout/State) — the actual chain payload is nested under "Snapshot".
snapshot = subscription.get("Snapshot") or subscription
spot = _first(snapshot, "UnderlyingSpotPrice", "Spot", "UnderlyingPrice")
snapshot_date = date.today().isoformat()