Workflow: Strategy Lifecycle
Goal
Move from user strategy intent to executed market actions with traceability.
1) Create strategy
A user creates a strategy by:
- Selecting instrument and credential context
- Choosing strategy type (
DCA,SCALP,POSITION_CLOSE) - Defining actions and conditions (or using templates)
- Setting optional lift/user confirmation options
2) Strategy control trigger
Strategy control is triggered by core job endpoints (scheduler or manual job call), then core evaluates active strategies.
3) Evaluation and order generation
Core strategy controller gathers:
- Latest prices
- Price changes / ATH data when needed
- Position ROI context when needed
- Indicator values (EMA/SMA) and halving windows when needed
Actions that pass conditions generate new orders.
4) Persist, track, notify
For each generated order:
- Order is stored
- Action and strategy are updated
- Track entries are created
- Strategy events are created for user visibility
Strategy can be completed when:
- A stop-on-execution action fires, or
- All actions are executed
5) Async execution path
Generated orders are sent to trading queue. Worker consumes jobs and performs:
- Place limit order
- Cancel limit order
- Confirm status event path
Resulting status events are propagated to users.
6) Real-time user feedback
Event updates are pushed via fanout exchange to UI pods, then broadcast to active UI sessions.
Related: