Skip to content

SnipeRun/polymarket-copy-trading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Polymarket Copy Trading Bot - Automated Prediction Market Trading

polymarket-copy-trading-bot for automated prediction market trading. Mirror successful traders' strategies on Polymarket in real-time with a Python-based copytrading bot.

License: MIT Python 3.9+ Polymarket

Screenshot 2026-04-24 020608

Open Positions

image

Buy Sell logs

image

โ˜๏ธ Skip The Setup โ†’ snipe.run โ€” The Cloud Enterprise Version

The code in this repo is the free, minimal, self-hosted version. It works, but you'll be the one running a Python process 24/7, holding a private key on disk, debugging WebSocket drops, and rebuilding a dashboard from scratch.

snipe.run is the cloud enterprise version โ€” the bot this codebase evolved into. It runs 24/7 in production on institutional-grade infrastructure, executes trades in under 200ms, and has already traded millions in live Polymarket volume.

Why snipe.run, not the free version:

  • โšก 10-30ร— faster execution โ€” sub-200ms WebSocket pipeline vs. 2-5 second polling. On Polymarket, speed is the edge. The trader you're copying moves โ†’ you're on the book before anyone else.
  • ๐Ÿ’ฐ Battle-tested in live production โ€” millions in traded Polymarket volume, running 24/7 for over two years. Not a demo. Not a prototype. A proven money-maker.
  • ๐ŸŽฏ 7-layer automated exit engine โ€” trailing stops, winner-locks, time exits, loss cuts, proportional follow-sells, instant profit ladders. The free version has none of this. You'll lock in profits you'd otherwise give back.
  • ๐Ÿ“ˆ Automatic tier-scaling โ€” your sizing, max price, and risk caps scale with your bankroll automatically. Start at $100, compound to $100k+, no config changes.
  • ๐Ÿ›‘ Never-miss, never-stop โ€” dedicated infrastructure that doesn't crash at 3am, doesn't drop WebSocket connections, doesn't need your laptop open. If a trader moves, you move. Period.
  • ๐Ÿ“Š Professional live dashboard โ€” P/L chart, open positions, exit reasons, real-time log stream, trader roster, win rate. No terminal, no tail -f, no guessing.
  • ๐Ÿค– AI co-pilot โ€” reviews every position the moment it's opened, flags risk, answers "should I hold?" in plain English. Like having a hedge-fund analyst on every trade.
  • ๐Ÿ“ฑ Telegram push alerts on every BUY, every exit, every move. Know what your bot did before you unlock your phone.
  • ๐Ÿš€ Zero maintenance โ€” no server, no updates, no restarts, no "why did it crash". It just runs.

Set up in under 2 minutes. Sign in โ†’ set your trading wallet โ†’ go live. No Python, no CLI, no Supabase, no config files.

๐Ÿ‘‰ Start at snipe.run โ€” see the full feature list in the Cloud Enterprise Version section below.

๐Ÿ“‹ Table of Contents

๐ŸŽฏ About This Polymarket Copy Trading Bot

polymarket-copy-trading-bot is an automated trading system designed to replicate the trading strategies of successful Polymarket traders in real-time. Built with Python, Supabase, and the Polymarket CLOB API, this prediction market bot monitors trader activities and automatically executes copytrading orders.

โœจ Key Features

Automated Copytrading for Polymarket

This polymarket copy trading bot provides:

  • Real-Time Trade Detection: Monitors target trader's activities instantly
  • Automatic Order Execution: Places orders on Polymarket automatically
  • Position Tracking: Tracks all open positions and P&L in real-time
  • Flexible Sizing: Copy trades at any percentage of the original size
  • Supabase Integration: Reliable database for trade history and monitoring

๐Ÿ—๏ธ How It Works

automated polymarket trading bot operates in simple steps:

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Polymarket    โ”‚
โ”‚   API/Events    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Supabase DB   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”ค  Polling Scripts โ”‚
โ”‚  (PostgreSQL)   โ”‚      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚ Realtime Subscription
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Main Bot      โ”‚
โ”‚  - Listeners    โ”‚
โ”‚  - Handlers     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Constraints    โ”‚
โ”‚  - Sizing       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Order Maker    โ”‚
โ”‚ (py-clob-client)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Polymarket     โ”‚
โ”‚  CLOB API       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Flow

  1. Monitor: The bot continuously monitors your target trader via Polymarket API
  2. Detect: Real-time detection of new trades through Supabase
  3. Execute: Automatically places scaled orders on your Polymarket account
  4. Track: Maintains complete history of all copytraded positions

๐Ÿš€ Quick Start

Get your polymarket-copy-trading-bot running in 5 minutes:

Prerequisites

  • Python 3.9 or higher
  • Polymarket account with USDC
  • Supabase account (free tier works)
  • Private key from your Polymarket wallet

Installation

  1. Clone the polymarket bot repository
git clone https://github.com/giordanopsouza/polymarket-copy-trading-bot.git
cd polymarket-copy-trading-bot
  1. Set up Python environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Configure Supabase Database

Create your Supabase project and run the setup:

  • Go to supabase.com and create a project
  • Navigate to SQL Editor
  • Read the Document "supabase/README.md" and execute the SQL script
  • Get your project URL and anon key from Settings โ†’ API and Data API

โš ๏ธ IMPORTANT: Enable Realtime on Tables

The bot needs Realtime enabled to detect trades instantly. After creating the tables:

  1. Go to your Supabase Dashboard
  2. Click on Database โ†’ Database tables -> edit table -> enable real time
  3. Find the following tables and enable Realtime for each:
    • historic_trades
    • polymarket_positions
  4. Click the toggle switch to enable Realtime for both tables

Without Realtime enabled, the bot won't detect new trades or position changes!

  1. Configure your copytrading bot

Copy the example environment file:

cp env.example .env

Edit .env with your credentials:

# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key-here

# Polymarket Credentials
PK=your-private-key-here
POLY_FUNDER=your-polymarket-proxy-address

# Trader to Copy
TRADER_WALLET=trader-wallet-address-to-copy

# Optional: Sizing Configuration
STAKE_WHALE_PCT=0.001

Getting Your Credentials:

  • Private Key: Go to reveal.magic.link/polymarket and reveal your key
  • Proxy Address: Found under your profile picture on Polymarket
  • Trader Wallet: Copy from any trader's profile on Polymarket
  1. Run your polymarket copy trading bot
cd scripts
python main.py

That's it! Your automated polymarket bot is now running and will start copying trades.

โš™๏ธ Configuration Guide

Environment Variables

All configuration for this polymarket trading bot is done via .env:

Required Settings

SUPABASE_URL=          # Your Supabase project URL
SUPABASE_KEY=          # Supabase anon/public key
PK=                    # Your Polymarket private key
POLY_FUNDER=           # Your Polymarket proxy address
TRADER_WALLET=         # Trader wallet address to copy

Optional Settings

TRADER_WALLET=         # Trader wallet address to copy (can be changed anytime)
BANKROLL=500          # Your trading capital (default: 1000)
STAKE_WHALE_PCT=0.001 # Copy 0.1% of trader's size (default: 0.005)

Position Sizing Examples

The copytrading bot scales trades automatically:

  • If whale bets $10,000 and you set STAKE_WHALE_PCT=0.001
    • Your bot will place a $10 trade (10,000 ร— 0.001)
  • If whale bets $5,000 and you set STAKE_WHALE_PCT=0.002
    • Your bot will place a $10 trade (5,000 ร— 0.002)

Finding Profitable Traders to Copy

Visit polymarket.com/leaderboard to find:

๐ŸŽฎ Usage

Starting the Bot

python scripts/main.py

The polymarket copy trading bot will:

  1. โœ… Validate all credentials
  2. โœ… Connect to Supabase database
  3. โœ… Start monitoring your target trader
  4. โœ… Automatically execute copytrading orders

Testing Configuration

Verify your setup before live trading:

python scripts/config.py

This will display your current configuration and validate all credentials.

Monitoring Your Bot

The bot provides real-time console output showing:

  • New trades detected from target trader
  • Position updates and P&L changes
  • Orders placed on your account
  • Connection status and errors

๐Ÿ“ Project Structure

polymarket-copy-trading-bot/         # Polymarket copy trading bot
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ main.py                    # Main bot application
โ”‚   โ”œโ”€โ”€ config.py                  # Configuration management
โ”‚   โ”œโ”€โ”€ make_orders.py             # Order execution
โ”‚   โ”œโ”€โ”€ get_player_positions.py   # Position tracking
โ”‚   โ”œโ”€โ”€ get_player_history_new.py # Trade history
โ”‚   โ””โ”€โ”€ constraints/
โ”‚       โ””โ”€โ”€ sizing.py              # Position sizing logic
โ”œโ”€โ”€ supabase/
โ”‚   โ”œโ”€โ”€ create_table.sql           # Database schema
โ”‚   โ””โ”€โ”€ README.md                  # Supabase setup guide
โ”œโ”€โ”€ env.example                    # Configuration template
โ”œโ”€โ”€ requirements.txt               # Python dependencies
โ”œโ”€โ”€ README.md                      # This file
โ””โ”€โ”€ LICENSE                        # MIT License

๐Ÿ›ก๏ธ Risk Management

Position Sizing Tips

  1. Set STAKE_WHALE_PCT conservatively (0.001 = 0.1%)
  2. Monitor the trader's performance before increasing position sizes
  3. Keep some capital in reserve for market opportunities

๐Ÿค Contributing

Contributions to this polymarket-copy-trading-bot are welcome!

Ways to Contribute

  • ๐Ÿ› Report bugs and issues
  • ๐Ÿ’ก Suggest new features
  • ๐Ÿ“ Improve documentation
  • ๐Ÿ”ง Submit pull requests
  • โญ Star the repo if you find it useful

Roadmap

  • Web dashboard for monitoring
  • Advanced risk management features
  • Telegram/Discord notifications

โœ… Want the improved, production-ready version? โ†’ snipe.run

snipe.run is the improved, production-ready version of this bot โ€” same roots, rebuilt for real trading. Very fast. Very accurate. Zero installation. Every roadmap item above is already shipped, plus a lot the free version never will be:

  • โœ… Profit-tested & reliable โ€” live on Polymarket for over two years, consistently profitable, zero missed signals, zero downtime
  • โœ… Web dashboard โ€” production-grade, live P/L chart, open positions, recent closes, real-time log stream
  • โœ… Advanced risk management โ€” automatic bankroll-tier scaling, event & trader exposure caps, re-buy cooldowns, cost-basis guard
  • โœ… Telegram notifications โ€” real-time push on every BUY, every exit, every move
  • โšก Blazing fast โ€” sub-200ms WebSocket execution vs. 2-5s polling in the free version
  • ๐ŸŽฏ Surgically accurate โ€” 7-layer automated exit engine โ€” trailing stops, winner-locks, time exits, loss cuts, follow-sells, profit ladders
  • ๐Ÿค– AI co-pilot โ€” reviews every position the moment it opens, flags risk, answers "should I hold?"
  • ๐Ÿ’ฐ Battle-tested โ€” millions in live Polymarket volume, running 24/7 for over two years
  • ๐Ÿš€ Zero installation, zero maintenance โ€” no server, no CLI, no Python, no .env file. Sign in, set wallet, go live in under 2 minutes.

๐Ÿ‘‰ Start at snipe.run โ€” fast. accurate. no install. Support: t.me/sniperun

๐Ÿ“„ License

This polymarket trading bot is licensed under the MIT License - see LICENSE for details.

Disclaimer: This is an educational tool. Trading prediction markets involves financial risk. Use at your own discretion. Always start with small amounts and never invest more than you can afford to lose.

๐Ÿ”— Related Resources


Keywords: polymarket-copy-trading-bot, polymarket bot, prediction market bot, automated trading bot, polymarket automation, copy trading polymarket, polymarket mirror trading, crypto prediction markets

Built with โค๏ธ for the Polymarket community | Cloud Enterprise Version: snipe.run

Contact: https://t.me/sniperun

This polymarket copy trading bot helps traders automate their prediction market strategies. Star โญ the repo to support development!

Releases

No releases published

Packages

 
 
 

Contributors

Languages