feat: add scoped alpha sync and local self-correlation

This commit is contained in:
yuxuanhui
2026-09-08 10:40:49 +08:00
parent 404a4d8a04
commit d2ccd94721
28 changed files with 1656 additions and 69 deletions
+6
View File
@@ -40,6 +40,7 @@ from .schemas import (
PnlOutput,
PreferencesInput,
ResearchUpdate,
SelfCorrelationOutput,
SessionOutput,
)
from .security import bootstrap, cipher, issue_session, require_auth, token_hash, valid_password
@@ -341,6 +342,11 @@ def create_app(settings=None, wq_client=None, ai_model_factory=None):
async with sessions() as db:
return await Business(db).get_alpha_pnl(alpha_id)
@api.get("/alphas/{alpha_id}/self-correlation", response_model=SelfCorrelationOutput, tags=["alphas"])
async def self_correlation(alpha_id: str):
async with sessions() as db:
return await Business(db).get_self_correlation(alpha_id)
@api.post("/sync-jobs", status_code=202, response_model=JobOutput, tags=["sync-jobs"])
async def new_job(body: JobInput):
async with sessions.begin() as db: