Overview
Polymarket is a real-money prediction market platform built on Polygon that allows users to trade on the outcome of future events using USDC. The Polymarket market API provides access to high-liquidity markets with significant trading volume.MarketType Enum
Market Class
PolymarketAgentMarket
ThePolymarketAgentMarket class extends AgentMarket and provides Polymarket-specific functionality.
Core Methods
Get Markets
Retrieve available prediction markets from Polymarket.int
Maximum number of markets to retrieve (commonly 500 for Polymarket)
FilterBy
Filter markets by status (OPEN, RESOLVED, etc.)
SortBy
Sort order (HIGHEST_LIQUIDITY recommended for Polymarket)
list[PolymarketAgentMarket]
List of market objects matching the query criteria
Get Binary Market
Retrieve a specific binary market by ID.str
required
Polymarket market ID (condition ID)
PolymarketAgentMarket
Market object containing question, probabilities, and trading information
Buy Tokens
Purchase outcome tokens for a market.str
required
Outcome to bet on (“Yes” or “No” for binary markets)
USD
required
Amount to spend in USDC
Get Trade Balance
Get available USDC balance for trading.APIKeys
required
API keys containing Polymarket credentials and wallet
USD
Available USDC balance for trading
Market Data Model
Market Properties
str
Polymarket market condition ID
str
Market question text
str | None
Market description with additional context
list[str]
Available outcomes (e.g., [“Yes”, “No”] for binary markets)
Probability
Current probability of “Yes” outcome (0.0 to 1.0)
USD | None
Total trading volume in USDC
DatetimeUTC | None
When the market closes for trading
DatetimeUTC | None
When the market was created
str
Direct link to the market on Polymarket
bool
Whether the market is currently open for trading
str | None
Final resolution outcome (if resolved)
Polymarket-Specific Features
Real-Money Trading
Polymarket uses USDC (USD Coin) for real-money predictions on Polygon.High Liquidity Markets
Polymarket is known for high-liquidity markets, especially on political and current events.The Graph Integration
Polymarket market data is accessible via The Graph protocol.Real-World Examples
Historical Data Analysis
Query historical Polymarket data for sentiment analysis.Market Replication
Replicate high-quality Polymarket markets to other platforms.Trading Strategy Example
Microchain Function
Use Polymarket in microchain-based agents.Platform Details
- Blockchain: Polygon (Layer 2)
- Currency: USDC (USD Coin)
- Website: https://polymarket.com
- Market Types: Primarily binary (Yes/No)
- Focus: Political events, current affairs, crypto
- Liquidity: Often highest among prediction markets
- Resolution: UMA protocol for decentralized resolution
Market Categories
Polymarket markets typically cover:- Politics & elections
- Cryptocurrency prices
- Sports outcomes
- Current events
- Pop culture
- Economic indicators
Advantages
- Real Money: USDC-based real-money predictions
- High Liquidity: Large trading volumes
- Quality Markets: Professional market creation
- Decentralized Resolution: UMA protocol
- Institutional Interest: Growing institutional participation
Considerations
Sorting Behavior
When fetching Polymarket markets for trading:Volume-Based Filtering
Focus on high-volume markets for better price discovery.Regulatory Compliance
Polymarket has geographic restrictions. Ensure compliance with local regulations.GraphQL Query Example
Error Handling
Best Practices
- Sort by Liquidity: Use
SortBy.HIGHEST_LIQUIDITYfor better markets - Check Volume: Verify sufficient volume before trading
- Monitor Fees: Account for trading fees in calculations
- Verify Resolution: Understand UMA resolution process
- Manage Risk: Use appropriate position sizing