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.Maximum number of markets to retrieve (commonly 500 for Polymarket)
Filter markets by status (OPEN, RESOLVED, etc.)
Sort order (HIGHEST_LIQUIDITY recommended for Polymarket)
List of market objects matching the query criteria
Get Binary Market
Retrieve a specific binary market by ID.Polymarket market ID (condition ID)
Market object containing question, probabilities, and trading information
Buy Tokens
Purchase outcome tokens for a market.Outcome to bet on (“Yes” or “No” for binary markets)
Amount to spend in USDC
Get Trade Balance
Get available USDC balance for trading.API keys containing Polymarket credentials and wallet
Available USDC balance for trading
Market Data Model
Market Properties
Polymarket market condition ID
Market question text
Market description with additional context
Available outcomes (e.g., [“Yes”, “No”] for binary markets)
Current probability of “Yes” outcome (0.0 to 1.0)
Total trading volume in USDC
When the market closes for trading
When the market was created
Direct link to the market on Polymarket
Whether the market is currently open for trading
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