skills/polymarket-trade/SKILL.md
Trade on Polymarket prediction markets on Polygon. Supports browsing markets, checking wallet/CLOB balance, and buying or selling YES/NO shares with safety gates. Wallet: WDK vault (~/.aurehub/.wdk_vault). Config: ~/.aurehub/polymarket.yaml. Triggers: buy YES, buy NO, sell shares, browse markets, check Polymarket balance, Polymarket trade, prediction market, what are the odds, redeem winnings, claim resolved positions.
npx skillsauth add aurehub/skills polymarket-tradeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Trade on Polymarket prediction markets. Non-custodial — private key stays in your WDK vault.
Before any action, check prerequisites for the current flow and auto-fix what you can.
Browse flow (no wallet, no RPC, no CLOB needed): check step 4 only. Redeem flow (no CLOB needed): check steps 1–5 in order. Balance / Trade / Setup flow: check all steps 1–6 in order.
Step types:
| Step | Missing item | Type | Agent action |
|------|---|---|---|
| 1 | ~/.aurehub/.wdk_vault | HARD STOP | Inform: xaut-trade must be installed and its wallet setup completed first. Stop. |
| 2 | ~/.aurehub/.wdk_password | HARD STOP | Inform: xaut-trade must be installed and its wallet setup completed first. Stop. |
| 3 | ~/.aurehub/.env missing | AUTO-FIX | Run: cp <skill-dir>/.env.example ~/.aurehub/.env |
| 3 | ~/.aurehub/.env exists, POLYGON_RPC_URL absent | AUTO-FIX | Append POLYGON_RPC_URL=https://polygon.drpc.org to ~/.aurehub/.env |
| 4 | ~/.aurehub/polymarket.yaml missing | AUTO-FIX | Run: cp <skill-dir>/config.example.yaml ~/.aurehub/polymarket.yaml |
| 5 | node_modules missing in <skill-dir>/scripts/ | AUTO-FIX | Run: npm install in <skill-dir>/scripts/ |
| 6 | ~/.aurehub/.polymarket_clob missing | INTERACTIVE | Run: node <skill-dir>/scripts/setup.js (only after steps 3–5 pass) |
On any auto-fix failure: stop and report the error with the manual remediation command. After all fixes succeed, re-run the relevant checks and proceed.
After prerequisites pass: if the user's message matches browse flow (contains "browse", "what markets", "what are the odds"), skip registration and proceed directly to intent detection. Otherwise run Wallet-Ready Registration (below) before proceeding to intent detection.
<skill-dir> is the directory containing this SKILL.md file.
Use <skill-dir>/scripts as the scripts directory. To find it at runtime:
# 1. Git repo fallback
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
[ -n "$GIT_ROOT" ] && [ -d "$GIT_ROOT/skills/polymarket-trade/scripts" ] && POLY_SCRIPTS_DIR="$GIT_ROOT/skills/polymarket-trade/scripts"
# 2. Bounded home search
[ -z "$POLY_SCRIPTS_DIR" ] && POLY_SCRIPTS_DIR=$(dirname "$(find -L "$HOME" -maxdepth 6 -type f -path "*/polymarket-trade/scripts/browse.js" 2>/dev/null | head -1)")
Run after prerequisites pass for any wallet-requiring flow (not browse). Derive WALLET_ADDRESS using xaut-trade's swap.js (required by prerequisites):
XAUT_SWAP=$(find -L "$HOME" -maxdepth 6 -type f -path "*/xaut-trade/scripts/swap.js" 2>/dev/null | head -1)
source ~/.aurehub/.env
WALLET_ADDRESS=$(node "$XAUT_SWAP" address | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).address")
If XAUT_SWAP is empty or the command fails, skip registration silently and continue.
REGISTERED=$(cat ~/.aurehub/.registered 2>/dev/null)"$REGISTERED" starts with "$WALLET_ADDRESS:" → already registered, silent skip; return immediatelyRANKINGS_OPT_IN != "true":
PROMPTED=$(cat ~/.aurehub/.rankings_prompted 2>/dev/null)"$WALLET_ADDRESS:" → skip; return immediatelyno: echo "$WALLET_ADDRESS:declined" > ~/.aurehub/.rankings_prompted; returnyes:
NICKNAME is empty: ask user for nickname~/.aurehub/.env (RANKINGS_OPT_IN=true, NICKNAME=<value>)source ~/.aurehub/.envRANKINGS_OPT_IN == "true":
NICKNAME is empty: ask "You're opted in to XAUT activity rankings — what nickname would you like to appear as?", then persist to ~/.aurehub/.env and re-sourceNICKNAME_ESC=$(printf '%s' "$NICKNAME" | sed 's/\\/\\\\/g; s/"/\\"/g')
REGISTER_RESP=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
https://xaue.com/api/rankings/participants \
-H 'Content-Type: application/json' \
-d "{\"wallet_address\":\"$WALLET_ADDRESS\",\"nickname\":\"$NICKNAME_ESC\",\"source\":\"agent\"}")
echo "$WALLET_ADDRESS:$NICKNAME" > ~/.aurehub/.registered; inform: "Registered with nickname: $NICKNAME"Only prompt once per wallet. The .rankings_prompted and .registered markers ensure idempotency across sessions.
| User says | Action | |-----------|--------| | "buy YES on X market", "buy X at Y price", "buy shares" | buy flow | | "sell my YES shares", "sell X shares" | sell flow | | "browse X", "what markets", "what are the odds on X" | browse flow | | "my polymarket balance", "how much USDC" | balance flow | | "redeem", "claim winnings", "collect" | redeem flow |
Run environment check (no wallet, no RPC, no CLOB credentials needed):
node "$POLY_SCRIPTS_DIR/browse.js" "<keyword or market slug>"
Show the output to the user. The output includes:
--market to trade.jsPrefer passing ConditionId to --market when trading (more reliable than slug).
Run environment check:
node "$POLY_SCRIPTS_DIR/balance.js"
Run environment check (no CLOB credentials needed), then:
node "$POLY_SCRIPTS_DIR/redeem.js"
Show output. If negRisk positions are skipped, tell the user to visit polymarket.com.
node "$POLY_SCRIPTS_DIR/browse.js" <market> to show current pricesnode "$POLY_SCRIPTS_DIR/trade.js" --buy --market <slug> --side YES|NO --amount <usd>Pass --dry-run to simulate the full flow (balance checks, hard stops, order construction) without submitting any transactions.
node "$POLY_SCRIPTS_DIR/browse.js" <market> to confirm token IDs and current bidsnode "$POLY_SCRIPTS_DIR/trade.js" --sell --market <slug> --side YES|NO --amount <shares>Pass --dry-run to simulate the full flow (balance checks, hard stops, order construction) without submitting any transactions.
Polymarket API blocks US and some other regions. If you see a 403 error, tell the user to enable a VPN and retry.
0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)Answer knowledge queries directly using the data above — no API calls needed.
Load these on demand:
references/setup.md — first-time setup guidereferences/buy.md — detailed buy flowreferences/sell.md — detailed sell flowreferences/balance.md — balance interpretationreferences/browse.md — browse output formatreferences/contracts.md — Polygon contract addressesreferences/safety.md — safety gate detailsdevelopment
Buy or sell XAUT (Tether Gold) on Ethereum. Supports market orders (Uniswap V3) and limit orders (UniswapX). Wallet modes: Foundry keystore or WDK. Delegates non-XAUT intents to registered skills (e.g. Polymarket prediction markets, Hyperliquid trading). Triggers: buy XAUT, XAUT trade, swap USDT for XAUT, sell XAUT, swap XAUT for USDT, limit order, limit buy XAUT, limit sell XAUT, check limit order, cancel limit order, XAUT when, create wallet, setup wallet, polymarket, prediction market, bet on, odds on, hyperliquid, perp, perpetual, long, short, open long, open short, close position, leverage.
testing
Trade on Hyperliquid — spot and perpetual futures. Supports market orders (IOC), limit orders (GTC), leverage setting, and WDK wallet. Triggers: buy ETH spot, sell BTC, long ETH, short BTC, open long, open short, close position, perp trade, check balance, Hyperliquid positions, limit order, limit buy, limit sell, open orders, cancel order, modify order, GTC.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.