A plugin for that integrates Polymarket prediction markets with ElizaOS agents.
- Market Discovery: Search and browse Polymarket prediction markets
- Trading Actions: Place buy/sell orders with private wallet key authentication
- Portfolio Management: Track positions, balances, and P&L
- Market Analysis: Get order book data, price history, and market insights
- Redemption: Claim winnings from resolved markets
- USDC Management: Read and approve USDC for trading
npm install @theschein/plugin-polymarketAdd to your agent's character file:
```json { "plugins": ["@theschein/plugin-polymarket"] } ```
# Required for trading
WALLET_PRIVATE_KEY=your-private-key
# Optional
CLOB_API_URL=https://clob.polymarket.com
CLOB_API_KEY=your-api-keyPLACE_ORDER- Buy shares in a marketSELL_ORDER- Sell existing positionsREDEEM_WINNINGS- Claim winnings from resolved markets
SEARCH_MARKETS- Search for markets by keywordEXPLAIN_MARKET- Get detailed market informationGET_MARKET_PRICE- Check current market pricesSHOW_FAVORITE_MARKETS- Display trending markets
GET_PORTFOLIO_POSITIONS- View current holdingsGET_WALLET_BALANCE- Check USDC balanceAPPROVE_USDC- Approve USDC for tradingSETUP_TRADING- Complete trading setup
GET_ORDER_BOOK_SUMMARY- View order book depthGET_PRICE_HISTORY- Historical price dataSYNC_MARKETS- Update local market database
"Find markets about the presidential election"
"Search for markets on AI development"
"Buy $50 of YES shares in market 0x123..."
"Place a $100 bet on NO for the climate market"
"Show my portfolio positions"
"What's my wallet balance?"
"Redeem my winnings"
"Explain the Bitcoin price market"
"What's the current price for YES shares?"
"Show me the order book"
The plugin follows a modular architecture:
src/
├── actions/ # Individual action implementations
├── services/ # Background services (market sync, etc.)
├── providers/ # Data providers for agent context
├── utils/ # Helper utilities
├── types.ts # TypeScript type definitions
├── plugin.ts # Main plugin configuration
└── index.ts # Public exports
Automatically syncs market data from Polymarket API every 24 hours to maintain a local database for faster searching.
Provides detailed market information and analysis capabilities.
- Never commit private keys to version control
- Use environment variables for sensitive configuration
For issues and questions:
- GitHub Issues: Create an issue
- Documentation: ElizaOS Docs
Built with ElizaOS framework and Polymarket CLOB Client.