feat: implement Simulate Engine for real-time signal detection

Implement simulate engine for real-time signal detection via REST polling.

Changes:
- SimulateEngine service with configurable check interval (default 60s for free tier)
- REST polling for current prices using AveCloudClient
- Condition matching for real-time data (price_drop, price_rise, volume_spike, price_level)
- Signal logging with user-initiated start/stop
- Simulation API endpoints:
  - POST /api/bots/{id}/simulate - Start simulation
  - GET /api/bots/{id}/simulate/{run_id} - Get status/signals
  - GET /api/bots/{id}/simulations - List all simulations
  - POST /api/bots/{id}/simulate/{run_id}/stop - Stop simulation
- Updated SimulationCreate schema with check_interval field
- Free tier limited to 60s minimum check interval
- Signals stored in database for simulation signal history

Depends on issue #7 (Backtest Engine) which was merged in PR #18
This commit is contained in:
shokollm
2026-04-08 11:25:51 +00:00
parent 0fb16f06e4
commit 965efa122b
3 changed files with 379 additions and 21 deletions

View File

@@ -87,6 +87,7 @@ class SimulationCreate(BaseModel):
token: str
chain: str
duration_seconds: int = 3600
check_interval: int = 60
auto_execute: bool = False