AI-Powered Prediction Market Intelligence Engine
This repository contains the backend service for ZIGMA, an AI-powered oracle that analyzes prediction markets across multiple platforms and generates high-confidence trading signals.
ZIGMA continuously ingests live prediction market data, cross-references news sources, runs structured LLM analysis, and surfaces executable trades with tunable risk controls. The system processes up to 1,000 markets per cycle with 150-200 deep analyses.
- Market Intake: Multi-platform data aggregation
- News Intelligence: Real-time news analysis and sentiment scoring
- LLM Probability Engine: Advanced AI-driven market analysis
- Risk Management: Multi-layer safety controls and position sizing
- Signal Distribution: Real-time signal delivery and logging
- Polymarket: Real-time market data and order books
- Kalshi: US-regulated prediction markets (coming Q2 2026)
- Jupiter/Raydium: Solana DEX liquidity and pricing
- News Feeds: Tavily API with LLM fallback
- Social Media: Sentiment analysis from multiple sources
OPENAI_API_KEY=your_openai_key
LLM_MODEL=gpt-4o-mini
ENABLE_LLM_NEWS_FALLBACK=true
MAX_MARKETS=1000
SAFE_MODE=true
REQUEST_TIMEOUT=20000
MAX_RETRIES=3MAX_MARKETS: Per-cycle fetch cap (default: 1000)SAFE_MODE: Prevents real trades/tweets (default: true)CRON_SCHEDULE: Cycle cadence (default: hourly)EDGE_THRESHOLDS: Minimum edge requirements (default: 5%)
- Node.js 18+
- npm or yarn
- OpenAI API key
- Tavily API key (for news intelligence)
# Clone repository
git clone <repository-url>
cd Zigmav2
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your API keys
# Run development
npm run dev- Real-time Processing: 22-second cycle completion
- Multi-platform Coverage: 5+ prediction market platforms
- Deep Analysis: 150-200 markets analyzed per cycle
- Risk Filtering: Multi-layer safety controls
- Edge Detection: Minimum 5% effective edge required
- Confidence Scoring: 68%+ confidence for executable trades
- Position Sizing: Kelly Criterion-based recommendations
- Audit Trail: Complete signal history and rationale
- SAFE_MODE: Prevents live trading during development
- Liquidity Veto: Minimum $10k liquidity requirement
- Volatility Lock: High-volatility market protection
- Correlation Checks: Portfolio risk management
- Cycle Time: ~22 seconds per analysis cycle
- Throughput: Up to 1,000 markets per cycle
- Latency: 3-4 seconds per market analysis
- Accuracy: 68-72% signal success rate
- API Calls: Optimized for cost efficiency
- Memory Usage: Efficient caching and storage
- Network: Retry logic and fallback mechanisms
- Storage: SQLite for local caching and audit trails
# Development mode (single cycle)
npm run dev
# Production mode (continuous)
npm start
# Run with cron scheduling
node src/index.js- Logs: Detailed operational logging
- Metrics: Performance and usage statistics
- Health Checks: System status monitoring
- Error Handling: Comprehensive error recovery
GET /status- System health and cycle statusGET /signals- Latest trading signalsGET /markets- Market data and analysisGET /logs- Operational logs and audit trails
- API key-based authentication
- Rate limiting and usage tracking
- Token-based access control
- Security monitoring and alerts
- Encryption: All sensitive data encrypted
- Access Control: Role-based permissions
- Audit Logging: Complete activity tracking
- Backup: Regular data backups and recovery
- SAFE_MODE: Development safety controls
- Input Validation: Comprehensive input sanitization
- Error Handling: Secure error reporting
- Monitoring: Real-time security alerts
- Environment: Production configuration
- Monitoring: System health and performance
- Scaling: Horizontal scaling capabilities
- Backup: Disaster recovery procedures
- Cloud Hosting: AWS/Azure deployment ready
- Database: PostgreSQL for production
- Caching: Redis for performance
- Monitoring: Prometheus/Grafana integration
- API Docs: Complete API reference
- Developer Guide: Integration tutorials
- Troubleshooting: Common issues and solutions
- Architecture: System design documentation
- Discord: Developer community support
- GitHub: Issue tracking and discussions
- Blog: Technical updates and announcements
- Newsletter: Development progress and updates
This software is provided for educational and development purposes. Prediction market trading carries significant financial risk. Users should:
- Never trade with funds they cannot afford to lose
- Conduct thorough research before making trading decisions
- Understand the risks involved in prediction markets
- Consult with financial professionals when appropriate
This project is licensed under the MIT License - see the LICENSE file for details.
Zigma Backend Service | AI-Powered Prediction Market Intelligence