A Claude Code skill that turns "buy me $5 of YES on this market" into a real on-chain Polymarket position — using your Kite wallet to sign, AnyEx to settle, and Polygon to hold. No accounts to create, no gas to manage, no API keys to leak.
curl -fsSL https://install.anyex.ai/polymarket | bash
You don't construct payloads, sign EIP-712, or call any APIs. The skill orchestrates the whole flow: market search, endDate validation, one-time DepositWallet provisioning (with explicit consent), x402 payment, CLOB order placement, position verification.
No app to install (except the CLI). No browser wallet to set up. Your Kite wallet IS your identity — the EIP-3009 signature is both the payment and the auth.
One curl | bash drops the skill into ~/.claude/skills/ and
installs kpass (Kite Passport CLI) if needed. Claude / Cursor / Codex auto-discover.
kpass signup init creates your Kite wallet. Bridge ≥ $1 USDC.e to Kite
mainnet (chain 2366). One-time setup.
"Buy me $5 on Polymarket YES for X." Claude routes through AnyEx's x402 shim, you sign with your Kite wallet, the shares end up in a Polymarket DepositWallet you fully custody.
Pay only for what you trade. The one-time setup is the only fixed cost.
| Action | Fee | Notes |
|---|---|---|
| One-time DepositWallet setup | ~$0.05 USDC | Deploys your Polygon Safe + V2 token approvals. Idempotent. |
| Each BUY | order amount + Polymarket fee | The CLOB takes the per-market maker fee; AnyEx adds none on BUY. |
| Each SELL | ~$0.01 USDC flat | Polymarket sale proceeds accrue to your DepositWallet. |
| Each REDEEM (resolved markets) | ~$0.01 USDC flat | Winning shares pay out in USDC to your Polygon Safe. |
You do. AnyEx provisions a per-user Polymarket DepositWallet (a Gnosis Safe variant) on Polygon owned by a Polygon EOA derived from your Kite wallet. Signing for that Safe runs through Turnkey Delegated Access — AnyEx cannot move your funds.
x402 is the emerging open standard for paid HTTP APIs. EIP-3009 lets you authorize a USDC transfer off-chain with a single ECDSA signature — that signature is both the payment and the identity proof. No server-side session state, no JWT to leak, replay-protected by the token contract's on-chain nonce.
Yes — the AnyEx Polymarket endpoint is plain HTTP x402 V2. Use it from:
kpass agent:session execute --url …/x402/polymarket/buy@x402/core clientPayment-Signature header (see the skill SKILL.md for raw HTTP examples)The skill has two hard gates:
endDate has
already passed, even if Polymarket still shows acceptingOrders: true
(those are usually waiting on oracle resolution and resolve to $0 for new buys).
From Claude: "What are my Polymarket positions?" / "Sell my YES on X." Under the hood the skill calls the same shim:
GET /anyex/v1/x402/polymarket/positions?safe=<your-safe> (public)POST /anyex/v1/x402/polymarket/sell (paid x402, flat ~$0.01)POST /anyex/v1/x402/polymarket/redeem (paid x402, flat ~$0.01)Polymarket has US geo-restrictions that the underlying CLOB enforces. AnyEx doesn't bypass those — if you're in a blocked region the order will be rejected at the Polymarket side. The on-chain wallet and the x402 flow work regardless of geography; only the order matching does. We surface the error if it happens.
Rare, but possible. Lambda has a 30 s invocation budget; a first-ever /buy
for a brand-new user can race that when Polygon block production is slow. The order may
still have placed. Do not blindly retry — x402 nonces are unique, a
retry settles a second payment. First check:
curl "https://mcp.anyex.ai/anyex/v1/x402/polymarket/positions?safe=<your-safe>"
If your position is there, the buy succeeded. If empty, safe to retry. The
/init step runs first to make this almost impossible.