{"id":42604810,"url":"https://github.com/ent0n29/polybot","last_synced_at":"2026-01-29T01:49:21.344Z","repository":{"id":330229709,"uuid":"1115780061","full_name":"ent0n29/polybot","owner":"ent0n29","description":"reverse-engineer every polymarket strategy and trade fast","archived":false,"fork":false,"pushed_at":"2025-12-24T10:50:40.000Z","size":1504,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T14:48:38.776Z","etag":null,"topics":["gabagool22","polymarket","polymarket-api","polymarket-bot","polymarket-trading-bot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ent0n29.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-13T14:38:45.000Z","updated_at":"2025-12-24T22:38:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ent0n29/polybot","commit_stats":null,"previous_names":["ent0n29/polybot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ent0n29/polybot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ent0n29%2Fpolybot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ent0n29%2Fpolybot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ent0n29%2Fpolybot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ent0n29%2Fpolybot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ent0n29","download_url":"https://codeload.github.com/ent0n29/polybot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ent0n29%2Fpolybot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28859919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gabagool22","polymarket","polymarket-api","polymarket-bot","polymarket-trading-bot"],"created_at":"2026-01-29T01:49:20.775Z","updated_at":"2026-01-29T01:49:21.339Z","avatar_url":"https://github.com/ent0n29.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polybot\n\n**Open-source Polymarket trading infrastructure and strategy reverse-engineering toolkit.**\n\nPolybot provides a complete trading infrastructure for [Polymarket](https://polymarket.com) prediction markets, along with powerful tools to analyze and reverse-engineer successful trading strategies from any user.\n\n![Strategy Analysis Dashboard](docs/showcase_readme.png)\n\n## Features\n\n### Trading Infrastructure\n- **Executor Service**: Low-latency order execution with paper trading simulation\n- **Strategy Service**: Pluggable strategy framework for automated trading\n- **Real-time Market Data**: WebSocket integration for order book and trade feeds\n- **Position Management**: Automatic tracking, settlement, and token redemption\n- **Risk Management**: Configurable limits, kill switches, and exposure caps\n\n### Strategy Research \u0026 Reverse Engineering\n- **User Trade Analysis**: Ingest and analyze any Polymarket user's trading history\n- **Pattern Recognition**: Identify entry/exit signals, sizing rules, and timing patterns\n- **Replication Scoring**: Compare your bot's decisions against target strategies\n- **Backtesting Framework**: Test strategies against historical data\n\n### Analytics Pipeline\n- **ClickHouse Integration**: High-performance time-series analytics\n- **Event Streaming**: Kafka-based event pipeline for real-time analysis\n- **Monitoring**: Grafana dashboards and Prometheus metrics\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                        Polybot Architecture                      │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                  │\n│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐  │\n│  │   Strategy   │  │   Executor   │  │      Ingestor        │  │\n│  │   Service    │──│   Service    │  │      Service         │  │\n│  │              │  │              │  │                      │  │\n│  │ • Strategies │  │ • Order Mgmt │  │ • User Trades        │  │\n│  │ • Signals    │  │ • Simulator  │  │ • Market Data        │  │\n│  │ • Positions  │  │ • Settlement │  │ • On-chain Events    │  │\n│  └──────────────┘  └──────────────┘  └──────────────────────┘  │\n│         │                 │                    │                 │\n│         └─────────────────┼────────────────────┘                 │\n│                           │                                      │\n│                    ┌──────▼──────┐                               │\n│                    │    Kafka    │                               │\n│                    │   Events    │                               │\n│                    └──────┬──────┘                               │\n│                           │                                      │\n│                    ┌──────▼──────┐                               │\n│                    │ ClickHouse  │                               │\n│                    │  Analytics  │                               │\n│                    └─────────────┘                               │\n│                                                                  │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## Quick Start\n\n### Prerequisites\n- Java 21+\n- Maven 3.8+\n- Docker \u0026 Docker Compose\n- Python 3.11+ (for research tools)\n\n### 1. Clone and Configure\n\n```bash\ngit clone https://github.com/yourusername/polybot.git\ncd polybot\n\n# Copy environment template\ncp .env.example .env\n\n# Edit .env with your configuration\n# At minimum, set POLYMARKET_TARGET_USER to analyze\n```\n\n### 2. Start Infrastructure\n\n```bash\n# Start ClickHouse and Kafka\ndocker-compose -f docker-compose.analytics.yaml up -d\n\n# Optional: Start monitoring stack\ndocker-compose -f docker-compose.monitoring.yaml up -d\n```\n\n### 3. Build and Run Services\n\n```bash\n# Build all services\nmvn clean package -DskipTests\n\n# Start executor (paper trading mode by default)\ncd executor-service \u0026\u0026 mvn spring-boot:run -Dspring-boot.run.profiles=develop\n\n# Start strategy service (in another terminal)\ncd strategy-service \u0026\u0026 mvn spring-boot:run -Dspring-boot.run.profiles=develop\n\n# Start ingestor (in another terminal) - ingests target user's trades\ncd ingestor-service \u0026\u0026 mvn spring-boot:run -Dspring-boot.run.profiles=develop\n```\n\n### 4. Research \u0026 Analysis\n\n```bash\ncd research\n\n# Create Python virtual environment\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\n# Take a snapshot of target user's data\npython snapshot_report.py\n\n# Run deep analysis\npython deep_analysis.py\n\n# Compare your bot's execution vs target\npython sim_trade_match_report.py\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `POLYMARKET_TARGET_USER` | Username to analyze/replicate | Yes (for research) |\n| `POLYMARKET_PRIVATE_KEY` | Wallet private key | For live trading |\n| `POLYMARKET_API_KEY` | API credentials | For live trading |\n| `ANALYTICS_DB_URL` | ClickHouse connection | For analytics |\n\nSee [.env.example](.env.example) for complete configuration reference.\n\n### Trading Modes\n\n| Mode | Description |\n|------|-------------|\n| `PAPER` | Simulated trading (default) |\n| `LIVE` | Real money trading |\n\n## Services\n\n### Executor Service (Port 8080)\nHandles order execution, position management, and settlement.\n\n```bash\n# API Examples\ncurl http://localhost:8080/api/polymarket/health\ncurl http://localhost:8080/api/polymarket/positions\ncurl http://localhost:8080/api/polymarket/settlement/plan\n```\n\n### Strategy Service (Port 8081)\nRuns trading strategies and generates signals.\n\n```bash\ncurl http://localhost:8081/api/strategy/status\n```\n\n### Ingestor Service (Port 8082)\nIngests market data and user trades into ClickHouse.\n\n### Analytics Service (Port 8083)\nProvides analytics APIs over ClickHouse data.\n\n## Included Strategy: Complete-Set Arbitrage\n\nThe repository includes a fully-implemented **complete-set arbitrage strategy** for Polymarket Up/Down binary markets:\n\n- **Edge Detection**: Identifies when UP + DOWN prices sum to less than $1\n- **Inventory Skewing**: Adjusts quotes to balance positions\n- **Fast Top-Up**: Quickly completes pairs after partial fills\n- **Taker Mode**: Crosses spread when edge is favorable\n\nSee [docs/EXAMPLE_STRATEGY_SPEC.md](docs/EXAMPLE_STRATEGY_SPEC.md) for detailed documentation.\n\n## Research Tools\n\nThe `research/` directory contains Python tools for strategy analysis:\n\n| Script | Purpose |\n|--------|---------|\n| `snapshot_report.py` | Take data snapshots for analysis |\n| `deep_analysis.py` | Comprehensive strategy analysis |\n| `replication_score.py` | Score how well you're replicating |\n| `sim_trade_match_report.py` | Compare sim vs target execution |\n| `paper_trading_dashboard.py` | Jupyter dashboard for monitoring |\n\n## Project Structure\n\n```\npolybot/\n├── executor-service/       # Order execution \u0026 settlement\n├── strategy-service/       # Trading strategies\n├── ingestor-service/       # Data ingestion\n├── analytics-service/      # Analytics APIs\n├── polybot-core/           # Shared libraries\n├── research/               # Python analysis tools\n├── docs/                   # Documentation\n└── monitoring/             # Grafana/Prometheus configs\n```\n\n## Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Ideas for Contribution\n- New trading strategies\n- Additional market types support\n- Improved analytics and visualizations\n- Better backtesting framework\n- More reverse-engineering tools\n\n## Disclaimer\n\n**This software is for educational and research purposes only.**\n\n- Trading prediction markets involves significant financial risk\n- Past performance does not guarantee future results\n- You are solely responsible for your trading decisions\n- Always start with paper trading before using real funds\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n**Built with curiosity about how successful traders operate on Polymarket.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fent0n29%2Fpolybot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fent0n29%2Fpolybot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fent0n29%2Fpolybot/lists"}