Polymarket CLI: Trade Prediction Markets from Terminal

Polymarket CLI: Trade Prediction Markets from Your Terminal

Prediction market enthusiasts rejoice! The Polymarket CLI brings the full power of Polymarket's decentralized prediction markets directly to your terminal. Built in Rust, this experimental tool lets you browse markets, place orders, manage positions, and interact with on-chain contracts—all without touching a web browser.

🚀 Quick Start in Seconds

Browse markets instantly (no wallet needed):

polymarket markets list --limit 5
polymarket markets search "election"
echo "Will Trump win?" | polymarket markets search

Trading setup (one-time):

polymarket setup  # Guided wizard
# or manually:
polymarket wallet create
polymarket approve set  # Needs MATIC for gas

💼 Install in One Command

# Homebrew (macOS/Linux)
brew tap Polymarket/polymarket-cli
brew install polymarket

# Or curl install
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh

🎯 Key Features

Market Intelligence (No Wallet Required)

  • markets list/search/get - Find any market instantly
  • clob book/price/midpoint - Real-time order books & pricing
  • events/tags/profiles - Discover trending events
  • data positions/leaderboard - Portfolio analytics

Professional Trading

# Limit order: Buy 10 shares at $0.52
polymarket clob create-order --token TOKEN_ID --side buy --price 0.52 --size 10

# Market order: Buy $25 worth
polymarket clob market-order --token TOKEN_ID --side buy --amount 25

# Bulk orders
polymarket clob post-orders --tokens "ID1,ID2" --prices "0.5,0.6" --sizes "10,5"

Portfolio Management

polymarket clob balance          # USDC & position balances
polymarket clob orders           # Open orders
polymarket clob trades           # Trade history
polymarket data value 0xADDRESS  # Portfolio value
polymarket clob cancel-all       # Emergency exit

🔌 Developer-Friendly JSON API

Every command supports -o json for scripting:

# Pipe to jq
polymarket -o json markets list | jq '.[].question'

# Batch price checks
polymarket -o json clob batch-prices "TOKEN1,TOKEN2"

🛠️ On-Chain Operations

  • CTF tokens: split/merge/redeem
  • Approvals: approve set/check
  • Bridge: Cross-chain deposits

⚠️ Production Ready Features

  • ✅ Homebrew formula with auto-updates
  • ✅ Interactive shell (polymarket shell)
  • ✅ Multiple signature types (proxy/EOA/Gnosis)
  • ✅ Error handling with structured JSON
  • ✅ MIT licensed (1.5k ⭐️ on GitHub)

🎯 Common Workflows

Research: markets search bitcoin && clob book TOKEN_ID Day trade: create-order && clob orders && cancel-all Monitor: data value $WALLET && clob balance Script: markets list -o json | grep election

🚨 Important Warnings

This is experimental software. Test with small amounts first. Always verify transactions. APIs may change without notice.

Get started: brew install polymarketpolymarket markets list → profit.

⭐ Star on GitHub | Full Docs

Original Article: View Original

Share this article