polymarket-live-executor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Polymarket Live Executor

Polymarket 实盘执行器

Execute real trades on Polymarket with mandatory human-in-the-loop confirmation. This skill requires L2 authentication (wallet private key) and enforces strict safety controls on every operation.
在人在回路强制确认机制下执行Polymarket真实交易。本技能需要L2认证(钱包私钥),并且对每一项操作都实施严格的安全管控。

SAFETY REQUIREMENTS

安全要求

Every trade requires explicit user confirmation. The agent must:
  1. Display full trade details (market, side, size, price, estimated cost)
  2. Show current order book context (spread, depth at target price)
  3. Wait for the user to type "yes" or "confirm" before proceeding
  4. Never batch or auto-confirm trades
Environment safeguards (enforced by all scripts):
  • POLYMARKET_PRIVATE_KEY
    must be set (burner wallet only -- NEVER a main wallet)
  • POLYMARKET_CONFIRM=true
    must be set to enable any trade execution
  • Position size hard-capped (default $10, configurable via
    POLYMARKET_MAX_SIZE
    )
  • Daily loss limit tracked in
    ~/.polymarket-live/trades.log
每笔交易都需要用户明确确认。 Agent必须:
  1. 展示完整交易详情(交易市场、方向、数量、价格、预估成本)
  2. 展示当前订单簿上下文(价差、目标价位的深度)
  3. 等待用户输入"yes"或"confirm"后再继续执行
  4. 绝对不允许批量交易或自动确认交易
环境安全措施(所有脚本强制执行):
  • 必须配置
    POLYMARKET_PRIVATE_KEY
    (仅使用burner钱包——绝对不要使用主钱包)
  • 必须配置
    POLYMARKET_CONFIRM=true
    才能启用任何交易执行功能
  • 持仓规模有硬上限(默认10美元,可通过
    POLYMARKET_MAX_SIZE
    配置)
  • 每日亏损限额会记录在
    ~/.polymarket-live/trades.log
    中并强制执行

Setup

配置步骤

Use the setup wizard to configure everything:
bash
undefined
使用配置向导完成所有设置:
bash
undefined

Step 1: Create a burner wallet

步骤1:创建burner钱包

python scripts/setup_wallet.py --create
python scripts/setup_wallet.py --create

Step 2: Fund wallet with USDC on Polygon (manually via MetaMask/bridge)

步骤2:通过MetaMask/跨链桥手动向钱包转入Polygon链上的USDC

Step 3: Copy and fill in .env

步骤3:复制并填写.env文件

cp .env.example .env && chmod 600 .env
cp .env.example .env && chmod 600 .env

Edit .env with your private key and limits

编辑.env文件填入你的私钥和限额配置

Step 4: Verify everything is configured

步骤4:验证所有配置是否正确

python scripts/setup_wallet.py --verify
python scripts/setup_wallet.py --verify

Step 5: Check on-chain balance

步骤5:查询链上余额

python scripts/setup_wallet.py --check-balance

Or set environment variables manually:
```bash
export POLYMARKET_PRIVATE_KEY="0x..."    # Burner wallet only!
export POLYMARKET_CONFIRM=true           # Safety gate
export POLYMARKET_MAX_SIZE=10            # Max $ per trade (default: 10)
export POLYMARKET_DAILY_LOSS_LIMIT=50    # Max daily loss (default: 50)
Review the
references/live-trading-checklist.md
before any live trade.
python scripts/setup_wallet.py --check-balance

或者手动配置环境变量:
```bash
export POLYMARKET_PRIVATE_KEY="0x..."    # 仅使用burner钱包!
export POLYMARKET_CONFIRM=true           # 安全闸门
export POLYMARKET_MAX_SIZE=10            # 单笔交易最高金额(默认:10美元)
export POLYMARKET_DAILY_LOSS_LIMIT=50    # 单日最高亏损额(默认:50美元)
进行任何实盘交易前请先查阅
references/live-trading-checklist.md

Available Scripts

可用脚本

1. Execute Trade (
scripts/execute_live.py
)

1. 执行交易(
scripts/execute_live.py

Place a real order on Polymarket.
bash
undefined
在Polymarket提交真实订单。
bash
undefined

Limit order: buy 5 YES shares at $0.60

限价单:以0.60美元的价格买入5份YES份额

python scripts/execute_live.py --token-id <ID> --side BUY --size 5 --price 0.60
python scripts/execute_live.py --token-id <ID> --side BUY --size 5 --price 0.60

Market order: buy $5 worth at market price

市价单:按市价买入价值5美元的份额

python scripts/execute_live.py --token-id <ID> --side BUY --amount 5 --market
python scripts/execute_live.py --token-id <ID> --side BUY --amount 5 --market

Sell: sell 10 shares at $0.75

卖出:以0.75美元的价格卖出10份份额

python scripts/execute_live.py --token-id <ID> --side SELL --size 10 --price 0.75

The script will display full trade details and require interactive confirmation.
python scripts/execute_live.py --token-id <ID> --side SELL --size 10 --price 0.75

脚本会展示完整的交易详情,并要求交互式确认后才会执行。

2. Check Positions (
scripts/check_positions.py
)

2. 查询持仓(
scripts/check_positions.py

View wallet balance, open orders, and trade history.
bash
python scripts/check_positions.py                # Summary
python scripts/check_positions.py --orders        # Open orders
python scripts/check_positions.py --trades        # Recent trades
python scripts/check_positions.py --balance       # USDC balance
查看钱包余额、未成交订单和交易历史。
bash
python scripts/check_positions.py                # 汇总信息
python scripts/check_positions.py --orders        # 未成交订单
python scripts/check_positions.py --trades        # 近期交易
python scripts/check_positions.py --balance       # USDC余额

Workflow

工作流程

  1. Run analysis with polymarket-analyzer scripts to find opportunities
  2. Paper-trade the idea with polymarket-paper-trader first
  3. Review
    references/live-trading-checklist.md
  4. Set up environment variables and burner wallet
  5. Use
    check_positions.py
    to verify wallet state
  6. Execute trade with
    execute_live.py
    -- confirm when prompted
  7. Monitor position with
    check_positions.py
  1. 使用polymarket-analyzer脚本进行分析,寻找交易机会
  2. 先用polymarket-paper-trader对策略进行模拟交易验证
  3. 查阅
    references/live-trading-checklist.md
    清单
  4. 配置环境变量和burner钱包
  5. 使用
    check_positions.py
    验证钱包状态
  6. 使用
    execute_live.py
    执行交易,收到提示时手动确认
  7. 使用
    check_positions.py
    监控持仓情况

Risk Controls

风险控制

  • All trades logged to
    ~/.polymarket-live/trades.log
  • Daily P&L tracked and enforced against loss limit
  • Position size caps prevent oversized trades
  • No autonomous execution -- every trade needs human approval
  • 所有交易都会记录到
    ~/.polymarket-live/trades.log
  • 会跟踪每日盈亏并强制执行亏损限额
  • 持仓规模上限防止超大额交易
  • 无自主执行功能——每笔交易都需要人工批准

Important Disclaimers

重要免责声明

  • This skill executes REAL trades with REAL money
  • Use only with burner wallets funded with money you can afford to lose
  • Past analysis does not guarantee future results
  • Not financial advice -- you are solely responsible for your trades
  • 本技能会使用真实资金执行真实交易
  • 仅使用存入可承受亏损金额的burner钱包
  • 历史分析不保证未来收益
  • 不构成任何财务建议——你需要为自己的所有交易负全部责任