Saxo connector

This commit is contained in:
OpenSquared
2026-07-18 17:14:13 +02:00
parent 91054979ec
commit bff2f70781
10 changed files with 826 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
from dotenv import load_dotenv
load_dotenv()
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import market_data, geopolitical, options, backtest, ai, portfolio, config, patterns, journal, cycle as cycle_router, profiles as profiles_router, reasoning as reasoning_router, knowledge as knowledge_router, options_vol as options_vol_router, analytics as analytics_router, risk as risk_router
@@ -21,6 +24,8 @@ from routers import instruments_watchlist as instruments_watchlist_router
from routers import wavelet as wavelet_router
from routers import ai_chat as ai_chat_router
from routers import strategy_builder as strategy_builder_router
from routers import saxo_oauth as saxo_oauth_router
from routers import saxo as saxo_router
from services.database import init_db, get_config, cleanup_stale_running_cycles
import os
import logging
@@ -134,6 +139,9 @@ def startup():
# Start institutional reports weekly scheduler (COT Fridays, EIA Wednesdays)
from services.institutional_scheduler import start_institutional_scheduler
start_institutional_scheduler()
# Start Saxo OAuth token refresh + options-chain snapshot poller
from services.saxo_scheduler import start_saxo_scheduler
start_saxo_scheduler()
# One-time migration: remove FXStreet-sourced rows (decimal format) — FF sync below will refill from FF
try:
@@ -211,6 +219,8 @@ def shutdown():
stop_pnl_scheduler()
from services.institutional_scheduler import stop_institutional_scheduler
stop_institutional_scheduler()
from services.saxo_scheduler import stop_saxo_scheduler
stop_saxo_scheduler()
app.include_router(market_data.router)
@@ -249,6 +259,8 @@ app.include_router(instruments_watchlist_router.router)
app.include_router(wavelet_router.router)
app.include_router(ai_chat_router.router)
app.include_router(strategy_builder_router.router)
app.include_router(saxo_oauth_router.router)
app.include_router(saxo_router.router)
@app.get("/")