[Backend] Simulate Engine - Real-time Signal Detection #19
Reference in New Issue
Block a user
Delete Branch "fix/issue-8"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement simulate engine for real-time signal detection via REST polling as described in issue #8.
Changes Made
Modified files:
src/backend/app/services/simulate/engine.py- Full SimulateEngine implementation:src/backend/app/api/simulate.py- Simulation API endpoints:src/backend/app/db/schemas.py- Addedcheck_intervalfield to SimulationCreateFeatures Implemented
User Notice
Free tier users get REST polling every 60s. Pro tier users can use shorter intervals.
Dependencies
Related Issue
Fixes #8
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 #18lgtm