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
+9
View File
@@ -111,6 +111,15 @@ class ResearchTag(Base):
tag: Mapped[str] = mapped_column(String(60), primary_key=True, index=True)
class SelfCorrelation(Base):
__tablename__ = "self_correlations"
alpha_id: Mapped[str] = mapped_column(ForeignKey("alphas.id"), primary_key=True)
region: Mapped[str | None] = mapped_column(String(50), index=True)
result: Mapped[dict] = mapped_column(JSON)
stale: Mapped[bool] = mapped_column(Boolean, default=False)
calculated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now)
class Job(Base):
__tablename__ = "sync_jobs"
id: Mapped[str] = mapped_column(String(36), primary_key=True)