shmlkv
polymarket-copy-trading-bot
TypeScript

Bet with the Winners. Mirror trades from top Polymarket traders with intelligent position sizing and real-time execution.

Last updated Jul 8, 2026
50
Stars
8
Forks
0
Issues
+2
Stars/day
Attention Score
66
Language breakdown
No language data available.
โ–ธ Files click to expand
README

Polymarket Copy Trading Bot

Copy the best, automate success. Mirror trades from top Polymarket traders with intelligent position sizing and real-time execution.

Node License Repo Size Issues

Why This Bot?

A copy trading bot for Polymarket that prioritizes transparency, flexibility, and real-time execution. Unlike manual trading or basic scripts, this bot offers complete automation with intelligent position sizing.

Key Features

| Feature | Description | | ------------------------ | --------------------------------------------------------------------- | | ๐Ÿ–ฅ๏ธ Web Dashboard | Full-featured web interface for analytics, trading, and configuration | | ๐Ÿ“ Position Tracking | Accurate tracking of purchases and sells across balance changes | | โšก Real-time Execution | Monitors trades every second and executes instantly | | ๐Ÿ”„ Trade Aggregation | Combine multiple small trades into larger executable orders | | ๐Ÿ‘ฅ Multi-Trader Support | Track and copy trades from multiple traders simultaneously | | ๐Ÿ“Š Smart Position Sizing | Automatically scales trades based on your capital vs trader's balance | | ๐Ÿ“ˆ Tiered Multipliers | Apply different multipliers based on trade size ranges | | ๐Ÿ’พ MongoDB Integration | Persistent storage of all trades and positions | | ๐Ÿณ Docker Support | Production-ready deployment with Docker Compose |


Quick Start

# Clone and install
git clone <repository-url>
cd polymarket-copy-trading-bot-v1
npm install

Configure

cp .env.example .env

Edit .env with your wallet, traders, MongoDB, RPC

Run

npm run build npm run web # Web interface at http://localhost:3000 npm start # Or terminal mode

๐Ÿ“– Detailed Setup Guide โ†’


Web Interface

The bot includes a full web dashboard at http://localhost:3000 with three main views:

Traders Analytics

  • P&L and ROI charts for all tracked traders
  • Monthly and daily performance trends
  • Volume analysis and win rate statistics
  • Sortable table with detailed metrics

Example trader: Check performance on Predictfolio

My Trades

  • Your copy trading performance and P&L
  • Trade history with market details
  • Position tracking across all markets

Settings

  • Traders Management โ€” Add/remove traders to copy
  • Copy Strategy โ€” Configure PERCENTAGE/FIXED/ADAPTIVE mode, multipliers, tiered sizing
  • Safety Limits โ€” Set max/min order sizes, position limits, daily volume caps
  • Bot Settings โ€” Fetch interval, preview mode, trade aggregation
  • Wallet Info โ€” View balances (USDC, MATIC)
  • Quick Actions โ€” Health check, stats, close resolved positions, manual sell
All settings are saved to .env file. Restart the bot to apply changes.

Installation

Prerequisites

  • Node.js v18+
  • MongoDB (Atlas recommended)
  • Polygon wallet with USDC
  • POL (MATIC) for gas (~$5-10)

Standard Setup

git clone <repository-url>
cd polymarket-copy-trading-bot-v1
npm install
cp .env.example .env

Edit .env:

USER_ADDRESSES = '0xTrader1, 0xTrader2'
PROXYWALLET = 'yourpolygon_wallet'
PRIVATEKEY = 'yourprivate_key'
MONGO_URI = 'mongodb+srv://...'
RPC_URL = 'https://polygon-mainnet.infura.io/v3/...'
npm run build
npm run web     # Web interface
npm start       # Terminal mode

Docker

cp .env.docker.example .env.docker
export $(cat .env.docker | grep -v '^#' | xargs)
docker-compose up -d

๐Ÿ“– Docker Guide โ†’


Configuration

| Variable | Description | Default | | --------------------------- | --------------------------------- | ---------- | | USER_ADDRESSES | Traders to copy (comma-separated) | โ€” | | PROXY_WALLET | Your Polygon wallet | โ€” | | PRIVATE_KEY | Wallet private key | โ€” | | MONGO_URI | MongoDB connection string | โ€” | | RPC_URL | Polygon RPC endpoint | โ€” | | COPY_STRATEGY | PERCENTAGE / FIXED / ADAPTIVE | PERCENTAGE | | COPY_SIZE | Copy size (% or USD) | 10 | | TRADE_MULTIPLIER | Position size multiplier | 1.0 | | TIERED_MULTIPLIERS | Size-based multipliers | โ€” | | MAXORDERSIZE_USD | Maximum order size | 100 | | MINORDERSIZE_USD | Minimum order size | 1 | | PREVIEW_MODE | Simulate without trading | false | | TRADEAGGREGATIONENABLED | Combine small trades | false |

See .env.example for full configuration options.


CLI Commands

npm run web              # Start web interface
npm start                # Start copy trading bot
npm run analyze          # Analyze tracked traders
npm run analyze:my       # Analyze your trades
npm run health           # System health check
npm run stats            # View positions and P&L
npm run close:resolved   # Close resolved market positions
npm run redeem           # Redeem winning positions
npm run close:stale      # Close old inactive positions

Documentation


Safety

โš ๏ธ Use at your own risk. This bot executes real trades with real money.

Best Practices:

  • Use a dedicated wallet with limited funds
  • Start with PREVIEW_MODE=true to test
  • Research traders before copying
  • Monitor the bot regularly
  • Set appropriate safety limits

Contributing

  • Fork the repository
  • Create feature branch (git checkout -b feature/name)
  • Commit changes (git commit -m 'Add feature')
  • Push to branch (git push origin feature/name)
  • Open Pull Request

License

Educational and research purposes. Users responsible for compliance with local laws and Polymarket ToS.


Disclaimer: Trading involves risk of loss. Developers not responsible for financial losses.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท shmlkv/polymarket-copy-trading-bot ยท Updated daily from GitHub