feat: add daily budget, active window, trade snapshots, and price impact monitor

- New migrations for daily_budget, active_window, and bottrade snapshot
- Add trumpstruth scraper and price_impact_monitor service
- Expand bot_engine, hyperliquid, recovery, and tp_sl_monitor logic
- Update API/schemas/models for new features

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
k
2026-04-25 16:04:49 +08:00
parent a2c68e2939
commit 4ffcb442fe
20 changed files with 1110 additions and 114 deletions
+10 -4
View File
@@ -5,11 +5,13 @@ from pydantic import BaseModel
class PriceImpact(BaseModel):
asset: str
m5: float
m15: float
m1h: float
# None = window still open (live rolling peak) or no price data yet.
# Float = sealed peak move (%) in the signal direction once window closed.
m5: Optional[float] = None
m15: Optional[float] = None
m1h: Optional[float] = None
price_at_post: float
# None = outcome window not yet reached or no price data; True/False = signal direction matched actual move
# None = outcome window not yet reached; True/False = signal direction matched
correct_m5: Optional[bool] = None
correct_m15: Optional[bool] = None
correct_m1h: Optional[bool] = None
@@ -101,6 +103,10 @@ class UserSettings(BaseModel):
take_profit_pct: Optional[float] = None
stop_loss_pct: Optional[float] = None
min_confidence: int
daily_budget_usd: Optional[float] = None
# ISO-8601 UTC strings; both None = always on (Subscription.active still gates it).
active_from: Optional[str] = None
active_until: Optional[str] = None
class SetSettingsRequest(SignedEnvelope):