Skip to main content
The CLI ships with first-class Polymarket support: discover markets by volume or keyword, fund a Polymarket proxy wallet from the smart wallet, place CLOB orders for YES/NO outcomes, and list open positions and orders. Polymarket uses a separate EOA key for CLOB signing, imported once via set-key. The proxy wallet needs a one-time approve call before the first buy. For an enterprise context, this is the surface for hedging operational risk (regulatory events, supply-chain disruptions, demand shocks) at small dollar values within a clear cap.

How it works

Trade flow
1OperatorCLIpolymarket set-key <privateKey> (one-time)
2OperatorCLIpolymarket approve —broadcast (one-time)
3OperatorCLIpolymarket markets —search …
4Smart walletProxy walletFunds the proxy wallet, then buys YES/NO tokens via CLOB
5OperatorCLIpolymarket positions / orders / sell / cancel
The proxy wallet is Polymarket’s per-EOA execution wallet. clob-buy funds it from the smart wallet first, then submits the buy order. sell and order management work directly against the proxy.

One-time setup

polygon-agent polymarket set-key 0xYOUR_EOA_PRIVATE_KEY
polygon-agent polymarket proxy-wallet
# 0xProxyAddress (the destination for funding)
polygon-agent polymarket approve --broadcast
set-key stores the EOA private key encrypted in ~/.polygon-agent/. approve is a one-time onchain transaction that authorizes the proxy wallet to spend USDC on Polymarket’s CLOB; without it, the first buy fails.

Commands

markets

polygon-agent polymarket markets
polygon-agent polymarket markets --search "election" --limit 50
FlagDefaultPurpose
--searchnoneFilter by question text
--limit20Number of results
--offset0Pagination offset
Lists active markets sorted by volume.

market

polygon-agent polymarket market <conditionId>
Returns full detail for one market identified by conditionId.

set-key

polygon-agent polymarket set-key <privateKey>
Imports an EOA private key for Polymarket signing. Stored AES-256-GCM encrypted. Required before any trading commands.

proxy-wallet

polygon-agent polymarket proxy-wallet
Returns the Polymarket proxy wallet address derived from the active EOA. Use this address as the funding destination.

approve

polygon-agent polymarket approve --broadcast
polygon-agent polymarket approve --neg-risk --broadcast
FlagDefaultPurpose
--neg-riskfalseApprove negative-risk markets
--broadcastfalseExecute the transaction
One-time approval before the first clob-buy. Pass --neg-risk to also approve negative-risk markets.

clob-buy

polygon-agent polymarket clob-buy <conditionId> YES 25 --broadcast
polygon-agent polymarket clob-buy <conditionId> NO 100 --price 0.42 --broadcast
Buy YES or NO tokens via CLOB. Positional args are conditionId, outcome (YES or NO), and USDC to spend.
FlagDefaultPurpose
--walletmainSmart wallet to fund the proxy from
--pricenoneLimit price 0–1 (GTC); omit for market order
--fakfalseFill-and-kill instead of fill-or-kill
--skip-fundfalseSkip wallet→proxy funding (proxy already funded)
--broadcastfalseExecute the transaction

sell

polygon-agent polymarket sell <conditionId> YES 50 --broadcast
polygon-agent polymarket sell <conditionId> NO 50 --price 0.55 --broadcast
Sell YES or NO tokens. Positional args are conditionId, outcome, and number of shares.
FlagDefaultPurpose
--pricenoneLimit price 0–1 (GTC); omit for market order
--fakfalseFill-and-kill instead of fill-or-kill
--broadcastfalseExecute the transaction

positions, orders, cancel

polygon-agent polymarket positions
polygon-agent polymarket orders
polygon-agent polymarket cancel <orderId>
positions lists open positions for the proxy wallet. orders lists open CLOB orders for the active EOA. cancel cancels a specific order by ID.

Worked example

# One-time per machine
polygon-agent polymarket set-key 0xEOA_KEY
polygon-agent polymarket approve --broadcast

# Find a market
polygon-agent polymarket markets --search "fed cuts" --limit 5

# Buy YES with $25 USDC at market price
polygon-agent polymarket clob-buy 0xCONDITION_ID YES 25
# ⚡ Dry run, funds proxy with 25 USDC, places market buy

polygon-agent polymarket clob-buy 0xCONDITION_ID YES 25 --broadcast
# Funded proxy + placed buy
# Tx: 0xabc... → https://polygonscan.com/tx/0xabc...

# Track
polygon-agent polymarket positions
polygon-agent polymarket orders

Implementation

CLI overview

Topology, safety model, supported chains.

Setup and wallets

Smart wallet is the funding source for the proxy.

Transfers

Move USDC into the smart wallet before trading.

Balances and funding

Confirm USDC available before placing orders.