Bot Runtime Engine
The engine orchestrating lifecycle states of your trading bots.
Execution Loop
The runtime engine is responsible for the full lifecycle of bot execution: deployment, evaluation, action submission, pause/resume, and graceful shutdown.
Lifecycle States
Draft
Bot definition created but not yet deployed. Safe to edit.
Active
Bot is live and evaluating rules on each tick against current market conditions.
Paused
Bot is temporarily suspended; no new actions are submitted but positions may be tracked.
Stopped
Bot is permanently deactivated and all related active tracking ceases.
Execution Model
The BotRuntimeWorker continuously polls for active runtimes, evaluates their rule sets against current market conditions, and submits actions to Pacifica when conditions are met.
Each evaluation cycle fetches real-time price data, candlestick history, and current position state from Pacifica's REST and WebSocket APIs.
An idempotency layer prevents duplicate order submission in case of worker restarts.
Every execution event is logged.
Advanced Execution Controls
Sizing Configuration
Configurable leverage, precision position sizing (fixed amount, percentage of equity, risk-based logic).
Action Governance
Cooldown periods between trades, market scope restrictions, and maximum drawdown limits with automatic pause.