Calculate probability ranges for Polymarket events based on network research and analysis. Use when user wants to estimate event probability, needs probabili...
--- name: polymarket-prob-analyzer description: Calculate probability ranges for Polymarket events based on network research and analysis. Use when user wants to estimate event probability, needs probability ranges for trading decisions, or requests analysis of Polymarket events by name or URL. metadata: author: 小赚 (@xiaozhuan) version: "2.2.0" displayName: Polymarket Probability Analyzer difficulty: beginner --- # Polymarket Probability Analyzer **Analyze Polymarket events and calculate probability ranges.** ## Overview This skill analyzes Polymarket events by gathering information from multiple online sources and calculating estimated probability ranges. Uses SkillPay.me for billing - **0.001 USDT per analysis**. ## How It Works The analyzer follows a multi-step process: 1. **Event Identification**: Parse event name or Polymarket URL provided by user 2. **Information Gathering**: Search for relevant news, expert opinions, and historical data 3. **Probability Calculation**: Analyze gathered information to estimate probability ranges 4. **Billing Check**: Check user's SkillPay.me balance, return payment link if needed 5. **Analysis Delivery**: Return probability ranges with confidence levels ## Billing Flow (Using Correct SkillPay API Endpoints) **First-Time Users:** 1. Skill checks balance via `/api/v1/billing/balance` 2. If balance ≤ 0, generates payment link via `/api/v1/billing/payment-link` 3. User clicks link, pays 8.00 USDT (minimum top-up) 4. User re-runs command, analysis proceeds **Subsequent Uses:** 1. Skill checks balance via `/api/v1/billing/balance` 2. If balance ≥ 0.001 USDT, charges via `/api/v1/billing/charge` 3. Analysis proceeds immediately **No registration required!** Users just need to pay once and can use the skill unlimited times. ## Quick Start ```bash # Analyze an event by name python scripts/prob_analyzer.py --event "Will Bitcoin hit $100k by 2025?" # Analyze by Polymarket URL python scripts/prob_analyzer.py --url https://polymarket.com/event/bitcoin-100k # Get detailed breakdown python scripts/prob_analyzer.py --event "Trump 2024" --verbose # Skip billing check (dev mode) python scripts/prob_analyzer.py --event "Test" --skip-billing ``` ## Usage ### First Use (if balance insufficient) ``` User: "Analyze Bitcoin price to $100k" → Skill checks SkillPay.me balance → Balance insufficient → returns payment link → User clicks link, pays 8.00 USDT → User re-runs command → Analysis proceeds, returns probability ranges ``` ### Subsequent Uses (balance sufficient) ``` User: "Analyze Bitcoin price to $90k" → Skill checks SkillPay.me balance → Balance sufficient → runs analysis → Returns: Low: 40%, Mid: 60%, High: 75% ``` ## Output Format ### Standard Output ``` 🎯 Event: Will Bitcoin hit $100k by 2025? 📊 Probability Range: Low: 35.0% (Conservative estimate) Mid: 55.0% (Balanced estimate) High: 70.0% (Optimistic estimate) 📈 Confidence: Medium 🔑 Key Factors: • Institutional adoption increasing • Regulatory uncertainty remains • Market volatility expected • Historical price patterns suggest upward trend 📚 Sources: 12 sources analyzed ``` ### Payment Link Format When user balance is insufficient: ``` 💳 Checking SkillPay.me billing status... User ID: gateway_xxx... Cost: 0.001 USDT 💳 Payment Required - First-Time User 👉 https://skillpay.me/checkout/[link] 💰 To use this skill, please complete a one-time payment: Amount: 8.00 USDT (minimum top-up) Network: BNB Chain Currency: USDT (BEP-20) After payment, you'll get 8.00 + 0.001 = 8.001 USDT total balance Each analysis costs 0.001 USDT 💡 After completing payment, re-run this command to get your analysis! ``` ### Verbose Output Includes additional details: - Source citations - Factor weighting - Historical comparisons - Alternative scenarios - Risk factors ## Features ### Event-Specific Analysis **Bitcoin/Crypto Events:** - Institutional adoption trends - Regulatory developments - Technical analysis (resistance levels, momentum) - Historical 4-year cycles - ETF flows and institutional interest **Political Events (Trump/Elections):** - Historical incumbent advantage - Current polling data - Economic indicators - Swing state analysis - Turnout patterns **Economic Events (Fed/Rates):** - Inflation trends - Economic growth indicators - Fed signaling and stance - Market expectations - Historical rate patterns ### Probability Calculation For each event, skill calculates: - **Low Estimate (20-40%)**: Conservative, considers negative scenarios - **Mid Estimate (40-60%)**: Balanced, weighs all available information - **High Estimate (60-80%)**: Optimistic, assumes favorable conditions Each estimate includes: - Confidence level (Low/Medium/High) - Key influencing factors - Source citations ## Environment Variables ### Developer Variables (for publishing) ```bash export SKILLPAY_API_KEY=sk_f549ac2997d346d904d7908b87223bb13a311a53c0fa2f8e4627ae3c2d37b501 export SKILLPAY_SKILL_ID=polymarket-prob-analyzer export SKILLPAY_PRICE=0.001 ``` ### User Variables (auto-generated) No user configuration required! User ID is automatically generated from: - Telegram ID (if available) - OpenClaw Gateway ID - System username - UUID fallback ## Developer Setup ### First-Time Setup 1. Register on SkillPay.me 2. Get your API key 3. Set environment variables (see above) 4. Package and publish skill ### Testing ```bash # Test without billing python scripts/prob_analyzer.py --event "Test" --skip-billing # Test with billing python scripts/prob_analyzer.py --event "Bitcoin $100k" ``` ## Billing Details - **Cost**: 0.001 USDT per analysis - **Currency**: USDT (BEP-20 on BNB Chain) - **Processor**: SkillPay.me - **Revenue Share**: 95% to developer, 5% platform fee - **User Experience**: One-time payment, then unlimited use ## Troubleshooting **"Payment Required"** → Click the provided payment link → Pay 8.00 USDT (minimum top-up) with your wallet → Re-run the analysis command **"Insufficient balance" (first use)** → Click payment link → Complete one-time payment → Re-run command for unlimited use **"Payment failed"** → Check your SkillPay.me balance → Ensure wallet has sufficient USDT (BEP-20) → Contact SkillPay.me support **"API error"** → Check internet connection → Verify SkillPay.me service status → Retry the command ## Technical Details - **Language**: Python 3 - **Dependencies**: requests (HTTP client) - **Billing API**: SkillPay.me v1 endpoints - `/api/v1/billing/balance` - Check user balance - `/api/v1/billing/payment-link` - Generate payment link (first-time users) - `/api/v1/billing/charge` - Charge per use - **Event Parsing**: Regex-based URL parsing - **Probability Algorithm**: Heuristic analysis based on event keywords ## Best Practices 1. **Provide clear event names**: More specific events get better analysis 2. **Use verbose mode for important decisions**: Get detailed reasoning and factors 3. **Review confidence levels**: High confidence results are more reliable 4. **Consider the full probability range**: Don't focus only on the midpoint ## Version History - **2.2.0**: Updated to correct SkillPay API endpoints (v1/billing/balance, payment-link, charge) - matches polymarket-autotrader implementation - **2.1.1**: Attempted update (failed during publish) - **2.1.0**: Previous implementation - **2.0.0**: Billing improvements - **1.7.0-2.0.2**: Various payment integration attempts - **1.0.0**: Initial release --- **Built with ❤️ by 小赚**
don't have the plugin yet? install it then click "run inline in claude" again.