Autonomous trading system for cross-platform arbitrage opportunities on Polymarket and Kalshi.
Built with Node.js, Python, and Web3 integration for automated profit generation through market inefficiencies.
- Real-time scanning of Polymarket markets for endgame arbitrage (95-99% probability markets)
- Cross-platform arbitrage detection between Polymarket and Kalshi
- Silent execution mode for continuous background operation
- Smart filtering to identify high-probability opportunities
- Market maker pattern analysis for sophisticated exploitation strategies
- Machine learning opportunity ranking and success prediction
- Endgame Arbitrage: Target markets near resolution with extreme probability skew
- Cross-Platform: Exploit price differences between Polymarket and Kalshi
- Market Maker Exploitation: Identify and exploit MM behavior patterns
- ML-Enhanced Selection: Use historical data to improve opportunity selection
- Advanced Risk Management: Kelly Criterion position sizing with adaptive parameters
- Compound Growth: Intelligent reinvestment strategy for exponential scaling
- Web Dashboard: Real-time performance monitoring and system control
- WebSocket Updates: Live data streaming for immediate insights
- Risk Analytics: Comprehensive risk metrics and emergency controls
- ML Insights: Actionable intelligence from pattern recognition
- Performance Tracking: Detailed analytics with Sharpe ratio and drawdown analysis
- Node.js detection engines with WebSocket support
- Python wallet management and Web3 integration
- Multi-network support (Ethereum, Polygon, Solana)
- API Integration with Polymarket and Kalshi platforms
- Secure credential management with environment variables
- Node.js 18+
- Python 3.8+
- Web3 wallet with funding (~$10+ to start)
# Clone the repository
git clone https://github.com/LvcidPsyche/polymarket-arbitrage-bot.git
cd polymarket-arbitrage-bot
# Install Node.js dependencies
npm install
# Set up Python environment
python3 -m venv polymarket-env
source polymarket-env/bin/activate
pip install web3 mnemonic requests
# Configure environment variables
cp .env.example .env
# Edit .env with your credentialsCreate a .env file with:
WALLET_SEED="your twelve word seed phrase here"
KALSHI_API_KEY="your_kalshi_api_key"
KALSHI_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----..."
POLYGON_RPC_URL="https://polygon-rpc.com"# Check wallet balances
source polymarket-env/bin/activate
python3 check_all_balances.py
# Run single arbitrage scan
node arbitrage_detector.js
# Start continuous silent operation
./execute_silent_trading.sh
# Check system status
node check_silent_status.js# Start real-time web dashboard
node dashboard_server.js
# Then visit http://localhost:3000
# Advanced risk management
node advanced_risk_manager.js report # Generate risk report
node advanced_risk_manager.js stop # Emergency stop
node advanced_risk_manager.js resume # Resume trading
# Machine learning insights
python3 ml_opportunity_predictor.py insights # Generate ML insights
python3 ml_opportunity_predictor.py retrain # Retrain model
# Market maker analysis
node market_maker_analyzer.js monitor # Start MM monitoring
node market_maker_analyzer.js report # Generate MM report
node market_maker_analyzer.js opportunities # Show exploitable opportunitiesTarget Performance:
- 548% annualized returns on successful endgame trades
- 15-25% success rate on identified opportunities
- Starting capital: $10
- Growth target: $10 β $1,000+ through compounding
Risk Management:
- Maximum 10% of balance per trade
- Automated position sizing
- Stop-loss mechanisms
- Diversified opportunity hunting
arbitrage_detector.js- Main opportunity scannerintensive_arbitrage_scanner.js- Deep market analysisefficient_arbitrage_scanner.js- Optimized resource usagesilent_arbitrage_executor.js- Background trading systemmarket_maker_analyzer.js- NEW: MM behavior analysis and exploitationml_opportunity_predictor.py- NEW: Machine learning opportunity ranking
advanced_risk_manager.js- NEW: Kelly Criterion position sizing with adaptive parameterscheck_all_balances.py- Multi-network balance checkingcheck_wallet.py- Primary wallet validationcreate_test_wallet.py- Development wallet generation
dashboard_server.js- NEW: Real-time web dashboard with WebSocketautonomous_trader.js- Execution enginemanual_arbitrage_guide.md- Manual trading procedures
polymarket_trading_system/- Core trading logic with strategiespolymarket_trading_system/src/strategies/endgame_arbitrage.py- Endgame strategy implementationpolymarket_trading_system/src/strategies/cross_platform.py- Cross-platform arbitragepolymarket_trading_system/src/core/risk_manager.py- Risk management corepolymarket_trading_system/src/core/trading_engine.py- Main execution engine
The system provides comprehensive monitoring:
# System health check
node check_silent_status.js
# Recent activity logs
cat arbitrage_scans/recent_activity.log
# Balance tracking
python3 check_all_balances.pyTarget markets with 95-99% probability near resolution:
- Sports events with clear outcomes
- Economic announcements
- Political events with deadlines
- Time-sensitive predictions
Exploit price differences between:
- Polymarket vs Kalshi
- Different resolution timeframes
- Market maker inefficiencies
- Environment variables for sensitive data
- Local credential storage with secure access
- Transaction signing with private key management
- Rate limiting and API compliance
- Fail-safe mechanisms to prevent large losses
- Phase 1: Manual validation with $10-50
- Phase 2: Semi-automated with $50-500
- Phase 3: Fully autonomous with $500+
- Phase 4: Multi-strategy deployment
This is an active development project. Key areas for improvement:
- Additional arbitrage strategies
- Enhanced risk management
- UI/dashboard development
- Performance optimization
- Strategy backtesting
This software is for educational and research purposes. Trading involves risk of loss. Always test with small amounts and understand the risks involved. Past performance does not guarantee future results.
For questions or issues:
- Create a GitHub issue
- Review the documentation in
/docs - Check the troubleshooting guide
Built by OpenClawdad π¦ | Autonomous AI Trading System