Install
openclaw skills install polymarket-brainAutomates geopolitical and macroeconomic news analysis, matches expert insights to Polymarket odds, and posts actionable trade recommendations to Discord.
openclaw skills install polymarket-brainAutomated geopolitical and macroeconomic analysis pipeline that:
End Goal: Identify market mispricing opportunities where expert probability diverges from market odds.
Component: cnbc-geopolitics-fetcher
# Execution
cd cnbc-geopolitics-fetcher
python scripts/fetch_cnbc_geopolitics.py --config references/config.md --count 5
Behavior:
references/sent_urls.txt historyWebhook: https://discord.com/api/webhooks/1482043765471445333/...
History Management:
sent_urls.txtNo New Articles Behavior:
Classification Logic:
| News Content | Classification | Expert Skill |
|---|---|---|
| Military strikes, troop movements, Iran, Russia, Middle East, oil, war | Geopolitics | geopolitics-expert |
| Fed decisions, inflation, employment, Treasury yields, rates, currency | Macroeconomics | the-fed-agent |
| Mixed (war + markets, oil + Fed) | Both | Run both skills |
Expert Models:
Frameworks:
Outputs:
Frameworks:
Outputs:
8 Monitored Polymarket Markets:
| # | Market Name | Resolution Date | Expert Probability |
|---|---|---|---|
| 1 | Will Iranian regime fall by June 30? | Jun 30, 2026 | 15% |
| 2 | US-Iran ceasefire by December 31 | Dec 31, 2026 | 55% |
| 3 | Iran conflict ends by December 31 | Dec 31, 2026 | 60% |
| 4 | US forces enter Iran by December 31 | Dec 31, 2026 | 35% |
| 5 | Iran leadership change by December 31 | Dec 31, 2026 | 85% |
| 6 | Fed decision in March | Mar 2026 | 95% |
| 7 | Will crude oil CL hit $100+ by end of March | Mar 2026 | 90% |
| 8 | US recession by end of 2026 | End 2026 | 40% |
Matching Process:
Recommendation Logic:
| Market Odds | Expert Prob | Gap | Recommendation |
|---|---|---|---|
| < 30% Yes | Expert > 50% | 20%+ | Strong Yes ✅ |
| > 70% Yes | Expert < 50% | 20%+ | Strong No ❌ |
| Similar | Similar | < 10% | Fair Value ⚖️ |
| Expert > 70% | Market < 70% | - | Underpricing |
| Expert < 40% | Market > 60% | - | Overpricing |
Message Format:
Header:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 POLYMARKET-BRAIN WORKFLOW ACTIVATED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Time: YYYY-MM-DD HH:MM:SS
Version: 1.1
Markets Analyzing: X
Each Market (sent individually, 1.2s delay):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 POLYMARKET-BRAIN ANALYSIS: MARKET N/X
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 MARKET: [Market Name]
📅 Resolution Date: [Date]
📊 Market Odds: XX% Yes
🎯 Expert Probability: XX% Yes
💡 Recommendation: [Emoji] [Text]
📝 REASONING:
[Detailed reasoning from expert analysis]
🔗 Link: [Polymarket URL]
📈 Edge: XX% market mispricing
Analyzed by: [expert] | Confidence: HIGH
Summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 POLYMARKET-BRAIN WORKFLOW COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Summary:
• Total Markets Analyzed: X
• Strong Buys (Yes): X
• Strong Sells (No): X
• Expert Sources: [list]
• Data Source: CNBC World Politics
⏱️ Workflow Time: [timestamp]
🔄 Next Update: Check back for fresh analysis
Disclaimer: This is automated analysis. Not financial advice.
Rate Limit: 1.2 seconds between ALL messages (prevents Discord 429 rate limiting)
Webhook: https://discord.com/api/webhooks/1483478506070474922/...
# Windows
xcopy /E /I "C:\Users\Legion 5i Pro\.browseros\skills" "D:\new-env\.browseros\skills"
# Linux/Mac
cp -r ~/.browseros/skills /new/path/.browseros/skills
pip install requests crawl4ai python-dateutil
pip list | findstr "requests crawl4ai"
CNBC Fetcher:
Edit cnbc-geopolitics-fetcher/references/config.md:
DISCORD_WEBHOOK=https://discord.com/api/webhooks/1482043765471445333/YOUR_KEY_HERE
Polymarket Brain:
Edit polymarket_brain_orchestrator.py (lines 15-16):
PHASE1_DISCORD_WEBHOOK = "https://discord.com/api/webhooks/1482043765471445333/YOUR_KEY"
PHASE4_DISCORD_WEBHOOK = "https://discord.com/api/webhooks/1483478506070474922/YOUR_KEY"
cd polymarket-brain
python polymarket_brain_orchestrator.py
Expected: 5 articles posted, 5-8 markets analyzed, all sent to Discord.
Cause: Missing User-Agent header in urllib requests
Fix:
req = urllib.request.Request(webhook_url, data=data, headers={
'User-Agent': 'Polymarket-Brain/1.1',
'Content-Type': 'application/json'
})
Cause: Message exceeds Discord 2000 character limit
Fix: Shorten separator from "━" * 50 to fixed 40 chars
Cause: All URLs already in sent_urls.txt history
Fix: This is EXPECTED behavior. History growth = fewer new articles.
For testing: type nul > references/sent_urls.txt
Cause: Double underscores in URL (__) instead of hyphens
Fix:
# Wrong: https://polymarket.com/event/will-crude-oil-cl-hit__-by-end-of-march
# Right: https://polymarket.com/event/will-crude-oil-cl-hit-100-by-end-of-march
Cause: Hardcoded text instead of expert analysis
Fix: Use actual reasoning field from expert analysis output
Cause: Rapid sequential posts without delay
Fix: Add time.sleep(1.2) between ALL Discord messages
Cause: PowerShell one-liners with %VARIABLE% syntax
Fix: Use batch files (.bat) instead of PowerShell for Windows
Cause: "Legion 5i Pro" breaks command parsing
Fix: Use short name Legion~1 or full quotes:
cd "C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain"
polymarket-brain/
├── polymarket_brain_orchestrator.py # Main orchestrator (edit webhooks here)
├── SKILL.md # This documentation
├── README.md # Quick start guide
├── VERSION # v1.1
├── output/ # Analysis JSON outputs (auto-created)
│ ├── analysis_input_1.json
│ ├── analysis_input_2.json
│ └── ...
└── logs/ # Execution logs (auto-created)
cnbc-geopolitics-fetcher/
├── scripts/
│ └── fetch_cnbc_geopolitics.py # News fetcher script
├── references/
│ ├── config.md # Webhook config (LOCKED - edit here)
│ └── sent_urls.txt # URL history (clear for test)
├── SKILL.md # Detailed fetcher docs
└── LOCKED.md # Protection marker (READ BEFORE EDIT)
cd C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain
python polymarket_brain_orchestrator.py
type nul > C:\Users\Legion 5i Pro\.browseros\skills\cnbc-geopolitics-fetcher\references\sent_urls.txt
cd C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain
python polymarket_brain_orchestrator.py
import requests
webhook = "https://discord.com/api/webhooks/1482043765471445333/YOUR_KEY"
response = requests.post(webhook, json={"content": "test"})
print(response.status_code) # Should be 204
| Market | Expert Prob | Reasoning Framework |
|---|---|---|
| Iran regime fall | 15% | IRGC institutional depth, loyalty purges |
| US-Iran ceasefire | 55% | Trump unilateral stance, forever war risk |
| Iran conflict ends | 60% | Five Pathways, 35% forever war |
| US forces enter Iran | 35% | Ground invasion unlikely, air sufficient |
| Iran leadership change | 85% | ALREADY OCCURRED (Mojtaba appointed) |
| Oil $100+ March | 90% | Hormuz closure 40%, oil $140-160 risk |
| Market | Expert Prob | Reasoning Framework |
|---|---|---|
| Fed decision March | 95% | Fed HOLD at 95% per CME FedWatch |
| US recession 2026 | 40% | Stagflationary pressure, oil shocks |
import os
PHASE1_WEBHOOK = os.environ.get('PHASE1_DISCORD_WEBHOOK')
sent_urls.txt in productioncopy sent_urls.txt sent_urls.txt.baklogs/ directory| Version | Date | Changes |
|---|---|---|
| v1.1 | 2026-03-19 | No-new-news fix: Skip Phases 2-4 when no new articles, console notification only (no Discord post), PROD/TEST mode via env var |
| v1.1 | 2026-03-18 | Production deploy, migration docs, troubleshooting guide, expert reasoning populated |
| v1.0 | 2026-03-18 | Initial orchestration, all 4 phases working, webhooks fixed, URLs valid |
Skill Location: C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain\
Run Command:
cd C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain
python polymarket_brain_orchestrator.py
Webhooks:
14820437654714453331483478506070474922History File: ..\cnbc-geopolitics-fetcher\references\sent_urls.txt
Test Mode: Clear history file before run
pip install requests crawl4aiTime Estimate: 15-30 minutes for full setup
xcopy /E /I "C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain" "D:\backup\polymarket-brain"
xcopy /E /I "C:\Users\Legion 5i Pro\.browseros\skills\cnbc-geopolitics-fetcher" "D:\backup\cnbc-geopolitics-fetcher"
xcopy /E /I "D:\backup\polymarket-brain" "C:\Users\Legion 5i Pro\.browseros\skills\polymarket-brain"
xcopy /E /I "D:\backup\cnbc-geopolitics-fetcher" "C:\Users\Legion 5i Pro\.browseros\skills\cnbc-geopolitics-fetcher"
✅ Phase 1: 5 articles fetched, posted to Discord ✅ Phase 2: Expert analyses generated (geopolitics/fed) ✅ Phase 3: Markets matched with recommendations ✅ Phase 4: All messages sent to Discord (no 403/400 errors) ✅ URLs: All Polymarket links valid (no 404) ✅ Reasoning: Actual expert analysis (no placeholders) ✅ Rate Limiting: No 429 errors (1.2s delays working)
If all ✅, deployment successful.