# Send Polymarket Auto-Trader to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "polymarket-auto-trader",
    "name": "Polymarket Auto-Trader",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/srikanthbellary/polymarket-auto-trader",
    "canonicalUrl": "https://clawhub.ai/srikanthbellary/polymarket-auto-trader",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/polymarket-auto-trader",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=polymarket-auto-trader",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/contract-addresses.md",
      "references/polymarket-api.md",
      "scripts/approve_contracts.py",
      "scripts/pnl_tracker.py",
      "scripts/run_trade.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "polymarket-auto-trader",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T06:01:04.451Z",
      "expiresAt": "2026-05-14T06:01:04.451Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=polymarket-auto-trader",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=polymarket-auto-trader",
        "contentDisposition": "attachment; filename=\"polymarket-auto-trader-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "polymarket-auto-trader"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/polymarket-auto-trader"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/polymarket-auto-trader",
    "downloadUrl": "https://openagent3.xyz/downloads/polymarket-auto-trader",
    "agentUrl": "https://openagent3.xyz/skills/polymarket-auto-trader/agent",
    "manifestUrl": "https://openagent3.xyz/skills/polymarket-auto-trader/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/polymarket-auto-trader/agent.md"
  }
}
```
## Documentation

### Polymarket Auto-Trader

Fully autonomous prediction market trading agent for Polymarket. Evaluates markets using LLM probability estimation, sizes positions with Kelly criterion, and executes trades via the Polymarket CLOB API from a non-US VPS.

### Prerequisites

Non-US VPS — Polymarket blocks US IPs. Use DigitalOcean Amsterdam, Hetzner EU, etc.
Polygon wallet with USDC.e (bridged USDC, NOT native USDC)
MATIC for gas (~0.1 MATIC sufficient for hundreds of trades)
Anthropic API key (uses Haiku at ~$0.001/evaluation)

### 1. VPS Environment

SSH into your non-US VPS and run:

python3 {baseDir}/scripts/setup_vps.sh

Or manually:

apt update && apt install -y python3 python3-venv
python3 -m venv /opt/trader
/opt/trader/bin/pip install py-clob-client python-dotenv web3 requests

### 2. Configuration

Create /opt/trader/app/.env:

PRIVATE_KEY=<your-polygon-wallet-private-key>
LLM_API_KEY=<your-anthropic-api-key>

### 3. Blockchain Approvals

Before trading, approve USDC.e and CTF tokens for Polymarket contracts. Run:

python3 {baseDir}/scripts/approve_contracts.py

Required approvals (6 total):

USDC.e → CTF Exchange, Neg Risk Exchange, Neg Risk Adapter
CTF → CTF Exchange, Neg Risk Exchange, Neg Risk Adapter

### 4. Deploy Trading Script

cp {baseDir}/scripts/run_trade.py /opt/trader/app/
cp {baseDir}/scripts/pnl_tracker.py /opt/trader/app/

### 5. Cron Automation

crontab -e
# Add: */10 * * * * cd /opt/trader/app && /opt/trader/bin/python3 run_trade.py >> cron.log 2>&1

### How It Works

Market Scan — Fetches active markets from Gamma API, filters by liquidity and time horizon
LLM Evaluation — Asks Claude Haiku to estimate true probability for each market
Edge Detection — Compares LLM fair value vs market price (min 5% edge threshold)
Kelly Sizing — Half-Kelly criterion with 25% max position size cap
Order Execution — Places limit orders via CLOB API with GTC (good-till-cancelled)
Dedup — Tracks all trades in trades.jsonl, skips already-traded markets
Budget Control — Tracks LLM inference costs separately from trading capital

### Trading Parameters

Configurable in run_trade.py:

EDGE_THRESHOLD — Minimum edge to trade (default: 0.05 = 5%)
MIN_SHARES — Minimum order size (Polymarket requires ≥5 shares)
Bankroll allocation: 80% usable, 25% max per trade, 30% cap per single position
Market horizon: Prioritizes markets ending within 30 days

### Monitoring

Check P&L anytime:

python3 /opt/trader/app/pnl_tracker.py

Check recent activity:

tail -50 /opt/trader/app/cron.log

### Key Technical Details

Wallet type: EOA (signature_type=0), NOT proxy wallet
Token: USDC.e (0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174), not native USDC
Neg-risk markets (elections, sports leagues) require USDC.e approval for Neg Risk Adapter (0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296)
US geoblock — All API calls must originate from non-US IP. VPN insufficient; use actual non-US VPS.

### Cost

LLM inference: ~$0.001 per market evaluation (Haiku)
Typical cycle (40 evals): ~$0.04
Gas: negligible on Polygon (~$0.001 per trade)

### ⚠️ Security Considerations

Use a DEDICATED wallet with minimal funds. Never use your main wallet's private key. Create a fresh wallet and fund it only with what you're willing to risk.
PRIVATE_KEY is stored on disk in .env. Harden your VPS: strict file permissions (chmod 600 .env), no shared access, firewall, SSH keys only.
MAX_UINT approvals are standard in DeFi but grant broad spending rights. The approved contracts are official Polymarket contracts. Review addresses in references/contract-addresses.md before running.
Test with tiny amounts first ($5-10) before scaling up.
Monitor actively — check cron.log and run pnl_tracker.py regularly.
LLM_API_KEY billing — each cycle costs ~$0.04 (Haiku). Set billing alerts on your Anthropic account.
This is autonomous trading software. Bugs or market conditions can cause losses. Use at your own risk.

### References

See references/polymarket-api.md for full CLOB API documentation
See references/contract-addresses.md for all Polygon contract addresses
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: srikanthbellary
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T06:01:04.451Z
- Expires at: 2026-05-14T06:01:04.451Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/polymarket-auto-trader)
- [Send to Agent page](https://openagent3.xyz/skills/polymarket-auto-trader/agent)
- [JSON manifest](https://openagent3.xyz/skills/polymarket-auto-trader/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/polymarket-auto-trader/agent.md)
- [Download page](https://openagent3.xyz/downloads/polymarket-auto-trader)