Skip to content

Latest commit

 

History

History
426 lines (319 loc) · 11.6 KB

CONSOLE_OUTPUT_GUIDE.md

File metadata and controls

426 lines (319 loc) · 11.6 KB

📟 Console Output Guide - What You'll See

This guide shows exactly what console output to expect when running the hybrid system.


🖥️ Terminal 1: Python Backend

On Startup

🚀 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

====================================================================================================

When Dashboard Fetches Data

📥 GET /api/recommendations - Request received at 14:31:20
   ✅ Returning 12 recommendations
   📅 Last updated: 14:30:52

Every 60 Seconds (Dashboard Auto-Refresh)

📥 GET /api/recommendations - Request received at 14:32:20
   ✅ Returning 12 recommendations
   📅 Last updated: 14:30:52

Every 5 Minutes (Backend Re-Analysis)

====================================================================================================
🔄 STARTING NEW ANALYSIS
====================================================================================================
Time: 2025-11-09T14:35:45.234567
...
(Full analysis repeats)

🌐 Browser Console (Dashboard)

On Page Load

================================================================================
[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
================================================================================

Every 60 Seconds (Auto-Refresh)

================================================================================
[14:32:20] 🔄 Fetching recommendations from Python backend
API URL: http://localhost:8000/api/recommendations
================================================================================

📊 Response status: success

✅ Received 12 opportunities from Python backend
...

During Backend Analysis

================================================================================
[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)

On First Run (Before Analysis Complete)

================================================================================
[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

📊 What Each Symbol Means

Python Backend

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

Dashboard Console

Symbol Meaning
🔄 Fetching data
📊 Response status
✅ Success
⏳ Waiting/in progress
⚠️ Warning
❌ Error
📌 Individual recommendation
🎯 Confidence score
🔗 Kalshi link

🐛 Troubleshooting by Console Output

Problem: "X_API_KEY not set"

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 backend

Problem: "No recommendations yet"

Dashboard 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.

Problem: Grok keeps failing

Backend shows:

⚠️  Grok failed for KXHIGHCHI-25NOV09-T38: API error

Check:

  1. Is X_API_KEY set correctly?
  2. Do you have API credits?
  3. Is x.ai API accessible?

Problem: Dashboard not fetching

Dashboard console shows nothing

Check:

  1. Is Python backend running? (should see output in Terminal 1)
  2. Is backend on port 8000? (curl http://localhost:8000/api/status)
  3. Check browser console for CORS errors

Problem: CORS errors

Dashboard shows:

❌ Error fetching from Python backend:
Access-Control-Allow-Origin error

Fix:

  1. Restart Python backend
  2. Ensure it's running on port 8000
  3. Check api_server.py has correct CORS settings

✅ Healthy System Output

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

📝 Summary

To see everything:

  1. Terminal 1 (Python): Shows full analysis pipeline

    • Statistical screening
    • Grok sentiment calls
    • Combined decisions
    • API requests from dashboard
  2. Browser Console (F12): Shows dashboard activity

    • API fetches
    • Data conversion
    • Recommendation details
    • Any errors
  3. Dashboard UI: Shows final result

    • Recommendation cards
    • All analysis details
    • Real-time updates

Keep both open while demoing to judges! 🎓