Automated copy trading bots for Polymarket that mirror trades from successful traders (whales) in real-time.
This repository contains two implementations of a Polymarket copy trading bot:
- Rust Bot (
rust/) - High-performance, production-ready implementation - Python Bot (
python/) - Feature-rich implementation with extensive tooling
Both bots automatically monitor and copy trades from successful Polymarket traders, executing scaled positions based on your capital and risk preferences.
Use the Rust Bot if you want:
- β‘ Maximum performance and speed
- π― Focused, streamlined trading functionality
- π Production-grade reliability
- π¦ Single binary deployment
Use the Python Bot if you want:
- π οΈ Extensive tooling and research scripts
- π Advanced simulation and backtesting
- π Trader research and analysis tools
- πΌ Position management utilities
- π Comprehensive logging and monitoring
cd rust
# Follow the setup guide in rust/README.md
cargo run --release --bin validate_setup
cargo run --releaseπ Full Documentation: rust/README.md
cd python
pip install -r requirements.txt
python -m src.scripts.setup.setup
python -m src.mainπ Full Documentation: python/README.md
Polymarket-Copy-Trading-Bot/
β
βββ rust/ # Rust implementation
β βββ src/ # Source code
β βββ docs/ # Documentation
β βββ README.md # Rust bot documentation
β βββ Cargo.toml # Rust dependencies
β
βββ python/ # Python implementation
β βββ src/ # Source code
β βββ docs/ # Documentation
β βββ scripts/ # Utility scripts
β βββ README.md # Python bot documentation
β βββ requirements.txt # Python dependencies
β
βββ README.md # This file
| Feature | Rust Bot | Python Bot |
|---|---|---|
| Performance | β‘ Extremely fast | π Moderate |
| Setup Complexity | π’ Simple | π‘ Moderate |
| Trading Features | β Core trading | β Core + Advanced |
| Research Tools | β No | β Extensive |
| Simulation | β No | β Full backtesting |
| Position Management | β Basic | β Advanced |
| MongoDB Integration | β No | β Yes |
| Multi-Trader Support | β Single trader | β Multiple traders |
| Documentation | π Comprehensive | π Extensive |
Both bots follow a similar core workflow:
- Monitor - Watch for trades from target traders (whales)
- Analyze - Evaluate trade size, price, and market conditions
- Calculate - Determine scaled position size based on your capital
- Execute - Place matching orders on Polymarket
- Track - Log all trades for analysis
- Real-time blockchain monitoring via WebSocket
- 2% default position scaling (configurable)
- Tiered execution based on trade size
- Multi-layer risk management
- Sport-specific market adjustments
- API polling or WebSocket monitoring
- Proportional position sizing based on capital ratios
- Trade aggregation for efficiency
- MongoDB persistence for trade history
- Advanced risk management and circuit breakers
- Quick Start Guide - 5-minute setup
- Complete Setup Guide - Detailed instructions
- Configuration Guide - All settings explained
- Features Overview - Feature details
- Trading Strategy - Strategy logic
- Troubleshooting - Common issues
- Getting Started Guide - Complete setup
- Strategy Guide - Copy trading strategy
- Command Reference - All commands
- Usage Examples - Practical examples
- Polymarket Account - Sign up at polymarket.com
- Web3 Wallet - MetaMask recommended
- USDC/USDC.e - On Polygon network for trading
- RPC Provider - Alchemy, Chainstack, or Infura API key
- Whale Address - The trader address you want to copy
- Rust 1.70+ (Install Rust)
- Python 3.10+
- MongoDB database (MongoDB Atlas free tier works)
- Never share your
PRIVATE_KEYwith anyone - Never commit your
.envfile to git - Start with small amounts to test
- Use test/mock mode first to verify everything works
- Use a dedicated wallet separate from your main funds
- β Real-time trade copying via WebSocket
- β Intelligent position sizing (2% default)
- β Circuit breakers for risk management
- β Automatic order resubmission
- β Market cache system
- β CSV logging
- β Live market detection
- β Tiered execution
- β Multi-trader support
- β Smart position sizing
- β Trade aggregation
- β Real-time execution
- β MongoDB integration
- β Price protection
- β Extensive research tools
- β Simulation & backtesting
- β Position management utilities
- β Wallet management scripts
matches_optimized.csv- All detected and executed trades.clob_creds.json- Auto-generated API credentials.clob_market_cache.json- Market data cache
logs/bot-YYYY-MM-DD.log- Daily log filestrader_data_cache/- Cached trader datasimulation_results/- Simulation results- MongoDB collections - Trade history and positions
- Check the bot-specific troubleshooting guides:
- Rust Bot Troubleshooting
- Python Bot: Run
python -m src.scripts.setup.system_status
- Validate your configuration:
- Rust:
cargo run --release --bin validate_setup - Python:
python -m src.scripts.setup.system_status
- Rust:
- Review your
.envfile against the examples - Check console output for error messages
For questions or issues, contact via Telegram: @terauss
This software is provided as-is. Trading involves financial risk. Use at your own discretion. Test thoroughly before using real funds. The authors are not responsible for any losses.
ISC License - See LICENSE file for details.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- GitHub Repository: https://github.com/terauss/Polymarket-Copy-Trading-Bot
- Polymarket: https://polymarket.com
- Polymarket Leaderboard: https://polymarket.com/leaderboard
- Predictfolio: https://predictfolio.com
Made with β€οΈ for the Polymarket community