This guide shows exactly what console output to expect when running the hybrid system.
🚀 KALSHI HYBRID ANALYSIS API STARTING
================================================================================
Time: 2025-11-09T14:30:45.123456
Docs: http://localhost:8000/docs
API: http://localhost:8000/api/recommendations
================================================================================
⏰ Starting auto-refresh (every 5 minutes)
====================================================================================================
🔄 STARTING NEW ANALYSIS
====================================================================================================
Time: 2025-11-09T14:30:45.234567
Parameters:
• Edge threshold: 10.0%
• Max recommendations: 20
• Weights: 75% quant, 25% sentiment
====================================================================================================
🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀... HYBRID ANALYSIS: STATISTICAL + GROK AI ...🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀
====================================================================================================
🔍 STEP 1: STATISTICAL SCREENING
====================================================================================================
Edge threshold: 10.0%
🌤️ Analyzing weather markets...
📊 Sorted by 24h volume (highest volume first)
✅ Found 50 active weather markets (status=active, open for trading)
📊 Analyzing: KXHIGHLAX-25NOV08-T74
Target date: 2025-11-08 (lead: 1 days)
🔵 Fetching NOAA (GFS)...
🟢 Fetching Open-Meteo (ECMWF)...
✅ Open-Meteo: tmax=80.9, pop=0.0
🟡 Fetching Climatology...
✅ Climatology: tmax=73 (avg)
📈 Combined: 0.724 (conf: 0.80)
💰 Market: 0.995
🎯 Edge: -27.1% (BUY NO)
Found 5 high-edge weather bets
🏛️ Analyzing politics markets...
Found 5 high-edge politics bets
💰 Analyzing economics markets...
Found 5 high-edge economics bets
✅ Statistical screening complete: 15 opportunities
(Filtered from ~150 markets → 15 high-edge bets)
====================================================================================================
🤖 STEP 2: GROK SENTIMENT VERIFICATION
====================================================================================================
Running Grok analysis on 15 markets...
📦 Batch 1: Analyzing 5 markets in parallel...
🔍 Analyzing: KXHIGHCHI-25NOV09-T38
Market: Will the high temp in Chicago be <38° on Nov 9, 2025?...
✅ Grok: positive (82%)
🏷️ Themes: cold front, arctic blast, freezing
🔍 Analyzing: KXHIGHDEN-25NOV08-B53.5
Market: Will the high temp in Denver be 53-54° on Nov 8, 2025?...
✅ Grok: negative (68%)
🏷️ Themes: warmer than expected, high pressure, sunny
...
✅ Batch 1 complete
📦 Batch 2: Analyzing 5 markets in parallel...
...
✅ Batch 2 complete
✅ Grok analysis complete
====================================================================================================
🎯 STEP 3: COMBINE SIGNALS
====================================================================================================
Weights: 75% quantitative, 25% sentiment
✅ HIGH confidence: KXHIGHCHI-25NOV09-T38 (88.0%)
Action: BUY_YES, Edge: 79.0%
Quant: 79.5% | Grok: 82.0% | Market: 0.5%
✅ HIGH confidence: KXHIGHDEN-25NOV08-B53.5 (86.5%)
Action: BUY_NO, Edge: -90.9%
Quant: 8.6% | Grok: 68.0% | Market: 99.5%
⚠️ MEDIUM confidence: HOUSECA9-26-R (62.3%)
Action: BUY_YES, Edge: 53.1%
Quant: 53.1% | Grok: 45.0% | Market: 9.0%
...
✅ Combined 12 final recommendations
====================================================================================================
📊 ANALYSIS COMPLETE
====================================================================================================
Total recommendations: 12
Average confidence: 79.3%
Aligned signals: 10/12
====================================================================================================
✅ ANALYSIS COMPLETE
====================================================================================================
Total recommendations: 12
Total analyzed (lifetime): 12
📊 RECOMMENDATIONS SUMMARY:
1. KXHIGHCHI-25NOV09-T38
Action: BUY_YES
Edge: 79.0%
Confidence: 88.0%
Grok: positive (82%)
2. KXHIGHDEN-25NOV08-B53.5
Action: BUY_NO
Edge: -90.9%
Confidence: 86.5%
Grok: negative (68%)
3. KXHIGHCHI-25NOV09-B40.5
Action: BUY_NO
Edge: -77.5%
Confidence: 85.2%
Grok: negative (73%)
4. KXHIGHDEN-25NOV08-T51
Action: BUY_YES
Edge: 63.7%
Confidence: 82.1%
Grok: positive (79%)
5. KXHIGHNY-25NOV09-T59
Action: BUY_YES
Edge: 62.8%
Confidence: 81.5%
Grok: positive (75%)
... and 7 more
====================================================================================================
📥 GET /api/recommendations - Request received at 14:31:20
✅ Returning 12 recommendations
📅 Last updated: 14:30:52
📥 GET /api/recommendations - Request received at 14:32:20
✅ Returning 12 recommendations
📅 Last updated: 14:30:52
====================================================================================================
🔄 STARTING NEW ANALYSIS
====================================================================================================
Time: 2025-11-09T14:35:45.234567
...
(Full analysis repeats)
================================================================================
[14:31:20] 🔄 Fetching recommendations from Python backend
API URL: http://localhost:8000/api/recommendations
================================================================================
📊 Response status: success
✅ Received 12 opportunities from Python backend
🔄 Converting 12 recommendations to dashboard format...
📌 Recommendation #1:
Ticker: KXHIGHCHI-25NOV09-T38
Market: Will the high temp in Chicago be <38° on Nov 9, 2025?...
Action: BUY_YES
📊 Quant Edge: 79.0%
🤖 Grok Sentiment: 82%
🎯 Combined Confidence: 88.0%
🔗 Kalshi: https://kalshi.com/markets/KXHIGHCHI-25NOV09-T38
📌 Recommendation #2:
Ticker: KXHIGHDEN-25NOV08-B53.5
Market: Will the high temp in Denver be 53-54° on Nov 8, 2025?...
Action: BUY_NO
📊 Quant Edge: -90.9%
🤖 Grok Sentiment: 68%
🎯 Combined Confidence: 86.5%
🔗 Kalshi: https://kalshi.com/markets/KXHIGHDEN-25NOV08-B53.5
... (continues for all 12)
================================================================================
✅ Successfully converted and set 12 recommendations
📅 Last updated: 2025-11-09T14:30:52.123Z
================================================================================
================================================================================
[14:32:20] 🔄 Fetching recommendations from Python backend
API URL: http://localhost:8000/api/recommendations
================================================================================
📊 Response status: success
✅ Received 12 opportunities from Python backend
...
================================================================================
[14:35:45] 🔄 Fetching recommendations from Python backend
API URL: http://localhost:8000/api/recommendations
================================================================================
📊 Response status: analyzing
⏳ Backend is analyzing, keeping existing recommendations
(New results will appear when analysis completes)
================================================================================
[14:30:10] 🔄 Fetching recommendations from Python backend
API URL: http://localhost:8000/api/recommendations
================================================================================
📊 Response status: empty
⚠️ No recommendations yet, waiting for first analysis
⏱️ This usually takes 30-60 seconds on first run
| Symbol | Meaning |
|---|---|
| 🚀 | Starting/initializing |
| 🔄 | Starting new analysis |
| 🔍 | Statistical screening |
| 🌤️ | Weather analysis |
| 🏛️ | Politics analysis |
| 💰 | Economics analysis |
| 🤖 | Grok AI sentiment |
| 📦 | Batch processing |
| 🎯 | Combining signals |
| ✅ | Success/completion |
| Warning/medium confidence | |
| ❌ | Error/failure |
| 📊 | Summary statistics |
| 📥 | Incoming API request |
| 📅 | Timestamp information |
| Symbol | Meaning |
|---|---|
| 🔄 | Fetching data |
| 📊 | Response status |
| ✅ | Success |
| ⏳ | Waiting/in progress |
| Warning | |
| ❌ | Error |
| 📌 | Individual recommendation |
| 🎯 | Confidence score |
| 🔗 | Kalshi link |
Backend shows:
⚠️ WARNING: X_API_KEY not set. Grok sentiment analysis will fail!
Set it in .env or environment: export X_API_KEY=your-key
Fix:
echo "X_API_KEY=your_key_here" > .env
# Restart backendDashboard shows:
⚠️ No recommendations yet, waiting for first analysis
⏱️ This usually takes 30-60 seconds on first run
Solution: Wait 30-60 seconds. Backend is still analyzing.
Backend shows:
⚠️ Grok failed for KXHIGHCHI-25NOV09-T38: API error
Check:
- Is
X_API_KEYset correctly? - Do you have API credits?
- Is x.ai API accessible?
Dashboard console shows nothing
Check:
- Is Python backend running? (should see output in Terminal 1)
- Is backend on port 8000? (
curl http://localhost:8000/api/status) - Check browser console for CORS errors
Dashboard shows:
❌ Error fetching from Python backend:
Access-Control-Allow-Origin error
Fix:
- Restart Python backend
- Ensure it's running on port 8000
- Check
api_server.pyhas correct CORS settings
A healthy system shows:
Backend (Terminal 1):
- ✅ Startup message with port 8000
- ✅ Initial analysis completes in 30-60 seconds
- ✅ Shows 10-20 recommendations
- ✅ API requests every 60 seconds from dashboard
- ✅ Re-analysis every 5 minutes
Dashboard (Browser Console):
- ✅ Fetches successfully every 60 seconds
- ✅ Shows "success" status
- ✅ Converts 10-20 recommendations
- ✅ No error messages
Dashboard (UI):
- ✅ Shows recommendation cards
- ✅ Each card has quantitative + Grok data
- ✅ Can swipe/accept/dismiss
- ✅ Updates automatically
To see everything:
-
Terminal 1 (Python): Shows full analysis pipeline
- Statistical screening
- Grok sentiment calls
- Combined decisions
- API requests from dashboard
-
Browser Console (F12): Shows dashboard activity
- API fetches
- Data conversion
- Recommendation details
- Any errors
-
Dashboard UI: Shows final result
- Recommendation cards
- All analysis details
- Real-time updates
Keep both open while demoing to judges! 🎓