@theschein/plugin-polymarket
v0.3.0
Published
ElizaOS plugin for Polymarket prediction markets
Maintainers
Readme
ElizaOS Polymarket Plugin
A plugin that integrates Polymarket prediction markets with ElizaOS agents.
Version: 0.3.0 ElizaOS Compatibility: 1.6.x+
Features
- 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
Installation
npm install @theschein/plugin-polymarketConfiguration
Add to your agent's character file:
```json { "plugins": ["@theschein/plugin-polymarket"] } ```
Environment Variables
# Required for trading
WALLET_PRIVATE_KEY=your-private-key
# Optional
CLOB_API_URL=https://clob.polymarket.com
CLOB_API_KEY=your-api-keyAvailable Actions
Core Trading
PLACE_ORDER- Buy shares in a marketSELL_ORDER- Sell existing positionsREDEEM_WINNINGS- Claim winnings from resolved markets
Market Discovery
SEARCH_MARKETS- Search for markets by keywordEXPLAIN_MARKET- Get detailed market informationGET_MARKET_PRICE- Check current market pricesSHOW_FAVORITE_MARKETS- Display trending markets
Portfolio Management
GET_PORTFOLIO_POSITIONS- View current holdingsGET_WALLET_BALANCE- Check USDC balanceAPPROVE_USDC- Approve USDC for tradingSETUP_TRADING- Complete trading setup
Market Data
GET_ORDER_BOOK_SUMMARY- View order book depthGET_PRICE_HISTORY- Historical price dataSYNC_MARKETS- Update local market database
Usage Examples
Search for Markets
"Find markets about the presidential election"
"Search for markets on AI development"Place Orders
"Buy $50 of YES shares in market 0x123..."
"Place a $100 bet on NO for the climate market"Portfolio Management
"Show my portfolio positions"
"What's my wallet balance?"
"Redeem my winnings"Market Analysis
"Explain the Bitcoin price market"
"What's the current price for YES shares?"
"Show me the order book"Architecture
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 exportsServices
MarketSyncService
Automatically syncs market data from Polymarket API every 24 hours to maintain a local database for faster searching.
MarketDetailService
Provides detailed market information and analysis capabilities.
Security Considerations
- Never commit private keys to version control
- Use environment variables for sensitive configuration
Support
For issues and questions:
- GitHub Issues: Create an issue
- Documentation: ElizaOS Docs
Acknowledgments
Built with ElizaOS framework and Polymarket CLOB Client.
