Skill: georges91560/polymarket-oracle (version 1.0.1)

--- name: polymarket-oracle description: Multi-strategy arbitrage and trading bot for Polymarket prediction markets. Scans ALL markets (crypto, politics, sports, economics, entertainment) for parity arbitrage, logical arbitrage, tail-end trading, market making, and latency opportunities. version: 1.0.0 metadata: openclaw: emoji: "🎯" requires: bins: ["python3"] env: required: - POLYMARKET_API_KEY - POLYMARKET_SECRET - POLYMARKET_PASSPHRASE optional: - TELEGRAM_BOT_TOKEN # For alerts only - TELEGRAM_CHAT_ID # For alerts only - WALLET_PRIVATE_KEY # Only for initial API key creation, not runtime network_behavior: makes_requests: true endpoints_allowed: - "https://clob.polymarket.com/*" - "https://gamma-api.polymarket.com/*" - "wss://ws-subscriptions-clob.polymarket.com/*" - "https://api.telegram.org/bot*" requires_credentials: true uses_websocket: true security_level: "L3 - Financial Execution (Real Money)" author: "Georges Andronescu (Wesley Armando)" license: "MIT" homepage: "https://github.com/georges91560/polymarket-oracle" repository: "https://github.com/georges91560/polymarket-oracle" --- # Polymarket Oracle — Multi-Strategy Arbitrage Bot ## 🎯 WHAT IT DOES **Scans ALL Polymarket markets for profitable opportunities.** **Markets covered:** - ✅ **Crypto** (BTC, ETH, altcoins - 5min, 15min, daily markets) - ✅ **Politics** (Elections, policy, polls, debates) - ✅ **Sports** (NBA, NFL, MLB, NHL, Soccer, UFC, Tennis, Golf) - ✅ **Economics** (Fed rates, CPI, jobs, GDP, stock markets) - ✅ **Technology** (Apple, Tesla, Google, IPOs, launches) - ✅ **Entertainment** (Oscars, Emmys, box office, celebrities) - ✅ **Weather** (Hurricanes, temperatures, climate events) - ✅ **Miscellaneous** (Viral events, trends, binary outcomes) **Total:** 1000-5000+ markets scanned continuously --- ## 🔥 STRATEGIES DETECTED ### **1. Parity Arbitrage** **What:** YES + NO prices don't sum to $1.00 ``` YES price: $0.45 NO price: $0.52 Total: $0.97 Buy both → Guaranteed payout: $1.00 Profit: $0.03 (3.1%) Risk: ZERO (guaranteed profit) ``` **Frequency:** 5-20 per day **Duration:** 2-15 seconds **Win rate:** 100% (if executed) --- ### **2. Logical Arbitrage** **What:** Impossible price combinations between related markets ``` Market A: "Chiefs win Super Bowl" = 28% Market B: "AFC team wins" = 24% Impossible! Chiefs ARE an AFC team! Buy "AFC wins" at 24% If Chiefs win (28%) → AFC wins → Profit If other AFC wins → Profit Cannot lose unless NFC wins ``` **Frequency:** 2-10 per day **Duration:** Minutes to hours **Win rate:** 90-95% --- ### **3. Tail-End Trading** **What:** Buy highly certain outcomes (>95%) just before resolution ``` Event: Fed keeps rates (99% certain) Market price: $0.97 Buy at $0.97 Resolution: $1.00 Profit: $0.03 (3.1%) Risk: Very low (event almost certain) ``` **Frequency:** 10-30 per day **Duration:** Hours to days **Win rate:** 95-98% --- ### **4. Market Making** **What:** Provide liquidity, earn spread + maker rebates ``` Token midpoint: $0.50 Place orders: BID: $0.475 (maker) ASK: $0.525 (maker) Spread capture: $0.05 (10%) + Polymarket rebates + Liquidity rewards (3x multiplier) Monthly: 10-25% annualized ``` **Frequency:** Continuous **Duration:** Indefinite **Win rate:** 80-90% (inventory risk) --- ### **5. Latency Arbitrage** **What:** Trade on information before market adjusts ``` Bitcoin 5-min market: - Monitor Binance/Chainlink feed - When price crosses threshold - Bot knows resolution 2-15s before UI Trade before market reacts ``` **Frequency:** 50-200 per day (crypto markets) **Duration:** Seconds **Win rate:** 70-85% --- ### **6. Combinatorial Arbitrage (AI-powered)** **What:** Find mispriced relationships between multiple markets ``` Using sentence embeddings (e5-large-v2) Find related markets: - "Trump wins election" - "Trump wins popular vote" - "Trump wins by 5%+" If Trump wins by 5%+ → wins popular vote But prices show 30% vs 48% = Mispricing ``` **Frequency:** 3-15 per day **Duration:** Hours to days **Win rate:** 75-90% --- ## 📊 MARKET CATEGORIZATION **Automatic categorization by keywords:** ```python Categories = { 'crypto': Bitcoin, Ethereum, DeFi, altcoins 'politics': Elections, presidents, votes, polls 'sports': NBA, NFL, Soccer, UFC, Tennis 'economics': Fed, CPI, jobs, GDP, stocks 'technology': Apple, Tesla, Google, IPOs 'entertainment': Oscars, movies, celebrities 'weather': Hurricanes, temperatures, climate 'other': Everything else } ``` **Strategy application:** - Crypto → Latency + Market Making - Politics → Logical + Tail-End - Sports → Parity + News Arbitrage - Economics → Tail-End + Market Making - All → Parity + Combinatorial --- ## ⚡ EXECUTION SPEED **Parallel Scanning:** ``` Workers: 50 parallel threads Markets scanned: 1000-2000 per minute Opportunities detected: Real-time Execution: <1 second from detection ``` **Scan Cycle:** ``` 00s - Fetch all active markets (Gamma API) 05s - Categorize markets automatically 10s - Parallel scan with 50 workers 30s - Detect opportunities across 5 strategies 35s - Alert via Telegram 40s - Wait 20 seconds 60s - REPEAT ``` --- ## 💰 CAPITAL ALLOCATION **Default configuration:** ``` Total capital: $10,000 (configurable) Max per market: $1,000 (1-10% of capital) Strategy allocation: - Parity arb: 20% ($2,000) - Tail-end: 40% ($4,000) - Market making: 30% ($3,000) - Latency: 10% ($1,000) ``` **Position sizing:** - High certainty (>95%): $500-$5,000 - Medium certainty (90-95%): $200-$2,000 - Speculative (<90%): $100-$1,000 --- ## 📱 TELEGRAM ALERTS **Real-time notifications:** ``` 🎯 POLYMARKET OPPORTUNITIES Found 27 opportunities: PARITY_ARBITRAGE: 8 TAIL_END: 12 MARKET_MAKING: 5 LATENCY: 2 Top 5 by profit: • parity_arbitrage: 4.23% NBA Lakers vs Warriors - Game Winner... • tail_end: 3.87% Fed Rate Decision - Keeps Rates... • parity_arbitrage: 3.54% Bitcoin Closes Above $45K Today... • tail_end: 3.12% Super Bowl Winner - Chiefs... • market_making: 2.89% Ethereum Above $2500 - 5min... ``` --- ## 🛡️ RISK MANAGEMENT **Built-in protections:** - Max position per market - Total capital limits - Strategy diversification - Event resolution monitoring - Inventory risk tracking **Circuit breakers:** ``` Daily loss > 5% → Pause 1 hour Total drawdown > 10% → Alert + reduce sizes API rate limits → Auto-throttle Failed trades > 10 → Pause strategy ``` --- ## 🎯 PERFORMANCE TARGETS **Conservative (Parity + Tail-End):** ``` Capital: $10,000 Monthly ROI: 8-15% Monthly profit: $800-$1,500 Trades/day: 10-30 Win rate: 92-98% ``` **Aggressive (All Strategies):** ``` Capital: $50,000 Monthly ROI: 15-30% Monthly profit: $7,500-$15,000 Trades/day: 50-200 Win rate: 80-90% ``` **Real stats (from research):** - $40M extracted April 2024 - April 2025 - Top users: $1K-$2.2M profits - Bot win rates: 70-99% - Opportunities duration: 2s-48h --- ## 📊 API USAGE **Gamma API (Market Discovery):** ``` GET /markets - Get all active markets GET /markets/{id} - Get market details Rate limit: 60 req/min ``` **CLOB API (Trading):** ``` GET /book?token_id={id} - Order book GET /midpoint?token_id={id} - Midpoint price GET /price?token_id={id}&side={BUY/SELL} - Best price POST /order - Place order DELETE /order - Cancel order Rate limit: Public 60/min, Authenticated 100/min ``` **WebSocket (Real-time):** ``` wss://ws-subscriptions-clob.polymarket.com/ws/market/{token_id} - Order book updates - Trade updates - Price changes ``` --- ## 🔒 SECURITY & TRANSPARENCY **What it does:** - ✅ Scans public Polymarket markets - ✅ Places orders via CLOB API - ✅ Uses your Polygon wallet - ✅ Trades with your USDC - ✅ Reports via Telegram **What it requires:** - ✅ Polymarket API credentials - ✅ Polygon wallet private key - ✅ USDC balance on Polygon - ✅ Telegram bot (alerts) **Safeguards:** - ✅ Position size limits - ✅ Strategy diversification - ✅ Event resolution monitoring - ✅ Circuit breakers - ✅ Full audit trail **Never:** - ❌ Trades without detection - ❌ Exceeds position limits - ❌ Bypasses risk controls --- ## ⚠️ IMPORTANT NOTES **Polymarket specifics:** - Operates on Polygon (low gas fees) - Trades settle on-chain (USDC) - Events resolve when outcome known - Markets can be cancelled/invalid - Fees: 2% on winners (some markets) **Capital requirements:** - Minimum: $1,000 (limited opportunities) - Recommended: $5,000-$10,000 - Professional: $50,000+ **Legal:** - Check local regulations - Prediction markets may be restricted - Use at your own risk - Not financial advice --- **Version:** 1.0.0 **License:** MIT **Author:** Georges Andronescu (Wesley Armando) **SCAN EVERYTHING. TRADE EVERYTHING. PROFIT EVERYWHERE. 🎯💰** --- **END OF SKILL**

path: CONFIGURATION.md
content: # Configuration Guide

**Polymarket Oracle v1.0.0 - Complete Setup**

---

## Prerequisites

- Python 3.7+ (standard library only)
- Polygon wallet with USDC
- Polymarket account
- Telegram bot (optional but recommended)
- Capital: $1K-$50K+

---

## Step 1: Polymarket Account Setup

### **Create Account**

1. Go to https://polymarket.com
2. Click "Connect Wallet"
3. Use MetaMask, WalletConnect, or email
4. Complete onboarding

---

### **Fund Wallet with USDC**

**On Polygon network:**

1. **Buy USDC** on exchange (Coinbase, Binance, etc.)
2. **Bridge to Polygon:**
   - Use https://wallet.polygon.technology/polygon/bridge
   - Or use exchange withdrawal directly to Polygon
3. **Send to your wallet address**

**Amounts:**
- Minimum: $1,000 (limited opportunities)
- Recommended: $5,000-$10,000 (balanced)
- Professional: $50,000+ (full strategies)

---

## Step 2: API Credentials

### **Generate Polymarket API Keys**

**Method 1: Using py-clob-client (Recommended)**

```bash
# Install official client
pip install py-clob-client

# Generate credentials
python3 << 'EOF'
from py_clob_client.client import ClobClient

# Initialize client
client = ClobClient(
    host="https://clob.polymarket.com",
    key="YOUR_WALLET_PRIVATE_KEY",  # From MetaMask
    chain_id=137  # Polygon
)

# Create API credentials
creds = client.create_api_key()

print("=== SAVE THESE CREDENTIALS ===")
print(f"API Key: {creds['apiKey']}")
print(f"[REDACTED_SECRET]'secret']}")
print(f"Passphrase: {creds['passphrase']}")
print("===============================")
EOF
```

---

**Method 2: Via Polymarket Dashboard**

1. Go to https://polymarket.com/settings/api
2. Click "Create API Key"
3. Save credentials (shown once!)

---


## ⚠️ CRITICAL SECURITY - WALLET PRIVATE KEY

**IMPORTANT:** Your wallet private key is needed **ONLY ONCE** to create Polymarket API credentials.

### **🔒 DO THIS (Secure Setup):**

#### **Step 1: Generate API Keys Locally (One-Time)**

```bash
# On your LOCAL MACHINE (not server!)
pip install py-clob-client

python3 << 'EOF'
from py_clob_client.client import ClobClient

client = ClobClient(
    host="https://clob.polymarket.com",
    key="YOUR_WALLET_PRIVATE_KEY",  # Used ONCE here
    chain_id=137
)

creds = client.create_api_key()

print("=== SAVE THESE - YOU'LL NEED THEM ===")
print(f"API Key: {creds['apiKey']}")
print(f"[REDACTED_SECRET]'secret']}")
print(f"Passphrase: {creds['passphrase']}")
print("======================================")
EOF

# Your private key was used ONCE above.
# You will NOT need it again for the bot!
```

---

#### **Step 2: Store API Keys Securely on Server**

```bash
# On your SERVER (where bot runs)
# Create secure credentials file
sudo mkdir -p /etc/polymarket-oracle
sudo nano /etc/polymarket-oracle/credentials.env

# Paste ONLY these (NO private key!):
POLYMARKET_API_KEY=your_api_key_from_step1
POLYMARKET_SECRET=your_secret_from_step1
POLYMARKET_PASSPHRASE=your_passphrase_from_step1
TELEGRAM_BOT_TOKEN=your_telegram_token  # Optional
TELEGRAM_CHAT_ID=your_chat_id          # Optional
POLYMARKET_CAPITAL=10000

# Secure the file
sudo chmod 600 /etc/polymarket-oracle/credentials.env
sudo chown root:root /etc/polymarket-oracle/credentials.env
```

---

#### **Step 3: Use Credentials File**

```bash
# Load credentials before running bot
source /etc/polymarket-oracle/credentials.env

# Or add to your systemd service (see SYSTEMD_SETUP.md):
EnvironmentFile=/etc/polymarket-oracle/credentials.env
```

---

### **❌ DO NOT DO THIS (Insecure):**

```bash
# ❌ NEVER store private key on server
❌ export WALLET_PRIVATE_KEY=... in ~/.bashrc
❌ Put WALLET_PRIVATE_KEY in systemd service file
❌ Put WALLET_PRIVATE_KEY in /etc/polymarket-oracle/credentials.env
❌ Commit WALLET_PRIVATE_KEY to git
❌ Store private key anywhere long-term

# ❌ NEVER use .env file in project directory
❌ cat > .env << 'EOF'
❌ WALLET_PRIVATE_KEY="..."
❌ EOF
```

---

### **🎯 Why This Matters**

**Private key gives FULL CONTROL of your wallet:**
- Can withdraw all funds
- Can sign any transaction
- Cannot be revoked

**API keys give LIMITED CONTROL:**
- Can only trade on Polymarket
- Cannot withdraw funds
- Can be revoked anytime

**Your private key should NEVER be on the server where the bot runs!**

**The bot code uses ONLY API credentials at runtime.**

chmod 600 .env
```

---

## Step 3: Telegram Setup (Optional)

### **Create Bot**

1. Open Telegram
2. Search: `@BotFather`
3. Send: `/newbot`
4. Name: `Polymarket Oracle`
5. Username: `your_polymarket_oracle_bot`
6. Save **BOT_TOKEN**

---

### **Get Chat ID**

```bash
# Method 1: Send message then check
# 1. Send any message to your bot
# 2. Visit (replace TOKEN):
https://api.telegram.org/botYOUR_TOKEN/getUpdates

# 3. Find "chat":{"id":123456789}

# Method 2: Use @userinfobot
# Search @userinfobot in Telegram
# Start chat → bot shows your ID
```

---

### **Test Telegram**

```bash
python3 << 'EOF'
import urllib.request, json, os

[REDACTED_SECRET]"
chat_id = "YOUR_CHAT_ID"

url = f"https://api.telegram.org/bot{token}/sendMessage"
data = json.dumps({
    "chat_id": chat_id,
    "text": "✅ Polymarket Oracle - Telegram configured!"
}).encode()

req = urllib.request.Request(url, data, {'Content-Type': 'application/json'})
urllib.request.urlopen(req)
print("✅ Test message sent")
EOF
```

---

## Step 4: Environment Variables

### **Set Variables**

```bash
# Polymarket credentials
export POLYMARKET_API_KEY="your_api_key"
export POLYMARKET_SECRET="your_secret"
export POLYMARKET_PASSPHRASE="your_passphrase"
export WALLET_PRIVATE_KEY="0x..."

# Telegram (optional)
export TELEGRAM_BOT_TOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"

# Capital allocation
export POLYMARKET_CAPITAL="10000"  # $10K default
```

---

### **Make Permanent**

```bash
# Add to ~/.bashrc or ~/.zshrc
cat >> ~/.bashrc << 'EOF'
# Polymarket Oracle
export POLYMARKET_API_KEY="..."
export POLYMARKET_SECRET="..."
export POLYMARKET_PASSPHRASE="..."
export WALLET_PRIVATE_KEY="..."
export TELEGRAM_BOT_TOKEN="..."
export TELEGRAM_CHAT_ID="..."
export POLYMARKET_CAPITAL="10000"
EOF

# Reload
source ~/.bashrc
```

---

## Step 5: Installation

### **Clone Repository**

```bash
git clone https://github.com/georges91560/polymarket-oracle.git
cd polymarket-oracle
```

---

### **Verify**

```bash
# Check Python version
python3 --version
# Should be 3.7+

# Check script
ls -lh polymarket_oracle.py
# Should exist

# Permissions
chmod +x polymarket_oracle.py
```

---

## Step 6: Test Run

### **Simulation Mode (No API)**

```bash
# Run without API credentials
python3 polymarket_oracle.py
```

**Expected:**
```
============================================================
POLYMARKET ORACLE - Multi-Strategy Scanner
============================================================
[CONFIG] Capital: $10,000
[CONFIG] Max per market: $1,000
[WARNING] No API credentials - simulation mode only
[GAMMA] Fetched 2,341 markets
[MARKETS] Categories: {'crypto': 127, 'politics': 543, ...}
[SCAN] Scanning 2,341 markets with 50 workers...
[SCAN] Found 12 opportunities
```

**Simulation mode:**
- ✅ Scans all markets
- ✅ Detects opportunities
- ✅ Logs to files
- ✅ Sends Telegram alerts
- ❌ Cannot place real orders

---

### **Live Mode (With API)**

```bash
# Set credentials first
export POLYMARKET_API_KEY="..."
export POLYMARKET_SECRET="..."
export POLYMARKET_PASSPHRASE="..."

# Run
python3 polymarket_oracle.py
```

**Expected:**
```
[CONFIG] Capital: $10,000
[CONFIG] Max per market: $1,000
✅ API credentials configured
```

**Live mode:**
- ✅ Can place real orders
- ✅ Executes trades
- ⚠️ Uses real money!

---

## Configuration Options

### **Capital Settings**

```python
# In polymarket_oracle.py or via env vars

# Total capital
TOTAL_CAPITAL = 10000  # $10K

# Max per market (1-10% of capital)
MAX_POSITION_PER_MARKET = 1000  # $1K

# Strategy-specific
parity_max = 500  # $500 for parity arb
tail_end_max = 5000  # $5K for tail-end (safest)
```

---

### **Strategy Thresholds**

```python
# Minimum profit requirements

MIN_PARITY_PROFIT = 0.02  # 2% minimum
# Lower = more opportunities, less profit each
# Higher = fewer opportunities, more profit each

MIN_TAIL_END_CERTAINTY = 0.95  # 95% minimum
# Higher = safer but fewer opportunities
# Lower = more opportunities but riskier

MIN_MARKET_MAKING_SPREAD = 0.025  # 2.5%
# Account for fees (2% winner fee on some markets)
```

---

### **Scan Settings**

```python
SCAN_INTERVAL = 60  # Seconds between scans
# Lower = more frequent scans, higher API usage
# Higher = less frequent, might miss fast opportunities

MAX_WORKERS = 50  # Parallel scanning threads
# More = faster scanning but higher CPU usage
# Less = slower but lighter on resources
```

---

## Risk Configuration

### **Conservative (Safest)**

```python
# Focus on guaranteed/near-guaranteed profits
TOTAL_CAPITAL = 5000
MAX_POSITION_PER_MARKET = 500

MIN_PARITY_PROFIT = 0.025  # 2.5%
MIN_TAIL_END_CERTAINTY = 0.97  # 97%

# Enable only safest strategies
# In scanner, comment out risky strategies
```

**Target:** 8-12% monthly, 95%+ win rate

---

### **Balanced (Recommended)**

```python
# Mix of safe + moderate risk
TOTAL_CAPITAL = 10000
MAX_POSITION_PER_MARKET = 1000

MIN_PARITY_PROFIT = 0.02  # 2%
MIN_TAIL_END_CERTAINTY = 0.95  # 95%

# Enable parity + tail-end + market making
```

**Target:** 12-20% monthly, 88-92% win rate

---

### **Aggressive (High Risk)**

```python
# All strategies, lower thresholds
TOTAL_CAPITAL = 50000
MAX_POSITION_PER_MARKET = 5000

MIN_PARITY_PROFIT = 0.015  # 1.5%
MIN_TAIL_END_CERTAINTY = 0.90  # 90%

# Enable all 6 strategies
```

**Target:** 15-30% monthly, 80-85% win rate

---

## Monitoring

### **Real-Time Logs**

```bash
# Terminal output
python3 polymarket_oracle.py

# Or run in background
nohup python3 polymarket_oracle.py > oracle.log 2>&1 &

# Watch logs
tail -f oracle.log
```

---

### **Opportunities Detected**

```bash
# View all detected opportunities
tail -f /workspace/polymarket_opportunities.jsonl

# Count by strategy
cat /workspace/polymarket_opportunities.jsonl | jq '.strategy' | sort | uniq -c
```

---

### **Trades Executed**

```bash
# View trades
tail -f /workspace/polymarket_trades.jsonl

# Calculate total profit
cat /workspace/polymarket_trades.jsonl | jq '.profit' | awk '{sum+=$1} END {print sum}'
```

---

## Troubleshooting

### **"Failed to fetch markets"**

**Cause:** Gamma API timeout or rate limit

**Fix:**
```bash
# Check API status
curl https://gamma-api.polymarket.com/markets?limit=1

# If working, increase timeout or retry
```

---

### **"API error: Unauthorized"**

**Cause:** Wrong credentials or expired

**Fix:**
```bash
# Regenerate API credentials
# Update environment variables
# Restart bot
```

---

### **"Order rejected: Insufficient balance"**

**Cause:** Not enough USDC

**Fix:**
```bash
# Check balance on Polygon
# Add more USDC to wallet
# Reduce MAX_POSITION_PER_MARKET
```

---

### **"Found 0 opportunities"**

**Normal** - Opportunities are sporadic

**Reasons:**
- Efficient markets (bots already took arb)
- Strict thresholds
- Low activity period

**Actions:**
- Lower MIN thresholds
- Wait longer (opportunities come in waves)
- Check if specific categories are active
```

---

## Running as Service

### **Systemd Service (Linux)**

```bash
sudo nano /etc/systemd/system/polymarket-oracle.service
```

**Content:**
```ini
[Unit]
Description=Polymarket Oracle Scanner
After=network.target

[Service]
Type=simple
User=your_username
WorkingDirectory=/path/to/polymarket-oracle
Environment="POLYMARKET_API_KEY=..."
Environment="POLYMARKET_SECRET=..."
Environment="POLYMARKET_PASSPHRASE=..."
Environment="WALLET_PRIVATE_KEY=..."
Environment="TELEGRAM_BOT_TOKEN=..."
Environment="TELEGRAM_CHAT_ID=..."
Environment="POLYMARKET_CAPITAL=10000"
ExecStart=/usr/bin/python3 /path/to/polymarket-oracle/polymarket_oracle.py
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
```

**Enable:**
```bash
sudo systemctl daemon-reload
sudo systemctl enable polymarket-oracle
sudo systemctl start polymarket-oracle
sudo systemctl status polymarket-oracle
```

---

## Best Practices

### ✅ **DO:**

- Start with small capital ($1K-$5K)
- Run in simulation mode first
- Monitor daily for first week
- Review opportunities before live trading
- Use Telegram alerts
- Keep API keys secure
- Check Polymarket terms of service

### ❌ **DON'T:**

- Trade without understanding strategies
- Exceed your risk tolerance
- Ignore position limits
- Share API credentials
- Deploy without testing
- Use capital you can't afford to lose

---

## Advanced Tips

### **Focus on Specific Markets**

```python
# In main(), filter markets
categories_to_scan = ['crypto', 'sports']
markets = [m for m in all_markets 
           if MarketCategorizer.categorize(m.get('question', '')) in categories_to_scan]
```

---

### **Adjust Scan Speed**

```python
# Faster scanning (more CPU, more opportunities)
SCAN_INTERVAL = 30  # Every 30s
MAX_WORKERS = 100  # More parallel workers

# Slower scanning (less CPU, lower costs)
SCAN_INTERVAL = 120  # Every 2 minutes
MAX_WORKERS = 20
```

---

## Support

**Issues:** https://github.com/georges91560/polymarket-oracle/issues  
**Docs:** https://github.com/georges91560/polymarket-oracle  
**Polymarket Docs:** https://docs.polymarket.com

---

**Scan everything. Configure wisely. Profit systematically. 🎯💰**

---

**END OF CONFIGURATION GUIDE**


---

**Scan everything. Configure wisely. Profit systematically. 🎯💰**

---

**END OF CONFIGURATION GUIDE**


path: README.md
content: # Polymarket Oracle 🎯

**Multi-strategy arbitrage bot for Polymarket prediction markets**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/georges91560/polymarket-oracle)
[![Python](https://img.shields.io/badge/python-3.7+-blue.svg)](https://python.org)

Multi-Strategy · All Markets · Real-Time Scanning · Telegram Alerts

---

## 🎯 What It Does

Automatically scans **ALL Polymarket markets** for profitable opportunities:

✅ **1000-5000 markets** scanned every minute  
✅ **7 categories** covered (crypto, politics, sports, economics, etc.)  
✅ **6 strategies** detected (parity, logical, tail-end, market making, latency, combinatorial)  
✅ **50 parallel workers** for fast scanning  
✅ **Telegram alerts** when opportunities found  

---

## 💰 Strategies Explained

### **1. Parity Arbitrage (Easiest)**

```
When: YES + NO ≠ $1.00
Example:
  YES = $0.45
  NO = $0.52
  Total = $0.97

Action: Buy both
Cost: $0.97
Payout: $1.00 (guaranteed)
Profit: $0.03 (3.1%)

Risk: ZERO
Win rate: 100%
```

---

### **2. Tail-End Trading (Safest)**

```
When: Outcome >95% certain
Example:
  "Fed keeps rates" = 99% certain
  Market price = $0.97

Action: Buy at $0.97
Payout: $1.00
Profit: $0.03 (3.1%)

Risk: Very low
Win rate: 95-98%
```

---

### **3. Logical Arbitrage (Smartest)**

```
When: Related markets mispriced
Example:
  "Chiefs win Super Bowl" = 28%
  "AFC team wins" = 24%
  
  Impossible! Chiefs ARE AFC!

Action: Buy "AFC wins" @ 24%
  If Chiefs win (28%) → Profit
  If other AFC wins → Profit
  Cannot lose unless NFC wins

Risk: Low
Win rate: 90-95%
```

---

### **4. Market Making (Most Consistent)**

```
When: Provide liquidity
Example:
  Midpoint = $0.50
  
Action:
  BID @ $0.475 (maker)
  ASK @ $0.525 (maker)
  
Spread: $0.05 (10%)
+ Maker rebates
+ Liquidity rewards

Monthly: 10-25% annualized
```

---

### **5. Latency Arbitrage (Fastest)**

```
When: Fast events (BTC 5-min)
How:
  Monitor Binance/Chainlink
  Detect price cross
  Know resolution 2-15s early
  Trade before market adjusts

Win rate: 70-85%
Frequency: 50-200/day
```

---

### **6. Combinatorial (AI-Powered)**

```
When: Multiple related markets
How:
  AI finds similar markets
  Detects impossible combinations
  Exploits mispricing

Example:
  "Trump wins by 5%+" = 30%
  "Trump wins pop vote" = 48%
  
  If wins by 5%+ → wins pop vote
  But 30% < 48% = Mispriced

Win rate: 75-90%
```

---

## 📊 Markets Covered

**ALL Polymarket categories:**

| Category | Examples | Markets |
|----------|----------|---------|
| **Crypto** | BTC, ETH, DeFi, altcoins | 100-300 |
| **Politics** | Elections, polls, policy | 200-600 |
| **Sports** | NBA, NFL, Soccer, UFC | 400-900 |
| **Economics** | Fed, CPI, jobs, stocks | 30-100 |
| **Tech** | Apple, Tesla, IPOs | 50-150 |
| **Entertainment** | Oscars, movies, celebs | 100-300 |
| **Weather** | Hurricanes, temps | 20-80 |
| **Other** | Viral events, misc | 100-500 |

**Total:** 1000-5000+ markets active

---

## 🚀 Quick Start

### **Step 1: Install**

```bash
git clone https://github.com/georges91560/polymarket-oracle.git
cd polymarket-oracle
```

No dependencies needed - uses Python standard library only!

---

### **Step 2: Polymarket API Setup**

1. Go to https://polymarket.com
2. Connect wallet (MetaMask/WalletConnect)
3. Generate API credentials:
   ```bash
   # Using py-clob-client
   pip install py-clob-client
   
   python3 << EOF
   from py_clob_client.client import ClobClient
   client = ClobClient("https://clob.polymarket.com")
   creds = client.create_api_key()
   print("API Key:", creds['apiKey'])
   print("Secret:", creds['secret'])
   print("Passphrase:", creds['passphrase'])
   EOF
   ```

4. Save credentials

---

### **Step 3: Environment Variables**

```bash
export POLYMARKET_API_KEY="your_api_key"
export POLYMARKET_SECRET="your_secret"
export POLYMARKET_PASSPHRASE="your_passphrase"
export WALLET_PRIVATE_KEY="your_wallet_private_key"

# Telegram (optional but recommended)
export TELEGRAM_BOT_TOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"

# Capital allocation
export POLYMARKET_CAPITAL="10000"  # $10K
```

---

### **Step 4: Fund Wallet**

```
1. Get USDC on Polygon
2. Send to your wallet address
3. Minimum: $1,000
4. Recommended: $5,000-$10,000
```

---

### **Step 5: Run Scanner**

```bash
python3 polymarket_oracle.py
```

**Output:**
```
============================================================
POLYMARKET ORACLE - Multi-Strategy Scanner
============================================================
[CONFIG] Capital: $10,000
[CONFIG] Max per market: $1,000
[CONFIG] Scan interval: 60s
[GAMMA] Fetched 2,341 markets
[MARKETS] Categories: {'crypto': 127, 'politics': 543, 'sports': 892, ...}
[SCAN] Scanning 2,341 markets with 50 workers...
[SCAN] Found 27 opportunities
```

---

## 💰 Performance Expectations

### **Conservative (Parity + Tail-End only)**

```
Capital: $10,000
Strategies: 2 (safest)
Trades/day: 10-30
Win rate: 95-98%

Monthly:
- ROI: 8-15%
- Profit: $800-$1,500
```

---

### **Balanced (Parity + Tail-End + Market Making)**

```
Capital: $10,000
Strategies: 3
Trades/day: 30-80
Win rate: 88-95%

Monthly:
- ROI: 12-20%
- Profit: $1,200-$2,000
```

---

### **Aggressive (All 6 strategies)**

```
Capital: $50,000
Strategies: 6
Trades/day: 50-200
Win rate: 80-90%

Monthly:
- ROI: 15-30%
- Profit: $7,500-$15,000
```

---

## 📱 Telegram Alerts

**Real-time notifications when opportunities detected:**

```
🎯 POLYMARKET OPPORTUNITIES

Found 27 opportunities:

PARITY_ARBITRAGE: 8
TAIL_END: 12
MARKET_MAKING: 5
LATENCY: 2

Top 5 by profit:

• parity_arbitrage: 4.23%
  NBA Lakers vs Warriors...

• tail_end: 3.87%
  Fed Rate Decision...

• parity_arbitrage: 3.54%
  Bitcoin Closes Above $45K...
```

---

## 📊 Monitoring

### **View Opportunities Log**

```bash
tail -f /workspace/polymarket_opportunities.jsonl
```

**Output:**
```json
{"strategy":"parity_arbitrage","market_name":"Lakers win","yes_price":0.45,"no_price":0.52,"guaranteed_profit_pct":3.09}
{"strategy":"tail_end","market_name":"Fed keeps rates","price":0.97,"profit_pct":3.09}
```

---

### **View Trades Log**

```bash
tail -f /workspace/polymarket_trades.jsonl
```

---

## 🎯 Strategy Selection

**Enable/disable strategies in code:**

```python
# In polymarket_oracle.py, OpportunityScanner.scan_market()

# Enable only safest strategies
opportunities.extend(
    StrategyDetectors.parity_arbitrage(market, self.client)  # ✅ Safe
)
opportunities.extend(
    StrategyDetectors.tail_end_trading(market, self.client)  # ✅ Safe
)

# Disable riskier strategies
# opportunities.extend(
#     StrategyDetectors.market_making_opportunity(market, self.client)  # ❌ Disabled
# )
```

---

## 🛡️ Risk Management

**Built-in protections:**

```python
# Capital limits
MAX_POSITION_PER_MARKET = 1000  # $1K max
TOTAL_CAPITAL = 10000  # $10K total

# Strategy thresholds
MIN_PARITY_PROFIT = 0.02  # 2% minimum
MIN_TAIL_END_CERTAINTY = 0.95  # 95% minimum

# Scan settings
SCAN_INTERVAL = 60  # Every 60 seconds
MAX_WORKERS = 50  # Parallel scanning
```

**Modify in code or via environment variables.**

---

## 🐛 Troubleshooting

### **"Failed to fetch markets"**

**Cause:** Gamma API issue

**Fix:**
```bash
# Check API status
curl https://gamma-api.polymarket.com/markets?limit=1

# Wait 60s and retry
```

---

### **"No API credentials - simulation mode"**

**Normal** - Bot still scans and detects opportunities

**To enable trading:**
1. Generate API credentials
2. Set environment variables
3. Restart bot

---

### **"Found 0 opportunities"**

**Normal** - Opportunities are rare (2-30 per hour)

**Reasons:**
- Markets efficient (bots already took arb)
- Low activity period
- Strict thresholds

**Action:** Lower MIN thresholds or wait

---

## 💡 Advanced Configuration

### **Increase Scan Frequency**

```python
# polymarket_oracle.py line 58
SCAN_INTERVAL = 30  # Every 30s instead of 60s
```

---

### **Adjust Capital Per Market**

```python
# polymarket_oracle.py line 55
MAX_POSITION_PER_MARKET = 500  # $500 instead of $1K
```

---

### **Target Specific Categories**

```python
# In main(), filter markets before scanning
markets = [m for m in all_markets 
           if MarketCategorizer.categorize(m.get('question', '')) in ['crypto', 'sports']]
```

---

## 📊 Real Performance Data

**From Polymarket research (2024-2025):**

- **$40M+** extracted in arbitrage profits
- Top bot: **$2.2M** in 2 months
- Average profitable user: **$1K-$10K** monthly
- Bot win rates: **70-99%** depending on strategy
- Opportunity duration: **2 seconds - 48 hours**

**Your results will vary based on:**
- Capital deployed
- Strategies enabled
- Execution speed
- Market conditions

---

## ⚠️ Legal & Risk Disclaimer

**Trading involves risk:**
- Can lose capital
- Markets can be cancelled
- Events can resolve unexpectedly
- Fees eat into profits (2% winner fee on some markets)

**Legal:**
- Prediction markets may be restricted in your jurisdiction
- Check local laws before using
- Use at your own risk
- Not financial advice

**Polymarket specifics:**
- Operates on Polygon (low gas fees)
- Trades in USDC
- On-chain settlement
- Event resolution can take time

---

## 📄 License

MIT License - See [LICENSE](LICENSE)

---

## 👤 Author

**Georges Andronescu (Wesley Armando)**

- GitHub: [@georges91560](https://github.com/georges91560)
- Repository: [polymarket-oracle](https://github.com/georges91560/polymarket-oracle)

---

**Scan everything. Trade everything. Profit everywhere. 🎯💰**


path: SYSTEMD_SETUP.md
content: # Systemd Setup for Polymarket Oracle

**Run polymarket-oracle as a professional systemd service**

Auto-start on boot · Auto-restart on crash · Centralized logs · Easy control

---

## 🎯 Why Use Systemd?

**systemd makes your scanner run like a professional service:**

✅ **Auto-starts** when server boots  
✅ **Auto-restarts** if scanner crashes  
✅ **Centralized logs** (journalctl)  
✅ **Easy control** (start/stop/restart)  
✅ **Runs in background** (no SSH needed)  
✅ **Resource limits** (memory, CPU)  

---

## 📋 Prerequisites

- Linux server (Ubuntu, Debian, CentOS, etc.)
- Root/sudo access
- polymarket-oracle already installed and tested

---

## 🚀 Installation

### **Step 1: Create Service File**

```bash
sudo nano /etc/systemd/system/polymarket-oracle.service
```

**Paste this content:**

```ini
[Unit]
Description=Polymarket Oracle - Multi-Strategy Arbitrage Scanner
Documentation=https://github.com/georges91560/polymarket-oracle
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=your_username
Group=your_username
WorkingDirectory=/workspace/skills/polymarket-oracle

# Environment Variables - REPLACE WITH YOUR CREDENTIALS
Environment="POLYMARKET_API_KEY=your_polymarket_api_key_here"
Environment="POLYMARKET_SECRET=your_polymarket_secret_here"
Environment="POLYMARKET_PASSPHRASE=your_polymarket_passphrase_here"
Environment="WALLET_PRIVATE_KEY=your_wallet_private_key_here"
Environment="TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here"
Environment="TELEGRAM_CHAT_ID=your_telegram_chat_id_here"

# Optional - Capital Management
Environment="POLYMARKET_CAPITAL=10000"

# Execution
ExecStart=/usr/bin/python3 /workspace/skills/polymarket-oracle/polymarket_oracle.py

# Restart Policy
Restart=on-failure
RestartSec=15
StartLimitInterval=300
StartLimitBurst=5

# Security
NoNewPrivileges=true
PrivateTmp=true

# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=polymarket-oracle

# Resource Limits (optional)
MemoryMax=2G
CPUQuota=200%

[Install]
WantedBy=multi-user.target
```

**Important - Replace these values:**

- `User=your_username` → Your Linux username (e.g., `ubuntu`, `root`)
- `Group=your_username` → Usually same as User
- `WorkingDirectory=/workspace/skills/polymarket-oracle` → Full path to scanner directory
- `POLYMARKET_API_KEY=...` → Your Polymarket API key
- `POLYMARKET_SECRET=...` → Your Polymarket secret
- `POLYMARKET_PASSPHRASE=...` → Your Polymarket passphrase
- `WALLET_PRIVATE_KEY=...` → Your Polygon wallet private key
- `TELEGRAM_BOT_TOKEN=...` → Your Telegram bot token
- `TELEGRAM_CHAT_ID=...` → Your Telegram chat ID
- `POLYMARKET_CAPITAL=10000` → Your trading capital in USD

**Save:** Ctrl+X, Y, Enter

---

### **Step 2: Reload systemd**

```bash
sudo systemctl daemon-reload
```

This tells systemd to read your new service file.

---

### **Step 3: Enable Auto-Start**

```bash
sudo systemctl enable polymarket-oracle
```

**Output:**
```
Created symlink /etc/systemd/system/multi-user.target.wants/polymarket-oracle.service → /etc/systemd/system/polymarket-oracle.service
```

✅ Service will now start automatically when server boots!

---

### **Step 4: Start Service**

```bash
sudo systemctl start polymarket-oracle
```

---

### **Step 5: Verify It's Running**

```bash
sudo systemctl status polymarket-oracle
```

**Expected output:**

```
● polymarket-oracle.service - Polymarket Oracle - Multi-Strategy Arbitrage Scanner
   Loaded: loaded (/etc/systemd/system/polymarket-oracle.service; enabled)
   Active: active (running) since Thu 2026-02-27 14:30:10 UTC; 10s ago
 Main PID: 12346 (python3)
   Memory: 89.1M
   
Feb 27 14:30:10 systemd[1]: Started Polymarket Oracle Scanner.
Feb 27 14:30:11 polymarket-oracle[12346]: [CONFIG] Capital: $10,000
Feb 27 14:30:12 polymarket-oracle[12346]: [GAMMA] Fetched 2,341 markets
Feb 27 14:30:15 polymarket-oracle[12346]: [MARKETS] Categories: {'crypto': 127, 'politics': 543, ...}
Feb 27 14:30:20 polymarket-oracle[12346]: [SCAN] Scanning 2,341 markets with 50 workers...
Feb 27 14:30:35 polymarket-oracle[12346]: [SCAN] Found 27 opportunities
```

**Key indicators:**
- ✅ `Active: active (running)` - Scanner is running!
- ✅ `enabled` - Will start on boot
- ✅ `Main PID: 12346` - Process is alive

---

## 📊 Daily Operations

### **View Live Logs**

```bash
sudo journalctl -u polymarket-oracle -f
```

**Press Ctrl+C to exit**

---

### **View Recent Logs**

```bash
# Last 100 lines
sudo journalctl -u polymarket-oracle -n 100

# Since today
sudo journalctl -u polymarket-oracle --since today

# Since specific time
sudo journalctl -u polymarket-oracle --since "2026-02-27 10:00:00"
```

---

### **Control Service**

```bash
# Stop
sudo systemctl stop polymarket-oracle

# Start
sudo systemctl start polymarket-oracle

# Restart
sudo systemctl restart polymarket-oracle

# Check if running
sudo systemctl is-active polymarket-oracle
# Output: "active" or "inactive"
```

---

### **Disable Auto-Start**

```bash
# Disable (service stays running but won't start on boot)
sudo systemctl disable polymarket-oracle

# Re-enable
sudo systemctl enable polymarket-oracle
```

---

## 🔧 Troubleshooting

### **Service Won't Start**

```bash
# Check for errors
sudo systemctl status polymarket-oracle

# View detailed logs
sudo journalctl -u polymarket-oracle -n 50
```

**Common issues:**

1. **Wrong User/Group**
   ```bash
   # Find your username
   whoami
   
   # Edit service file
   sudo nano /etc/systemd/system/polymarket-oracle.service
   
   # Change User= and Group= to match
   ```

2. **Wrong WorkingDirectory**
   ```bash
   # Find scanner location
   ls -l /workspace/skills/polymarket-oracle/polymarket_oracle.py
   
   # Update WorkingDirectory in service file
   ```

3. **Wrong Python Path**
   ```bash
   # Find Python
   which python3
   # Output: /usr/bin/python3
   
   # Update ExecStart in service file
   ```

4. **Missing Credentials**
   ```bash
   # Check credentials set correctly
   sudo systemctl status polymarket-oracle
   # Look for authentication errors in logs
   ```

---

### **"Failed to fetch markets"**

```bash
# Check Polymarket API status
curl https://gamma-api.polymarket.com/markets?limit=1

# If API is working, check credentials
sudo journalctl -u polymarket-oracle -n 50 | grep ERROR
```

---

### **"Found 0 opportunities"**

**This is normal!** Opportunities are sporadic.

```bash
# Check that scanner is working
sudo journalctl -u polymarket-oracle -n 20

# You should see:
# [GAMMA] Fetched X markets
# [SCAN] Scanning X markets...
# [SCAN] Found 0 opportunities (or more)
```

Opportunities come in waves. Scanner keeps looking!

---

### **Service Keeps Crashing**

```bash
# View crash logs
sudo journalctl -u polymarket-oracle -n 100

# Common causes:
# - Polymarket API rate limits
# - Network issues
# - Insufficient USDC balance (if trading enabled)
# - Python errors in code
```

**Increase restart delay:**

```bash
sudo nano /etc/systemd/system/polymarket-oracle.service

# Change:
RestartSec=30  # Wait 30s before restart (was 15s)

# Reload
sudo systemctl daemon-reload
sudo systemctl restart polymarket-oracle
```

---

## 🔒 Security Tips

### **Protect Credentials**

**Option 1: Use Environment File**

```bash
# Create credentials file
sudo mkdir -p /etc/polymarket-oracle
sudo nano /etc/polymarket-oracle/credentials.env

# Content:
POLYMARKET_API_KEY=your_key
POLYMARKET_SECRET=your_secret
POLYMARKET_PASSPHRASE=your_passphrase
WALLET_PRIVATE_KEY=your_private_key
TELEGRAM_BOT_TOKEN=your_token
TELEGRAM_CHAT_ID=your_id
POLYMARKET_CAPITAL=10000

# Protect file
sudo chmod 600 /etc/polymarket-oracle/credentials.env
sudo chown root:root /etc/polymarket-oracle/credentials.env
```

**Edit service file:**

```bash
sudo nano /etc/systemd/system/polymarket-oracle.service

# Replace all Environment= lines with:
EnvironmentFile=/etc/polymarket-oracle/credentials.env

# Reload
sudo systemctl daemon-reload
sudo systemctl restart polymarket-oracle
```

---

## 📈 Monitoring

### **Check Resource Usage**

```bash
systemctl status polymarket-oracle | grep -E "Memory|CPU|Tasks"
```

**Output:**
```
   Tasks: 52 (limit: 4915)
   Memory: 89.1M
   CPU: 2.4s
```

Polymarket Oracle uses more workers (50 parallel threads) so higher memory is normal.

---

### **Monitor Opportunities Found**

```bash
# Count opportunities in log
sudo journalctl -u polymarket-oracle --since today | grep "Found.*opportunities" | tail -20
```

---

### **View Opportunities Log File**

```bash
# Real-time opportunities
tail -f /workspace/polymarket_opportunities.jsonl

# Count by strategy
cat /workspace/polymarket_opportunities.jsonl | grep -o '"strategy":"[^"]*"' | sort | uniq -c
```

---

## ✅ Verification Checklist

After installation:

- [ ] `systemctl status polymarket-oracle` shows "active (running)"
- [ ] `systemctl is-enabled polymarket-oracle` shows "enabled"
- [ ] Logs show scanner activity: `journalctl -u polymarket-oracle -n 20`
- [ ] Markets being fetched: Check for "[GAMMA] Fetched X markets"
- [ ] No error messages in logs
- [ ] Telegram alerts working (if opportunities found)
- [ ] Can restart: `sudo systemctl restart polymarket-oracle`
- [ ] Scanner restarts automatically after kill: `sudo kill <PID>`

---

## 🚀 Test Auto-Restart

**Test that scanner restarts automatically on crash:**

```bash
# Get PID
systemctl status polymarket-oracle | grep "Main PID"

# Kill process
sudo kill -9 <PID>

# Wait 15 seconds

# Check status
sudo systemctl status polymarket-oracle
# Should show new PID and "active (running)"
```

✅ If scanner restarted automatically, systemd is working correctly!

---

## 🎯 Performance Tuning

### **Reduce Resource Usage**

If scanner uses too much memory/CPU:

```bash
sudo nano /etc/systemd/system/polymarket-oracle.service

# Reduce limits:
MemoryMax=1G      # Limit to 1GB (was 2G)
CPUQuota=100%     # Limit to 1 CPU core (was 200%)

# In scanner code, reduce workers:
# Edit polymarket_oracle.py line 59:
# MAX_WORKERS = 25  # Instead of 50

# Reload
sudo systemctl daemon-reload
sudo systemctl restart polymarket-oracle
```

---

### **Increase Scan Frequency**

Default is 60 seconds. To scan more frequently:

```bash
# Edit polymarket_oracle.py line 58
nano /workspace/skills/polymarket-oracle/polymarket_oracle.py

# Change:
SCAN_INTERVAL = 30  # 30 seconds instead of 60

# Restart service
sudo systemctl restart polymarket-oracle
```

---

## 🎯 Quick Reference

```bash
# START
sudo systemctl start polymarket-oracle

# STOP
sudo systemctl stop polymarket-oracle

# RESTART
sudo systemctl restart polymarket-oracle

# STATUS
sudo systemctl status polymarket-oracle

# LOGS (real-time)
sudo journalctl -u polymarket-oracle -f

# LOGS (last 100)
sudo journalctl -u polymarket-oracle -n 100

# ENABLE boot auto-start
sudo systemctl enable polymarket-oracle

# DISABLE boot auto-start
sudo systemctl disable polymarket-oracle

# CHECK if running
sudo systemctl is-active polymarket-oracle

# CHECK if enabled
sudo systemctl is-enabled polymarket-oracle
```

---

## 💰 View Opportunities

```bash
# View opportunities log
tail -f /workspace/polymarket_opportunities.jsonl

# Pretty print last opportunity
tail -1 /workspace/polymarket_opportunities.jsonl | python3 -m json.tool

# Count opportunities by strategy
cat /workspace/polymarket_opportunities.jsonl | \
  python3 -c "import sys, json; strategies = [json.loads(l)['strategy'] for l in sys.stdin]; \
  from collections import Counter; print(Counter(strategies))"
```

---

**Your polymarket-oracle now runs 24/7 scanning ALL markets! 🎯💰**


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (CRITICAL)