← 返回 Skills 市场
jvnhaowen

polymarket-minimal-buy-python

作者 jvnhaoWen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
100
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install autotransactions
功能描述
Minimal Python client for authenticated Polymarket trading with private key from private.env, supporting market/limit buy/sell, order queries, and cancellati...
使用说明 (SKILL.md)

Sure — here is the English version with the small change included:

---
name: polymarket-minimal-buy-python
description: Use Python to run a minimal authenticated Polymarket trading client with private key loaded from private.env. Supports initialize/signing auth, market buy/sell, limit buy/sell, open orders, single-order lookup, and order cancellation.
---

# Polymarket Minimal Trading Python

Provide a minimal runnable Python trading client for Polymarket. The private key is loaded from `private.env` and used for authenticated signing.

## Features

- initialize with private key
- market buy / sell
- limit order buy / sell
- auto allowance authorization (USDC for BUY, conditional token for SELL)
- get open orders / get single order
- cancel single / cancel all
- auto create `private.env` if missing, then prompt the user to fill in a MetaMask or other decentralized wallet private key

## Setup

```bash
pip install py-clob-client eth-account

# Auto-create private.env if it does not exist
test -f private.env || cat > private.env \x3C\x3C'EOF'
POLYMARKET_PRIVATE_KEY=
EOF

echo "Created private.env if it was missing. Please open it and paste in the private key from your MetaMask or other decentralized wallet."

Env

Prefer reading private.env from the skill directory, and also support system environment variables.

  • POLYMARKET_PRIVATE_KEY (required)

Example:

POLYMARKET_PRIVATE_KEY=your_wallet_private_key

Please write the private key from your MetaMask or another decentralized wallet into the private.env file.

Usage

# Market buy
python3 scripts/min_buy.py market-buy --token-id \x3CTOKEN_ID> --amount 10

# Market sell
python3 scripts/min_buy.py market-sell --token-id \x3CTOKEN_ID> --amount 10

# Limit buy
python3 scripts/min_buy.py limit-buy --token-id \x3CTOKEN_ID> --price 0.45 --size 20

# Limit sell
python3 scripts/min_buy.py limit-sell --token-id \x3CTOKEN_ID> --price 0.55 --size 20

# Query orders
python3 scripts/min_buy.py open-orders
python3 scripts/min_buy.py get-order --order-id \x3CORDER_ID>

# Cancel orders
python3 scripts/min_buy.py cancel-order --order-id \x3CORDER_ID>
python3 scripts/min_buy.py cancel-all

A slightly cleaner prompt line for the setup section would be:

echo "Please edit private.env and fill in POLYMARKET_PRIVATE_KEY with the private key from your MetaMask or other EVM-compatible decentralized wallet."
安全使用建议
This skill implements what it claims (a minimal Polymarket trading client) but requires you to provide a private wallet key. Do NOT paste your primary MetaMask or hot-wallet private key into a plaintext file. Consider these precautions before using the skill: 1) Prefer using a dedicated wallet with minimal funds for automated trading or a signing service/hardware wallet rather than dropping a private key into private.env. 2) Inspect and verify the py-clob-client and eth-account packages (source, version, checksums) before pip installing; consider pinning versions. 3) Be aware the registry metadata does not declare the required POLYMARKET_PRIVATE_KEY — treat that as a red flag and confirm expectations with the publisher. 4) Run this in an isolated environment (VM or container) and avoid storing production keys in plaintext. 5) If you cannot supply a private key safely, seek an integration that uses an external wallet connector or server-side signing so secrets are not placed into local files.
功能分析
Type: OpenClaw Skill Name: autotransactions Version: 1.0.0 The skill is a Polymarket trading client that requires the user to provide a plaintext wallet private key, which is stored in a local `private.env` file. While the code in `scripts/min_buy.py` correctly implements the official `py-clob-client` SDK and shows no evidence of data exfiltration or intentional malice, the requirement to handle and store raw private keys is a high-risk behavior that could lead to credential theft if the environment is compromised.
能力评估
Purpose & Capability
The name/description and the code match: the script implements authenticated Polymarket trading (market/limit buy/sell, order queries, cancellations) against clob.polymarket.com on chain 137. However, the registry metadata claims no required env vars or primary credential while both SKILL.md and the code require POLYMARKET_PRIVATE_KEY — this mismatch is important because it hides the need to supply a wallet private key.
Instruction Scope
SKILL.md and the script instruct the user to create a private.env and paste in a MetaMask/decentralized-wallet private key. The code reads that file and environment variables and will use the key to derive API creds and sign orders. While this is necessary for the stated trading functionality, it directs collection and local storage of a highly sensitive secret in plaintext and prompts the user to manually enter their private key — a risky practice that should be avoided or clearly warned about.
Install Mechanism
There is no platform install spec (instruction-only), so nothing is automatically downloaded by the skill bundle. SKILL.md tells the user to run 'pip install py-clob-client eth-account' — installing unpinned packages from PyPI is a moderate-risk operation (install-time code runs on the host). The skill does not pin versions or verify package provenance; the user should vet those packages before installing.
Credentials
The code requires a sensitive env var POLYMARKET_PRIVATE_KEY and optionally reads other POLYMARKET_* env vars (host, chain id, signature type, funder). The registry metadata does not declare required env vars/primary credential, so the required secret is not surfaced in the skill metadata. Requesting a wallet private key is expected for a signing client, but the omission from metadata and the instruction to store the key in a plaintext file is disproportionate without strong guidance or safer alternatives.
Persistence & Privilege
The skill is not marked 'always: true', does not request persistence, and does not modify other skills or system-wide settings. Autonomous invocation is allowed (platform default) but not combined with other unusual privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install autotransactions
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /autotransactions 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of Polymarket minimal trading client for Python. - Supports authenticated market buy/sell, limit orders, open/single order queries, and order cancellation. - Loads private key from private.env (auto-created if missing), or from system environment variables. - Includes setup instructions and usage examples for all trading actions. - Auto-prompts user to fill in their decentralized wallet private key if not present.
元数据
Slug autotransactions
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

polymarket-minimal-buy-python 是什么?

Minimal Python client for authenticated Polymarket trading with private key from private.env, supporting market/limit buy/sell, order queries, and cancellati... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。

如何安装 polymarket-minimal-buy-python?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install autotransactions」即可一键安装,无需额外配置。

polymarket-minimal-buy-python 是免费的吗?

是的,polymarket-minimal-buy-python 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

polymarket-minimal-buy-python 支持哪些平台?

polymarket-minimal-buy-python 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 polymarket-minimal-buy-python?

由 jvnhaoWen(@jvnhaowen)开发并维护,当前版本 v1.0.0。

💬 留言讨论