Polymarket CLOB CLI wrapper and AI skill
Project description
Polymarket Trader (AI Skill)
A lightweight AI skill and CLI wrapper for Polymarket CLOB: browse markets, inspect orderbooks, place/cancel orders, and run diagnostics. Built on py-clob-client. Works with any AI agent that can read SKILL.md (Codex-compatible) or use the CLI directly.
Install
Recommended (uv):
uv tool install polymarket-trader
Also supported:
pipx install polymarket-trader
# or
pip install polymarket-trader
Features
- Read-only market data: list markets, orderbooks, quotes
- Trading: buy/sell, cancel orders, buy with a USD cap
- Proxy wallet support (Safe): signer vs funder handling
- Diagnostics: balance/allowance + optional onchain allowance check
- Environment file auto-load:
~/.polymarket.env
Quick Start (Polymarket UI / Proxy Wallet)
Most Polymarket accounts use a proxy wallet (Safe) that holds funds, while your MetaMask EOA signs orders. The UI shows the proxy address.
Create ~/.polymarket.env:
POLYMARKET_KEY=<your MetaMask private key>
POLYMARKET_SIG_TYPE=2
POLYMARKET_FUNDER=<proxy wallet address shown on Polymarket>
POLYMARKET_SIGNER=<your MetaMask EOA address>
POLYMARKET_RPC=https://polygon-rpc.com
Verify:
polymarket-trader whoami
polymarket-trader balance --asset-type collateral
If allowances are all zero, open Polymarket, click Buy on any market, and approve USDC (Enable trading).
Commands (examples)
List markets:
polymarket-trader markets --sampling --accepting-only --limit 50
Include titles:
polymarket-trader markets --sampling --with-title --limit 20
Orderbook / quote:
polymarket-trader orderbook <token_id>
polymarket-trader quote <token_id>
Buy with USD cap (best ask by default):
polymarket-trader buy-max <token_id> 5
Diagnostics:
polymarket-trader diagnose --onchain --fix
Using from source (no install)
uv run --with py-clob-client scripts/poly_wrapper.py whoami
uv run --with py-clob-client scripts/poly_wrapper.py balance --asset-type collateral
For the full command list, see SKILL.md.
Safety
- Never paste private keys into chat or commit them to git.
~/.polymarket.envis loaded automatically and should be kept local.
Publishing
Build a wheel/sdist:
uv run --with build -m build
License
MIT (add a LICENSE file if you want this explicit).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polymarket_trader-0.1.0.tar.gz.
File metadata
- Download URL: polymarket_trader-0.1.0.tar.gz
- Upload date:
- Size: 96.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9295cdf4e7cbd2734401a796f50d789751bddb54efb3759afb2bcff20259176
|
|
| MD5 |
12e28cc4c6f566ac58e313717a276cba
|
|
| BLAKE2b-256 |
5664970fa54736aa1d711324c189219064c4462db27ec0d62ac2ae873897a465
|
File details
Details for the file polymarket_trader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: polymarket_trader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1143ab444d6447cdcaf7d679040f811fd4c88bcbbfb0fb1663d2d8af527485e0
|
|
| MD5 |
39ce977eb3cae88f8599aba3aab4ef22
|
|
| BLAKE2b-256 |
c695a00ad1d7d8f032fd09f595fc9ed29b10488c07f7281d4225c98530cec80e
|