feat: sexo history

This commit is contained in:
OpenSquared
2026-07-18 18:54:12 +02:00
parent ec5cf5abf4
commit 212bdf6678
4 changed files with 34 additions and 12 deletions

View File

@@ -37,10 +37,14 @@ def update_watchlist(req: WatchlistRequest):
def _validate_symbol(symbol: str) -> dict:
from services.saxo_client import resolve_option_root_uic, SaxoNotConnected
from services.saxo_client import resolve_instrument, SaxoNotConnected
try:
uic = resolve_option_root_uic(symbol)
return {"symbol": symbol.upper(), "valid": True, "uic": uic, "error": None}
info = resolve_instrument(symbol)
return {
"symbol": symbol.upper(), "valid": True, "error": None,
"uic": info["uic"], "matched_symbol": info["symbol"],
"description": info["description"], "asset_type": info["asset_type"],
}
except SaxoNotConnected as e:
return {"symbol": symbol.upper(), "valid": False, "uic": None, "error": str(e)}
except Exception as e: