Shadow Mode¶
Shadow mode lets you test strategies without executing real trades. Signals are generated and logged, but no orders are placed.
Why Use Shadow Mode?¶
- Test new strategies - Verify logic before risking capital
- Validate configuration - Ensure settings work as expected
- Learn the system - Understand how PolyBot operates
- Debug issues - Troubleshoot without financial risk
Enabling Shadow Mode¶
Per Strategy¶
# Enable shadow mode for a specific strategy
polybot strategy shadow arbitrage --enable
# Disable shadow mode (go live)
polybot strategy shadow arbitrage --disable
Check Status¶
Output:
┌────────────┬─────────────────────────┬─────────┬────────┐
│ Name │ Description │ Enabled │ Shadow │
├────────────┼─────────────────────────┼─────────┼────────┤
│ arbitrage │ YES+NO arbitrage │ ✓ │ ✓ │
│ stat_arb │ Statistical arbitrage │ ✓ │ ✗ │
│ ai_model │ AI model predictions │ ✗ │ ✗ │
└────────────┴─────────────────────────┴─────────┴────────┘
How Shadow Mode Works¶
Normal Mode¶
Shadow Mode¶
In shadow mode: - Strategies receive real price data - Signals are generated normally - Signals are logged to the strategy logs database - No orders are sent to the exchange
Viewing Shadow Signals¶
Dashboard¶
View shadow signals in the web UI:
CLI¶
# View recent strategy logs
polybot logs strategy arbitrage --tail 50
# Filter by signal type
polybot logs strategy arbitrage --type signal
API¶
Analyzing Shadow Performance¶
Track hypothetical performance:
- Signal count - How many opportunities found?
- Signal quality - What prices were signaled?
- Timing - When do signals occur?
- Strategy comparison - Which strategies find more opportunities?
Transitioning to Live¶
When you're ready to go live:
1. Review Shadow Results¶
Look for: - Consistent signal generation - Reasonable prices - No errors or anomalies
2. Start Small¶
3. Disable Shadow Mode¶
4. Monitor Closely¶
Watch the first few trades carefully: - Check execution prices - Verify position tracking - Monitor P&L
Best Practices¶
- Run shadow for at least 24-48 hours - See different market conditions
- Compare to expectations - Are signals what you expected?
- Check error logs - Any issues during shadow period?
- Test all strategies - Shadow each before going live
- Keep some strategies in shadow - Compare live vs shadow performance
Troubleshooting¶
No signals in shadow mode¶
- Check strategy is enabled:
polybot strategy list - Verify market conditions match strategy requirements
- Check for errors:
polybot logs --level ERROR
Too many signals¶
- Review strategy thresholds
- Check if parameters are too aggressive
- Verify data quality
Shadow and live disagreement¶
- Execution slippage is normal
- Live has real market impact
- Timing differences matter