安全程序化交易 Polymarket 预测市场
简介
通过 Python 脚本安全执行 Polymarket CLOB 限价订单交易,采用环境变量注入防止命令注入攻击,适合预测市场程序化交易。
原始描述
Execute limit orders on Polymarket markets by specifying market slug, outcome, price, and order size via a Python script.
通过你的 Agent 添加
安装目录:polymarket-trader-52457/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: polymarket_trader description: A skill to securely execute trades on the Polymarket CLOB via a Python script. tools:
- name: place_polymarket_order
description: Places a limit order on a specified Polymarket market.
args:
- name: market_slug type: string description: The slug of the market (e.g., 'trump-out-as-president-by-march-31').
- name: direction type: string description: "The outcome to bet on. Must be 'Yes' or 'No'."
- name: price type: number description: The price for the limit order (e.g., 0.50). Must be between 0.01 and 0.99.
- name: size type: number description: The size of the order in shares (e.g., 10). exec:
This command chain securely passes arguments as environment variables to the script
after activating the virtual environment. This prevents shell injection vulnerabilities. command: > source ../../polymarket_venv/bin/activate && export MARKET_SLUG='{{market_slug}}' && export DIRECTION='{{direction}}' && export PRICE={{price}} && export SIZE={{size}} && python trade.py
Polymarket Trader Skill
This skill provides a tool to place trades on Polymarket.
Security
This skill is designed to be secure. It reads the private key from the POLYMARKET_PRIVATE_KEY environment variable and reads all trade parameters as environment variables to prevent shell injection.
Setup
This skill requires a Python virtual environment named polymarket_venv located in the OpenClaw workspace root.
The environment must have the following packages installed:
py-clob-clientrequests
It also requires the POLYMARKET_PRIVATE_KEY environment variable to be set for the OpenClaw user.
Tools
place_polymarket_order
place_polymarket_orderThis tool is a wrapper around the trade.py script. It allows the agent to place trades by providing the market slug, direction, price, and size.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。