Deployment
Deploy strategies to live exchanges from the dashboard or CLI.
Prerequisites
- Exchange API credentials added to your account
- A built and tested strategy
Adding exchange credentials
Via dashboard
- Deploy → Credentials → Add Credential
- Select an exchange — Binance, Bybit, OKX, Hyperliquid, HTX, Gate, or Bitget
- Enter API key, secret, and passphrase (OKX, Bitget) or wallet private key (Hyperliquid)
- Mark as Testnet if applicable
- Test Connection to verify
Via CLI
tradectl auth set binance # interactive — prompts for key/secret
tradectl auth set okx # additionally prompts for passphrase
tradectl auth set hyperliquid # API wallet address + private key
tradectl auth list # show configured exchanges
tradectl auth remove binanceCredentials are encrypted with AES-256-GCM at rest and only decrypted in-memory during strategy execution.
Deploying a strategy
Via dashboard
- Deploy → New Deployment
- Select a strategy
- Select credentials and symbols
- Configure parameters
- Deploy
Via CLI
tradectl run config.json # foreground
tradectl run config.json --daemon # background (detached)
tradectl run config.json --dry-run # validate only — load plugin, no orders
tradectl run config.json --replay file.bin # historical replay through the live runnerSet isEmulator: true for paper trading, false for live. Paper mode connects to real exchange market-data WebSockets but simulates all fills locally — no API keys required.
Process model
When the bot starts, the runner spawns a tokio multi-thread runtime with these tasks:
tradectl run config.json
└── Tokio multi-thread runtime
├── Exchange WS — market data → per-symbol callbacks
├── Exchange Private WS — order updates → runner
├── Per-symbol event loop — gates → strategy → action → execute
├── Shadow variant evaluator (own task, optional)
├── Monitor WS server (port 9100, broadcast channel)
├── MCP HTTP server (port 9101, optional)
├── Trade Reporter — batch POST to platform API every 5 s
├── Telegram notifier + command bot (30+ commands)
├── AI agent (optional, Telegram free-text Q&A)
├── Pair selector — periodic re-evaluation (optional)
└── Metrics reporter — bot snapshots to platformThe exchange adapter is wrapped in a single Arc<dyn MarketAdapter> shared across all tasks — interior mutability lets parallel REST calls fly without an outer mutex.
Managing bots
tradectl strats # list installed strategy plugins
tradectl stop config.json # stop a specific bot
tradectl stop all # stop all bots managed by this CLItradectl stop cancels active entry orders. Exits stay on the exchange and positions stay open, protected by their TP/SL until they fire or you close them manually.
Shutdown behavior
| Trigger | Behavior |
|---|---|
SIGTERM / tradectl stop / Telegram /stop | Cancels entries; exits remain on exchange; positions stay open |
Hourly maxLossLimit breached | Strategy stops globally — all symbols |
| One symbol panics | Only that symbol stops; other symbols keep running |
| 3+ persistent errors (margin / qty exceeded) within 60 s | Strategy stops across all symbols |
Monitoring
Open the unified live monitor in tradectl-lab:
http://localhost:9200/monitorThe page is a WebSocket client to the bot's MonitorBroadcaster (port 9100 by default). It works for both paper and live runs and shows:
- Real-time order fills
- Current positions and unrealized PnL
- Per-symbol session, trigger, and shadow state
- Strategy logs and notifications
The URL field in the UI lets you point it at a remote bot.
Telegram
Configure Telegram for both notifications and the two-way command bot:
"telegram": {
"botToken": "1234:ABC...",
"chatId": "123456789"
}The command bot supports 30+ commands — /status, /stop, /positions, /profit, /month, /month_coins, /detailed, /last_month_* variants, and more. With the AI agent enabled, you can also send free-text questions ("how's the bot doing?", "why hasn't ETHUSDT traded?").
Notifications
Notifications fire for trade fills, bot status changes, errors, and shadow-promotion candidates via:
- Telegram (default)
- Email (via SendGrid, optional)
- Webhook (configurable)
Controls (dashboard)
| Action | Description |
|---|---|
| Stop | Gracefully stop the strategy (cancels entries; exits stay on exchange) |
| Restart | Restart with the same configuration |
| Delete | Stop and remove the deployment |
