A comprehensive real-time tracking application for Polymarket events and markets, featuring winner detection, market analysis, and live updates.
- Real-time Market Tracking: Live updates of Polymarket events and markets
- Winner Detection: Automatic detection and display of winning outcomes for resolved markets
- Volume Analysis: Track trading volumes and market performance
- Interactive Dashboard: Clean web interface with filtering and search capabilities
- Server-Sent Events: Real-time browser notifications for market resolutions
- Winner Analytics: Track and analyze market winners with blockchain integration
- Export Functionality: Export market data and winner information
- Node.js (v14 or higher)
- npm or yarn
- Polymarket account with API access
-
Clone the repository
git clone <your-repo-url> cd polymarket-tracker
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
-
Configure your credentials in
.env# Your private key (without 0x prefix) PRIVATE_KEY=your_private_key_here # Your funder address from Polymarket profile FUNDER_ADDRESS=your_funder_address_here # Signature type (0 = EOA, 1 = Magic/Email, 2 = Browser Wallet) SIGNATURE_TYPE=0
-
Start the application
npm start
-
Open your browser
http://localhost:3000
| Variable | Description | Default |
|---|---|---|
PRIVATE_KEY |
Your wallet private key | Required |
FUNDER_ADDRESS |
Your Polymarket funder address | Required |
SIGNATURE_TYPE |
Wallet signature type (0-2) | 0 |
POLYGON_RPC_URL |
Polygon RPC endpoint | https://polygon-rpc.com |
MARKETS_API_URL |
Polymarket API endpoint | https://gamma-api.polymarket.com |
PORT |
Server port | 3000 |
ENABLE_REALTIME |
Enable real-time updates | true |
| Endpoint | Description |
|---|---|
GET / |
Web dashboard |
GET /stats |
Market statistics |
GET /active?limit=50 |
Active markets |
GET /resolved?limit=50 |
Resolved markets |
GET /winners?marketId=123 |
Market winners |
GET /winner-stats |
Winner statistics |
GET /track-winners?marketId=123&outcome=YES |
Track market winners |
GET /events |
Server-Sent Events stream |
GET /export |
Export all data |
- Volume-based color coding: Green (>$100k), Yellow (>$10k), Gray (<$10k)
- Real-time countdowns: Live countdown timers for market end dates
- Winner badges: Green badges showing winning outcomes for resolved markets
- Market filtering: Search and filter markets by various criteria
- Automatic winner detection: Uses Polymarket's outcome prices to determine winners
- Blockchain integration: Track actual token holders and payouts
- Winner analytics: Statistics and leaderboards for market winners
- Live market resolutions: Instant notifications when markets resolve
- Auto-refresh: Periodic updates every 5 minutes
- WebSocket integration: Real-time price and status updates
This application handles sensitive cryptographic keys. Follow these security practices:
- Never commit your
.envfile to version control - Use strong, unique private keys
- Regularly rotate API keys and credentials
- Use environment variables for sensitive data
- Implement proper access controls
- Use HTTPS for all communications
- Consider using hardware wallets for production keys
βββ index.js # Main application server
βββ marketTracker.js # Core market tracking logic
βββ winnerTracker.js # Winner detection and blockchain tracking
βββ public/
β βββ index.html # Web dashboard
βββ data/ # Local data storage
βββ .env # Environment configuration (not in git)
- PolymarketTracker: Main class for fetching and tracking market data
- PolymarketWinnerTracker: Specialized class for winner detection and blockchain analysis
- Web Server: Express-like HTTP server with SSE support
- Real-time Engine: WebSocket connections for live updates
The application uses multiple data sources to determine market winners:
- Outcome Prices: Markets with price > 0.9 are considered winners
- Token Data: ERC-1155 token transfers for precise holder tracking
- API Integration: Direct integration with Polymarket's resolution data
- Total events and markets tracked
- Volume analysis and trending
- Resolution rates and timing
- Multi-outcome vs binary market distribution
- Total payouts and winner counts
- Top winners across all markets
- Average payout calculations
- Market-specific winner breakdowns
Port already in use
lsof -ti:3000 | xargs killEnvironment variables not loading
- Ensure
.envfile exists in project root - Check for syntax errors in
.envfile - Restart the application after changes
API rate limiting
- Increase
REQUEST_DELAY_MSin.env - Check your Polymarket API limits
- Implement exponential backoff
WebSocket connection issues
- Check firewall settings
- Verify WebSocket URL in configuration
- Monitor connection logs in browser console
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the ISC License.
This is an educational/analytical tool. Trading involves risk. Always do your own research and never trade with funds you can't afford to lose.
For issues and questions:
- Create an issue in the GitHub repository
- Check the troubleshooting section above
- Review Polymarket's official documentation