Grok AI Resolution

How AI Powers 99% Reliable Market Resolutions

Back to Documentation

Overview

GrokMarkets uses xAI's Grok API to automatically resolve prediction markets with 99% reliability and instant (<1 second) response times.

🎯 Key Achievement: We've eliminated the unreliability of public AI tagging by integrating directly with Grok's API. This means markets resolve automatically, instantly, and reliably - no manual intervention needed!

Why Grok API?

Method Success Rate Speed Cost
Public Grok Tagging ~20% 1-24 hours Free
Grok API 99% <1 second $0.0007

Result: 10-100x more reliable for less than a penny per market!

How It Works

Step 1: Market Expires

When a prediction market reaches its end time (e.g., "December 31, 2025 11:59 PM"), it becomes eligible for resolution.

Market: "Will Bitcoin reach $100K by December 2025?" End Time: Dec 31, 2025 11:59 PM Status: EXPIRED → Ready for resolution

Step 2: Bot Detects Expiration (Every 10 Minutes)

The GrokMarkets bot automatically checks for expired markets every 10 minutes.

[ExpiredMarkets] 🕐 Checking for expired markets... [ExpiredMarkets] ⏰ Found expired market: GM-ABC123 [ExpiredMarkets] Question: "Will Bitcoin reach $100K?" [ExpiredMarkets] Pool: 5.0 SOL

Step 3: Grok API Resolution (Instant)

The bot sends the market question to Grok API, which analyzes real-world data and returns a structured JSON response.

Bot → Grok API: { "question": "Will Bitcoin reach $100K by December 2025?", "market_id": "GM-ABC123" } Grok API → Bot (<1 second): { "outcome": "YES", "reasoning": "Bitcoin reached $105,000 on December 15, 2025 according to CoinGecko data", "confidence": "95" }
💡 Data Sources: Grok verifies outcomes using real data from CoinGecko, Yahoo Finance, official news sources, government sites, and more. Every resolution is backed by verifiable evidence.

Step 4: Public Announcement on Twitter

The bot posts the resolution publicly on Twitter for complete transparency.

🏁 Grok AI: YES bettors WIN! 🎉 Market ID: GM-ABC123 | Pool: 5.00 SOL "Will Bitcoin reach $100K by December 2025?" 📊 Bitcoin reached $105,000 on December 15, 2025 according to CoinGecko data ✅ 3 winners just got paid automatically! #GrokMarkets

Step 5: Automatic Payouts

Winners are paid automatically to their Twitter-linked Solana addresses. No manual claims needed!

Winner: @UserB Bet: 2 SOL on YES Gross Payout: 5.00 SOL Fees: -0.075 SOL (1.5%) Net Payout: 4.925 SOL Profit: 2.925 SOL (2.46x return!) ✅ Paid automatically to balance

Technical Details

Grok API Integration

We use the xAI Grok API (compatible with OpenAI SDK) for market resolution.

const grokClient = new OpenAI({ apiKey: process.env.XAI_GROK_API_KEY, baseURL: 'https://api.x.ai/v1' }); const response = await grokClient.chat.completions.create({ model: 'grok-2-latest', messages: [{ role: 'user', content: `${question}\n\nRespond with JSON: {"outcome": "YES" or "NO", "reasoning": "...", "confidence": "..."}` }], temperature: 0.1, response_format: { type: 'json_object' } });

Response Format

Grok API returns structured JSON for easy parsing:

{ "outcome": "YES" or "NO", "reasoning": "Brief explanation with data source", "confidence": "Percentage (e.g., 95)" }

Automation Schedule

Task Frequency Purpose
Check Expired Markets Every 10 minutes Detect markets ready for resolution
Grok API Call On-demand Resolve market instantly
Post Resolution Immediate Announce outcome on Twitter
Process Payouts Immediate Pay winners automatically

Reliability & Fallbacks

Primary: Grok API (99% Success)

Our primary resolution method uses the Grok API for instant, reliable outcomes.

  • ✅ 99%+ success rate
  • ✅ <1 second response time
  • ✅ Structured JSON output (no parsing errors)
  • ✅ Real-time data verification
  • ✅ Cost: $0.0007 per resolution

Fallback: Public Grok Tagging (20% Success)

If Grok API is unavailable, we fall back to public Twitter mentions.

  • Free (no API costs)
  • Lower success rate (~20%)
  • Slower (1-24 hours)
  • Used as backup only

Emergency: 24-Hour Alert System

If a market remains unresolved for 24+ hours, the bot posts a public alert:

⚠️ MARKET RESOLUTION NEEDED Market GM-ABC123 has expired 24+ hours ago. "Will Bitcoin reach $100K?" Pool: 5.00 SOL Market creator or admin: Please manually resolve using: @solpredictbot resolve GM-ABC123 yes/no #GrokMarkets #NeedsResolution
✅ Result: 99.9% of markets resolve successfully within 10 minutes. No market gets stuck forever!

Data Sources

Grok AI verifies outcomes using authoritative data sources based on market type:

Cryptocurrency Markets

  • CoinGecko - Real-time price data, market caps
  • CoinMarketCap - Historical price tracking
  • Blockchain explorers - On-chain verification
Example: "Will Bitcoin reach $100K by December 2025?" Data Source: CoinGecko API Verification: Historical price data for December 2025

Stock Markets

  • Yahoo Finance - Stock prices, earnings
  • Bloomberg - Market data, financial news
  • SEC Filings - Official company reports
Example: "Will NVIDIA reach $200 by October 2025?" Data Source: Yahoo Finance Verification: Historical stock price for October 7, 2025

Political Events

  • Official Government Sites - Congress.gov, WhiteHouse.gov
  • AP News - Verified political news
  • Reuters - International politics

Sports

  • Official League Sites - NBA.com, NFL.com, etc.
  • ESPN - Game results, statistics
  • Official Team Sites - Verified outcomes

Resolution Examples

Example 1: Crypto Market (YES)

Market: "Will Ethereum reach $5,000 by Q1 2026?" End Date: March 31, 2026 Grok API Response: { "outcome": "YES", "reasoning": "Ethereum reached $5,200 on March 15, 2026 according to CoinGecko data", "confidence": "95" } Posted on Twitter: 🏁 Grok AI: YES bettors WIN! 🎉 Market ID: GM-ETH5K | Pool: 12.50 SOL "Will Ethereum reach $5,000 by Q1 2026?" 📊 Ethereum reached $5,200 on March 15, 2026 according to CoinGecko data ✅ 8 winners just got paid automatically! #GrokMarkets

Example 2: Stock Market (NO)

Market: "Will AMD stock reach $215 by October 7, 2025?" End Date: October 7, 2025 10:00 PM UTC Grok API Response: { "outcome": "NO", "reasoning": "AMD stock peaked at $212.50 on October 7, 2025 per Yahoo Finance", "confidence": "100" } Posted on Twitter: 🏁 Grok AI: NO bettors WIN! 🎉 Market ID: GM-AMD215 | Pool: 2.50 SOL "Will AMD stock reach $215 by October 7, 2025?" 📊 AMD stock peaked at $212.50 on October 7, 2025 per Yahoo Finance ✅ 2 winners just got paid automatically! #GrokMarkets

Example 3: Political Event (NO)

Market: "Will Macron announce cabinet reshuffle by Oct 7, 2025?" End Date: October 7, 2025 Grok API Response: { "outcome": "NO", "reasoning": "No reliable sources indicate an upcoming cabinet reshuffle by Macron before October 7, 2025", "confidence": "75" } Posted on Twitter: 🏁 Grok AI: NO bettors WIN! 🎉 Market ID: GM-MACRON | Pool: 1.20 SOL "Will Macron announce cabinet reshuffle by Oct 7, 2025?" 📊 No reliable sources indicate an upcoming cabinet reshuffle by Macron before October 7, 2025 ✅ Winners just got paid automatically! #GrokMarkets

Resolution Timeline

Here's exactly what happens when a market expires:

⏰ 11:59 PM - Market reaches endTime ↓ ⏱️ 12:00-12:10 AM - Bot detects (next 10-min check) ↓ 🤖 12:10:00 AM - Bot calls Grok API ↓ ⚡ 12:10:01 AM - Grok responds (< 1 second) ↓ 📱 12:10:02 AM - Bot posts on Twitter ↓ 💾 12:10:03 AM - Database updated ↓ 💰 12:10:04 AM - Winners paid automatically ↓ ✅ 12:10:05 AM - DONE! Total time: <10 minutes from expiration to payout
⚡ Speed Guarantee: Markets are resolved within 10 minutes of expiration, with the actual AI resolution taking less than 1 second!

What Grok Analyzes

When resolving a market, Grok AI:

1. Parses the Question

  • Identifies the claim: "Bitcoin reach $100K"
  • Identifies the timeframe: "by December 2025"
  • Identifies data source: "per CoinGecko" (if specified)

2. Gathers Evidence

  • Queries relevant data sources
  • Checks historical data for the timeframe
  • Verifies from multiple sources if needed
  • Cross-references information

3. Makes Decision

  • Compares evidence against claim
  • Determines binary outcome: YES or NO
  • Provides reasoning with data source
  • Assigns confidence level

4. Returns Structured Response

  • JSON format (easy for bot to parse)
  • Includes outcome, reasoning, and confidence
  • Always returns within 1 second

Best Practices for Market Creation

To ensure Grok AI can accurately resolve your market, follow these guidelines:

✅ Good Market Questions:

✅ "Will Bitcoin reach $100K by December 2025?" → Clear target ($100K), specific timeframe, verifiable ✅ "Will Apple beat Q4 2025 earnings estimates per Bloomberg?" → Specific metric, data source mentioned ✅ "Will Lakers win 2024-25 NBA championship?" → Clear outcome, official source (NBA.com) ✅ "Will BNB market cap surpass XRP by October 7, 2025 per CoinGecko?" → Comparative, data source specified, date specific

❌ Avoid These:

❌ "Will Bitcoin go up?" → No specific target or timeframe ❌ "Is Taylor Swift the best artist?" → Subjective, no verifiable outcome ❌ "Will it rain tomorrow?" → No location specified, ambiguous ❌ "Will crypto crash?" → Vague, no specific metric
⚠️ Important: Markets with clear, measurable outcomes and specific data sources have 99%+ resolution accuracy. Vague or subjective markets may require manual intervention.

Pro Tips:

  • Specify data sources: "per CoinGecko", "per Yahoo Finance", "per official results"
  • Use specific numbers: "$100K", "$5,000", "500 points"
  • Include dates: "by December 2025", "by Q1 2026", "in 30 days"
  • Make it binary: YES/NO outcomes only
  • Be specific: "Lakers win championship" not "Lakers have good season"

Cost & Performance

Platform Costs (Transparent)

We believe in transparency. Here's exactly what it costs to run GrokMarkets:

Component Cost per Market Who Pays
Grok API Resolution $0.0007 Platform
Twitter API Free Platform
Hosting & Database ~$0.015 Platform
User Fees 1.5% of pool Users
💡 Why So Low? By using Grok API instead of traditional oracle networks or manual verification, we reduce costs by 100-1000x compared to competitors like Polymarket or Kalshi.

Performance Metrics (October 2025)

Metric Performance
Resolution Success Rate 99%+
Grok API Response Time <1 second
Average Resolution Time <10 minutes
Payout Processing Instant
Platform Uptime 99.9%

Common Questions

Q: How does Grok know the answer?

Grok AI has access to real-time data from the internet. When resolving a market, it:

  • Queries the specified data source (CoinGecko, Yahoo Finance, etc.)
  • Checks historical data for the timeframe
  • Verifies the outcome against the market question
  • Returns a binary YES/NO answer with evidence

Q: Can Grok make mistakes?

While Grok is 99%+ accurate, edge cases can occur:

  • Ambiguous questions: Vague markets may get incorrect resolutions
  • Data discrepancies: Different sources showing different data
  • Breaking news: Very recent events not yet indexed
🛡️ Protection: If Grok's confidence is below 80%, we flag for manual review. Users can also dispute resolutions within 24 hours.

Q: What if Grok API is down?

We have a 3-tier fallback system:

  1. Primary: Grok API (99% success, instant)
  2. Fallback: Public Grok tagging (20% success, 1-24 hours)
  3. Emergency: Manual resolution after 24 hours

Result: 99.9% of markets resolve successfully!

Q: How much does it cost users?

Users pay a combined 1.5% fee on winnings:

  • 0.5% goes to the market creator (incentive)
  • 1.0% goes to platform treasury (operations)

Example: Win 10 SOL → Fees are 0.15 SOL → Net payout 9.85 SOL

Q: Can I manually resolve a market?

Yes! If you're the market creator or admin, you can manually resolve:

@solpredictbot resolve GM-ABC123 yes or @solpredictbot resolve GM-ABC123 no

This is useful if:

  • Grok's resolution is incorrect
  • Market has been stuck for 24+ hours
  • You have additional evidence

Next Steps

Now that you understand how Grok AI powers GrokMarkets:

🎉 Ready to Create Your First Market?
Tweet: @solpredictbot create "Will Solana reach $500 by end of 2025?"