PQAP Roadmap & Strategy Document
Generated: 2024-12-24
Current State Summary
| Metric | Value |
|---|---|
| Total Value | ~$97 |
| Return | -3.3% |
| Starting Capital | $100 |
| Total Trades | 13,500+ |
| Open Positions | 7 |
| Active Strategies | 5 |
1. Will P&L Turn Around?
Root Cause Analysis
The -3.3% loss is primarily from value_bet_v1 (now disabled): - value_bet_v1: -$73.50 (bought but never sold - no exit logic) - market_maker_v1: -$10.25 (small loss, normal for market making) - mean_reversion_v1: +$8.42 (PROFITABLE)
Turnaround Trajectory
Yes, P&L should turn around. Here's why:
- Bleeding stopped: value_bet is disabled, no more one-way trades
- Profitable strategy active: mean_reversion is net positive (+$8.42)
- time_arb deployed: Based on +49% backtest returns, should accelerate recovery
- Position value: $72 in positions that can be sold for profit
Expected Timeline
| Phase | Timeframe | Expected P&L |
|---|---|---|
| Stabilization | Days 1-3 | -3% to -1% |
| Recovery | Days 4-7 | -1% to +2% |
| Growth | Week 2+ | +2% to +10% |
Key Risks
- Market conditions change
- Strategies generate correlated losses
- Insufficient trading volume
2. ML Developer Tasks
If you have ML developers available, here are high-value projects:
Priority 1: Price Movement Prediction (2-3 weeks)
Goal: Predict short-term price direction (1-6 hours ahead)
Data Available: - 10,350 price snapshots across 121 markets - Hourly price patterns by market - Volume data
Approach:
Features:
- Price momentum (1h, 6h, 24h returns)
- Volume changes
- Hour of day
- Day of week
- Market category
- Price level (extreme vs uncertain)
Target:
- Binary: Will price be higher/lower in 6h?
- Regression: Expected return in next 6h
Models to try:
- XGBoost (start here)
- LSTM for sequence patterns
- Random Forest for interpretability
Deliverable: Model that predicts direction with >55% accuracy
Priority 2: Optimal Entry/Exit Timing (2 weeks)
Goal: Learn when to enter and exit positions
Approach: - Reinforcement learning agent - State: current position, price history, time of day - Actions: buy, sell, hold - Reward: realized P&L
Deliverable: RL agent that outperforms fixed rules
Priority 3: Market Similarity Clustering (1 week)
Goal: Group similar markets for cross-market signals
Approach: - Embed markets using price behavior - Cluster similar markets - When one market moves, predict others will follow
Deliverable: Market clustering model + cross-market signal generator
Priority 4: Anomaly Detection Enhancement (1-2 weeks)
Goal: Improve current Isolation Forest with better features
Current: Simple price/volume features Enhanced: - Add market sentiment from question text - Add correlation with related markets - Add time-series anomaly detection
3. Additional Data Sources for Edge
High Value (Should Implement)
| Source | Edge Potential | Difficulty |
|---|---|---|
| Twitter/X sentiment | High | Medium |
| News headlines | High | Medium |
| Polymarket API orderbook | High | Low |
| Related market prices | Medium | Low |
| Google Trends | Medium | Low |
Implementation Priority
- Orderbook depth data (immediate)
- Already have API access
- Shows supply/demand imbalance
-
Can detect large orders before they move price
-
Cross-market correlations (this week)
- Bitcoin markets correlate with crypto regulation markets
- Political markets correlate with each other
-
Sports outcomes cascade
-
News/Twitter sentiment (next week)
- Use free APIs or scraping
- Correlate headlines with price moves
-
Build sentiment-based signals
-
Historical resolution data (longer term)
- Get resolved market outcomes
- Train models on what actually happened
- Currently missing this critical data
4. Paper Trading vs Real Trading Separation
Architecture Design
┌─────────────────────────────────────────────────────────┐
│ PQAP Main Process │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Strategy │───▶│ Signal │───▶│ Execution │ │
│ │ Engine │ │ Router │ │ Router │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ┌─────────────────────────┼─────┐ │
│ │ │ │ │
│ ┌──────▼──────┐ ┌──────▼─────┐│ │
│ │ Paper │ │ Real ││ │
│ │ Trading │ │ Trading ││ │
│ │ Engine │ │ Engine ││ │
│ └─────────────┘ └────────────┘│ │
│ │ │
└─────────────────────────────────────────────────────────┘
Configuration
# configs/prod.yaml
trading_mode: "real" # or "paper" or "both"
real_trading:
enabled: true
max_capital: 500 # USD
strategies:
- mean_reversion_v1 # Only proven strategies
require_confirmation: true # For large trades
paper_trading:
enabled: true
parallel: true # Run alongside real
strategies:
- time_arb_v1 # Test new strategies
- experimental_v1
Safety Features
- Separate wallets: Paper uses simulated balance, real uses actual USDC
- Strategy whitelisting: Only approved strategies can trade real money
- Position limits: Real trading has stricter limits
- Kill switch: Separate kill switches for paper and real
- Audit trail: All real trades logged with full context
Implementation Steps
- Add
TradingModeenum (PAPER, REAL, BOTH) - Create
ExecutionRouterto direct signals - Add
RealTradingEnginewith Polymarket API integration - Add configuration validation
- Add real-time P&L tracking for real trades
5. Criteria for Going Live
Minimum Requirements (All Must Pass)
| Criterion | Target | Current |
|---|---|---|
| Paper trading profitable | >0% over 7 days | -3.3% (recovering) |
| Win rate | >50% | ~52% (mean_reversion) |
| Max drawdown | <10% | -3.3% |
| Strategies tested | 2+ profitable | 1 confirmed |
| System stability | 48h+ without crash | Stable |
| API integration tested | Successful test trade | Not tested |
Phased Rollout Plan
Phase 1: API Validation (Day 1) - Add private key to environment - Test with $1 trade (buy and immediately sell) - Verify order execution, fills, settlement - Confirm fee handling
Phase 2: Limited Live ($10 capital, Week 1)
- Enable only mean_reversion_v1 (proven profitable)
- Max $2 per trade
- Run parallel with paper trading
- Compare real vs paper performance
Phase 3: Expanded Live ($50 capital, Week 2)
- Add time_arb_v1 if paper shows profit
- Max $5 per trade
- Enable basic market making
Phase 4: Full Live ($500+ capital, Week 3+) - All profitable strategies - Full position sizing - Automated 24/7 operation
Go/No-Go Checklist
Before each phase: - [ ] Previous phase profitable - [ ] No critical bugs in last 48h - [ ] Sufficient capital available - [ ] Risk limits configured - [ ] Telegram alerts working - [ ] Manual kill switch tested
6. Speeding Up Development
Parallel Workstreams
| Stream | Owner | Timeline |
|---|---|---|
| ML Price Prediction | ML Dev 1 | 2 weeks |
| Sentiment Integration | ML Dev 2 | 1 week |
| Real Trading Engine | Claude | 2-3 days |
| Additional Data Sources | Claude | Ongoing |
| Strategy Optimization | Claude | Ongoing |
Quick Wins (This Week)
- Enable orderbook depth signals - 1 day
- Add cross-market correlation - 1 day
- Implement real trading engine - 2 days
- Test API with small trade - 1 hour (needs private key)
Infrastructure Improvements
- Faster data collection: Currently every 5 min, could be every 1 min
- More markets tracked: Currently 50, could be 200+
- Better logging: Add trade attribution, strategy performance
- Alerting: More granular Telegram alerts
Next Steps (Immediate)
- Continue monitoring current strategies
- Wait for time_arb to generate first signals (next buy hour)
- Prepare real trading engine implementation
- Document ML developer onboarding
This document will be updated as we make progress.