Polymarket with an AI Agent: Trade Prediction Markets on Solana
Published on 2026-03-03
Your OpenClaw bot or Claude Code agent can browse, research, and trade Polymarket and Kalshi prediction markets on Solana. Binary YES/NO contracts on crypto, politics, sports, and more — all settled in USDC.
Polymarket is the world's largest prediction market. Kalshi is the only CFTC-regulated prediction exchange in the US. Both are now accessible on Solana through Jupiter's prediction market infrastructure — meaning any AI agent with shell access can research events, trade contracts, and manage positions using sol predict commands.
This article covers everything your OpenClaw bot, Claude Code agent, or any LLM needs to start trading prediction markets autonomously. Note: prediction markets via Jupiter are not available from US or South Korean IP addresses.
Quick Start: Your AI Agent's First Prediction Market Trade
Add Sol CLI as a skill, then search and trade:
# 1. Add as an agent skill (OpenClaw, Claude Code, 37+ platforms)
npx skills add solanaguide/solana-cli
# 2. Set up a wallet and RPC
sol wallet create --name agent-wallet
sol config set rpc.url https://your-rpc-endpoint.com
# 3. Secure your agent
sol config set permissions.canTransfer false
sol config status # review security settings
sol config lock # once happy, lock to prevent agent changes
# 4. Search for a prediction market
sol predict search "bitcoin"
# 5. Buy $5 of YES contracts on a market you like
sol predict buy 5 yes POLY-701571
# 6. Check your position
sol predict positions
For OpenClaw / Clawdbot users — also available on ClawHub under solana-payments-wallets-trading.
For Claude Code users — install as a plugin:
/plugin marketplace add solanaguide/solana-cli
/plugin install solana-payments-wallets-trading@solanaguide-solana-cli
Or install globally for direct terminal use: npm install -g @solana-compass/cli
Why AI Agents Are Built for Prediction Markets
Prediction markets price real-world outcomes as probabilities. "Will Bitcoin hit $150K by December?" might trade at $0.35, meaning the market thinks there's a 35% chance. If you think the real probability is higher — say 55% — you can buy YES contracts at $0.35 and profit if you're right.
This is exactly the kind of reasoning AI agents excel at. An LLM can research an event — read news, analyse trends, weigh evidence — and form a probabilistic view. The gap between "I think this has a 55% chance" and "I bought YES at $0.35" is a single command: sol predict buy 5 yes POLY-701571.
Traditional prediction market platforms require a browser, manual research, and human decision-making at every step. An AI agent with Sol CLI can do all of this autonomously: browse markets, research the underlying events, compare its probability estimate to the market price, and act on the discrepancy — then track the position, detect resolution, and claim winnings.
Polymarket has processed billions in trading volume across thousands of markets. Kalshi is the only US CFTC-regulated prediction exchange. Both are serious financial markets, not toys — and both are available on Solana through Jupiter's aggregation layer.
How Prediction Markets Work on Solana
Polymarket and Kalshi markets via Jupiter
Jupiter aggregates prediction markets from Polymarket and Kalshi and makes them available as Solana-native instruments. Each event (e.g. "What price will Bitcoin hit in 2026?") contains one or more markets (e.g. "Above $100K", "Above $150K", "Above $200K"). Each market is a binary YES/NO contract.
The mechanics are straightforward:
- YES contracts pay $1.00 each if the outcome is YES, $0.00 if NO
- NO contracts pay $1.00 each if the outcome is NO, $0.00 if YES
- Contract prices range from $0.00 to $1.00 — the price represents the market's implied probability
- Settlement is in USDC on Solana
- YES + NO prices always sum to approximately $1.00
When a market resolves, winning contracts are worth exactly $1.00 each. Losing contracts are worth nothing.
How AI agents profit from prediction markets
The profit model is simple: buy contracts when the market misprices the probability.
Example: An agent buys 20 YES contracts at $0.40 each — total cost $8.00. If the outcome is YES, the agent receives $20.00 (20 contracts × $1.00), for a profit of $12.00. If the outcome is NO, the agent loses the $8.00.
The edge comes from estimating probability better than the market. An agent that can research an event thoroughly — reading news, analysing data, weighing multiple sources — may identify markets where the implied probability is too low or too high.
Agents can also exit positions before resolution. If an agent bought YES at $0.40 and the price moves to $0.70 as sentiment shifts, it can sell the contracts and take profit without waiting for the market to resolve. This is done via sol predict sell.
Browsing Polymarket Events with Your AI Agent
Browse prediction markets by category
sol predict list shows available events across nine categories:
# Browse crypto prediction markets
sol predict list crypto
# Politics — elections, policy, geopolitics
sol predict list politics
# Sports — match outcomes, championships
sol predict list sports
# All categories at once
sol predict list
Available categories: crypto, sports, politics, esports, culture, economics, tech, finance, climate & science.
Filter by market status to find what's relevant:
# What's trending right now
sol predict list crypto --filter trending
# Newly created markets
sol predict list politics --filter new
# Currently live (in-play)
sol predict list sports --filter live
# Upcoming events
sol predict list --filter upcoming
Search Polymarket and Kalshi by keyword
When your agent is researching a specific topic, search narrows results to relevant events:
# Search for Bitcoin-related prediction markets
sol predict search "bitcoin"
# Search for Fed rate decision markets
sol predict search "fed rate"
# Search for a specific event or topic
sol predict search "election 2026"
Deep dive into a Polymarket event and its markets
Once the agent finds an interesting event, it can drill into the details:
# View event details — all markets, volume, status
sol predict event POLY-89525
# View a specific market — YES/NO prices and orderbook depth
sol predict market POLY-701571
# Structured output for agent decision-making
sol predict market POLY-701571 --json
The market view shows current YES and NO prices, trading volume, and the orderbook — giving the agent everything it needs to decide whether the market is mispriced.
Buying and Selling Prediction Market Contracts on Solana
Buy YES or NO contracts via your AI agent
sol predict buy purchases contracts for a specified USD amount:
# Buy $10 of YES contracts
sol predict buy 10 yes POLY-701571
# Buy $25 of NO contracts
sol predict buy 25 no POLY-701571
# Set a maximum price per contract (price protection)
sol predict buy 10 yes POLY-701571 --max-price 0.50
# JSON output for agent parsing
sol predict buy 5 yes POLY-701571 --json
The --max-price flag prevents the agent from buying at unfavourable prices. If YES is currently $0.55 and the agent sets --max-price 0.50, the order is rejected — protecting against slippage or fast-moving markets.
The amount is in USD (paid in USDC). The number of contracts received depends on the price: $10 at $0.40 per contract buys 25 contracts. If the market resolves YES, those 25 contracts pay out $25.00.
Sell prediction positions before settlement
Agents don't have to wait for resolution. If the market moves in the agent's favour, it can sell and lock in profit:
# Sell an open position
sol predict sell 7xK...abc
# Set a minimum sell price per contract
sol predict sell 7xK...abc --min-price 0.60
The --min-price flag works like a limit order — the sale only executes if the price per contract is at or above the minimum. This prevents the agent from selling into a momentary dip.
Claim winnings on resolved Polymarket predictions
When a market resolves, winning positions become claimable. Each winning contract is worth exactly $1.00 in USDC:
# Claim winnings on a resolved market
sol predict claim 7xK...abc
# JSON output with P&L
sol predict claim 7xK...abc --json
If the agent bought 25 YES contracts at $0.40 each ($10.00 total) and the market resolved YES, claiming returns $25.00 USDC — a profit of $15.00.
Tracking Prediction Market Positions and P&L
Monitor AI agent positions with unrealized P&L
sol predict positions shows all open and claimable positions with live P&L:
# View all prediction positions
sol predict positions
# JSON output for agent monitoring
sol predict positions --json
# Filter to a specific wallet
sol predict positions --wallet agent-wallet
Each position shows: the market title, side (YES/NO), number of contracts, cost basis, current value, unrealized P&L (amount and percentage), fees paid, and status. The claimable status indicator tells the agent when a resolved market is ready for collection — the agent can monitor positions periodically and claim automatically when winnings are available.
Prediction market transaction history
sol predict history provides a complete audit trail of all prediction market activity:
# View transaction history
sol predict history
# Limit to recent transactions
sol predict history --limit 10
Every buy, sell, and claim is recorded with the price, amount, fees, and timestamp.
Prediction positions in your Solana portfolio
Prediction market positions appear in sol portfolio alongside tokens, staked SOL, lending positions, earn vaults, and open orders. This gives the agent — and you — a unified view of all deployed capital:
sol portfolio
The portfolio view includes the market title, side, current value, and unrealized P&L for each prediction position. Snapshots capture prediction positions, so sol portfolio compare tracks how your prediction bets are performing over time.
AI Agent Prediction Market Workflows
The real power of sol predict is in multi-step workflows where the agent researches, reasons, and acts autonomously. Here are two complete examples.
Research a prediction event and place a bet
An agent is instructed to find crypto prediction markets where it believes the probability is mispriced:
# 1. Check available capital
sol portfolio --json
# 2. Browse trending crypto prediction markets
sol predict list crypto --filter trending --json
# 3. An event catches the agent's eye: "What price will SOL hit in 2026?"
sol predict event POLY-89525 --json
# 4. Drill into a specific market: "SOL above $200"
# YES is priced at $0.35 — the market says 35% chance
sol predict market POLY-701571 --json
# 5. The agent researches:
# - SOL is at $170, up 40% in 3 months
# - On-chain activity is accelerating
# - Major ecosystem catalysts ahead
# Conclusion: "I estimate 55% probability — the market is underpricing YES"
# 6. Buy $10 of YES contracts at $0.35
sol predict buy 10 yes POLY-701571 --json
# 7. Record the portfolio state
sol portfolio snapshot --label "sol-prediction-entry"
# 8. Confirm the position is tracked
sol predict positions --json
The agent discovered a market, assessed the implied probability against its own research, identified a 20-percentage-point edge, and executed. Total cost: $10.00 in USDC.
Monitor positions, detect a win, and claim it
The agent runs a periodic check on its prediction positions and discovers a market has resolved in its favour:
# 1. Check all prediction positions
sol predict positions --json
# 2. The agent's response shows:
# Position 7xK...abc — "SOL above $200" — YES — status: "claimable"
# Cost basis: $10.00, Contracts: 28.57
# The market resolved YES — SOL hit $200
# 3. Claim the winnings — 28.57 contracts × $1.00 = $28.57 USDC
sol predict claim 7xK...abc --json
# 4. Profit: $28.57 - $10.00 = $18.57 (186% return)
# 5. Verify the USDC arrived
sol portfolio --json
# 6. Snapshot the new state
sol portfolio snapshot --label "sol-prediction-win"
# 7. Compare to the entry snapshot
sol portfolio compare sol-prediction-entry sol-prediction-win
The agent detected the resolution, claimed winnings, verified the payout, and created an audit trail — all without human intervention.
Instructing Your AI Agent to Trade Prediction Markets
If you're running an AI agent with shell access, you can point it at prediction markets with natural language. Here are example prompts:
Research crypto prediction markets on Polymarket. Find markets where you think the probability is mispriced based on current trends. If you find one with at least 15% edge, buy $10 of contracts on the underpriced side.
Check all my prediction market positions. If any have been resolved and are claimable, claim the winnings. Report the P&L for each.
Search for prediction markets about the next Fed rate decision. Show me the current YES/NO prices and explain what the market implies about the probability of a rate cut.
I want to take a small position on whether Bitcoin will hit $150K this year. Find the relevant Polymarket event, show me the current prices, and buy $5 of YES contracts if the price is below $0.40.
The agent uses sol predict for market data and trading, sol portfolio for capital management, and --json throughout for structured output it can parse and reason about.
Prediction Market Permissions and Safety on Solana
The canPredict permission
Prediction market write operations — buying, selling, and claiming — are gated behind the canPredict permission. Read operations (browsing, searching, viewing positions) are always available regardless of permissions.
# ~/.sol/config.toml
[permissions]
canPredict = true # allow buying, selling, and claiming
canTransfer = false # prevent sending funds externally
canExportWallet = false # prevent key export
When canPredict is set to false, the buy, sell, and claim subcommands are removed from the CLI entirely. They don't appear in help text, can't be invoked, and no prompt injection can create them.
Transaction limits apply to prediction bets
maxTransactionUsd and maxDailyUsd limits apply to prediction market buys, just as they do to swaps and transfers:
[limits]
maxTransactionUsd = 50
maxDailyUsd = 200
With these limits, the agent cannot place a bet larger than $50 or spend more than $200 across all transactions in a rolling 24-hour window — regardless of what instructions it receives.
Geo-restrictions for Polymarket on Solana
Prediction markets via Jupiter are not available from US or South Korean IP addresses. This restriction is enforced at the API level. Agents running from these locations will receive errors when attempting to buy, sell, or claim. Read operations (browsing and viewing markets) may still work.
Prediction Market Command Reference
Every command below supports --json for structured output and --wallet <name> to target a specific wallet.
| What you want | Command |
|---|---|
| Browse all prediction events | sol predict list |
| Browse crypto predictions | sol predict list crypto |
| Browse politics predictions | sol predict list politics |
| Browse sports predictions | sol predict list sports |
| Filter to trending markets | sol predict list --filter trending |
| Filter to newly created markets | sol predict list --filter new |
| Search by keyword | sol predict search "bitcoin" |
| View event details and markets | sol predict event POLY-89525 |
| View market prices and orderbook | sol predict market POLY-701571 |
| Buy YES contracts | sol predict buy 10 yes POLY-701571 |
| Buy NO contracts | sol predict buy 25 no POLY-701571 |
| Buy with price protection | sol predict buy 10 yes POLY-701571 --max-price 0.50 |
| Sell an open position | sol predict sell 7xK...abc |
| Sell with minimum price | sol predict sell 7xK...abc --min-price 0.60 |
| Claim resolved winnings | sol predict claim 7xK...abc |
| View all positions with P&L | sol predict positions |
| View transaction history | sol predict history |
| See predictions in portfolio | sol portfolio |
Available categories: crypto, sports, politics, esports, culture, economics, tech, finance, climate & science.
Available filters: trending, new, live, upcoming.
Further Reading
- Sol CLI Complete Guide — full documentation for all Sol CLI commands
- AI Agent Financial Markets on Solana — tokenized stocks, gold, lending, and more
- Agent Permissions and Security — how to configure permissions, limits, and allowlists
- x402 Agent API Payments — pay for market data and APIs with USDC
Prediction markets involve risk of total loss of capital. Contract prices reflect market sentiment, not objective probabilities. You are solely responsible for your own decisions and for understanding the risks involved. Prediction markets may not be available in all jurisdictions — they are not available from US or South Korean IP addresses. This is not financial advice.
On this page
- Quick Start: Your AI Agent's First Prediction Market Trade
- Why AI Agents Are Built for Prediction Markets
- How Prediction Markets Work on Solana
- Browsing Polymarket Events with Your AI Agent
- Buying and Selling Prediction Market Contracts on Solana
- Tracking Prediction Market Positions and P&L
- AI Agent Prediction Market Workflows
- Instructing Your AI Agent to Trade Prediction Markets
- Prediction Market Permissions and Safety on Solana
- Prediction Market Command Reference
- Further Reading
Related Content
How to Give Your AI Agent Access to Financial Markets on Solana
Your OpenClaw bot or Claude Code agent can buy tokenized stocks, gold, Bitcoin, Ethereum, and hundreds more — plus earn yield on stablecoins. Set up AI-powered investing on Solana.
Sol CLI: A Solana Skill for AI Agents
A Solana skill for OpenClaw, Claude Code, and AI agents. Trade tokens, manage wallets, stake SOL, earn yield, and track portfolios — no API keys, no code.
Sol CLI Guide: Every Solana Command for AI Agents and Humans
The complete guide to Sol CLI — trade, stake, lend, and manage portfolios on Solana from OpenClaw, Claude Code, or any AI agent. No API keys, no code required.
Ship or Die at Accelerate 2025: Tokenization of Capital Markets (Nathan Allman - Ondo Finance)
Nathan Allman of Ondo Finance discusses the future of tokenization and its impact on capital markets
Collector Crypt: Onchain Capital Markets On Solana | Tuomas Holmberg
Discover how Collector Crypt is revolutionizing the $10B+ trading card industry by bringing physical collectibles on-chain with positive EV mechanics, AI pricing oracles, and deep Solana integration.
x402 on Solana: Your AI Agent Can Pay for Its Own Data
AI agents can now pay for premium APIs, web scraping, and market data per-request using USDC on Solana. No API keys, no subscriptions — just sol fetch and a wallet.
Breakpoint 2024: Product Keynote: How MetaDAO's Futards Are Building a Market-Governed Civilization
MetaDAO introduces market-driven decision-making on Solana, revolutionizing organizational governance and decision processes.
The Best Wallets for Solana for Staking, NFTs, and Defi
To make the most of Solana you'll need a wallet that is secure and supports NFTs, Defi and tokens. Read on to find our favourites
Coral $20M Funding, 1100 ETH Hack, Solana Outage, and More | Superteam Crypto Twitter Round Up
Dive into the latest Solana ecosystem news, including Coral's $20M funding round, a detailed explanation of the recent network outage, and key insights from the crypto market.
Ship or Die 2025: An Introduction to the Solana Policy Institute
Miller Whitehouse-Levine introduces the Solana Policy Institute, a new organization dedicated to advocating for Solana in Washington D.C.
Ship or Die at Accelerate 2025: Global Unified Market (Kash Dhanda - Jupiter)
Jupiter announces Jupiter Lend, a revolutionary money market on Solana, as part of its vision for a global unified market.
Product Keynote: Kalshi
Kalshi announces its transformation from a US-only prediction market app to a global on-chain and off-chain platform, featuring new partnerships with Phantom and Jupiter on Solana
Keynote: DFlow (Nitesh Nath)
DFlow announces the launch of their Prediction Markets API powered by Kalshi, bringing tokenized prediction markets to Solana traders
Product Keynote: Forma
Forma announces the Isle of Man as its first permanent Solana economic zone after pioneering nation-state partnerships across four continents
Product Keynote: Worm
Form introduces leverage trading for prediction markets on Solana, allowing users to multiply their upside potential up to 3x on market positions
- Borrow / Lend
- Liquidity Pools
- Token Swaps & Trading
- Yield Farming
- Solana Explained
- Is Solana an Ethereum killer?
- Transaction Fees
- Why Is Solana Going Up?
- Solana's History
- What makes Solana Unique?
- What Is Solana?
- How To Buy Solana
- Agent Permissions & Security
- AI Agent Financial Markets
- Solana Agent Skill
- Complete Sol CLI Guide
- AI Agent Prediction Markets
- x402 Agent API Payments
- Solana's Best Projects: Dapps, Defi & NFTs
- Choosing The Best Solana Validator
- Staking Rewards Calculator
- Liquid Staking
- Can You Mine Solana?
- Solana Staking Pools
- Stake with us
- How To Unstake Solana
- How validators earn
- Best Wallets For Solana
