> polycli

Seedling
planted May 4, 2026tended May 4, 2026
#project#web3#prediction-markets#polymarket#rust#cli#trading-tools

polycli

A comprehensive command-line tool for Polymarket investigation, analysis, and trading β€” built in Rust for speed and a clean, scriptable surface.

Built from research across Polymarket's on-chain activity, official APIs, and the developer ecosystem of 84+ open-source repositories.

The point of writing this in Rust was to have one tight binary that covers the full investigation flow β€” markets, addresses, whales, orderbooks, subgraphs, volatility, arbitrage β€” without bouncing between five different web dashboards.

Repo

github.com/LucianoLupo/poly-cli

What it covers

  • Market discovery β€” search, filter, sort by volume / liquidity / category, get full market detail.
  • Address investigation β€” positions, P&L, trade history, real-time watch, related-wallet clustering.
  • Whale monitoring β€” recent large trades, real-time alerts above a threshold, leaderboards by P&L or volume.
  • Orderbook analysis β€” depth, spread, imbalance for any token.
  • Subgraph queries β€” predefined queries plus raw GraphQL for custom analysis.
  • Volatility analysis β€” most volatile, near-50/50 (uncertainty), ending soon, 15-minute crypto markets for delta-neutral strategies.
  • Arbitrage detection β€” internal (YES + NO β‰  $1) and cross-platform (Polymarket vs Kalshi).
  • On-chain events β€” monitor CTF Exchange and NegRisk CTF Exchange in real time.

Sample workflows

Tracking a profitable wallet

# 1. Find top traders by 7-day P&L
poly whale leaderboard --period 7d --limit 10 --format json

# 2. Inspect their open positions
poly addr positions 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

# 3. Look at their recent trade pattern
poly addr trades 0x742d35Cc... --limit 30

# 4. Get a P&L summary
poly addr pnl 0x742d35Cc...

A single binary takes you from "who's making money" to "what's their actual strategy" in four commands.

Internal arbitrage scan

poly arb internal --min-spread 0.5

Surfaces markets where YES + NO < $1 by more than the threshold. The output explicitly tells you the per-$100 profit before fees, because Polymarket's ~2% fee + slippage usually erases small spreads. Honest numbers > optimistic ones.

Quick filtering with jq

Every command supports --format json, so you can pipe into jq for arbitrary filtering:

poly markets list --category Crypto --limit 100 --format json | \
  jq '.[] | select(.volume > 100000 and .endDate < (now + 7*24*3600 | todate))
            | {question, volume, endDate, yes: .outcomes[0].price}'

That's the use case the CLI shape was optimized for β€” composable inside a Unix pipeline, not an interactive TUI.

API surface

| API | Endpoint | Auth | |-----|----------|------| | CLOB API | clob.polymarket.com | required for trading | | Gamma API | gamma-api.polymarket.com | none | | Data API | data-api.polymarket.com | none | | Subgraphs (Goldsky) | various | none |

The CLI also reads the on-chain CTF Exchange (0x4bFb...82E) and NegRisk Exchange (0xC5d5...80a) on Polygon directly when you give it an RPC URL.

Roadmap

The shipped surface is read-only and analytical. Planned next:

  • v0.2 β€” actual trading commands (place / cancel orders), more orderbook & event commands, portfolio alerts.
  • v0.3 β€” Telegram/Discord webhook integration, full PolyTrack-style cluster detection, Kalshi cross-platform arb, better WebSocket streaming.
  • v0.4 β€” historical backtesting, ML-based whale-pattern detection, Dune Analytics integration.

Why I built it

I run polymarket prediction-market bots β€” both for resolution arbitrage and for football-match alerting. Every one of those bots needs the same stack of "what's the market state right now, who's holding it, what just changed?" queries. Doing that across three dashboards (Polymarket UI, PolyTrack, custom queries to Goldsky) was the bottleneck. polycli collapses that into a single binary that the bots and I can both call.

Connection points

  • Powers the on-chain investigation work behind my prediction-market bots (resolution-arb, football-match alerts).
  • Same defensive-tool philosophy as Rug Scanner: own the analysis, don't proxy. polycli queries Polymarket's APIs and Goldsky subgraphs directly so the data and the verdict are mine to defend.