Orbital-Alpha/polymarket-copy-trading-bot
Orbital-Alpha/polymarket-copy-trading-botpolymarket trading bot,polymarket copy trading bot,polymarket trading bot,polymarket copy trading bot,polymarket trading bot,polymarket copy trading bot,polymarket trading bot,polymarket copy trading bot,polymarket trading bot,polymarket copy trading bot,polymarket trading bot,polymarket copy trading bot,
From the README
Polymarket BTC Up/Down Trading Bot
A production-oriented Node.js trading bot for Polymarket short-duration Up/Down markets on Polygon, with both arbitrage and copy-trading workflows.
Why this repository
This project is built for users who need an operational trading runtime instead of a toy script:
- Real CLOB authentication and order execution on Polymarket
- On-chain approvals, merge, and redeem transaction flows
- Real-time order-book monitoring via WebSocket with fallback logic
- Configurable risk limits, circuit breakers, and graceful shutdown behavior
- Dedicated copy-trading path for mirroring selected wallet activity
This repository contains:
- A 5-minute BTC Up/Down arbitrage bot that posts both sides of the market, takes mispriced liquidity, merges matched pairs, and redeems after resolution.
- An integrated wallet-following module that can mirror future buys from a target wallet during the main runtime.
- A dedicated buy-only copy trader under
src/copy/that polls Polymarket's public trade feed and reacts to fresh target-wallet buys.
The codebase is structured for real trading: on-chain approvals, Polymarket CLOB authentication, WebSocket order-book tracking, risk caps, circuit breakers, structured logging, and graceful shutdown handling are all included.
Important: This software places live blockchain and market orders. Use it only if you fully understand the strategy, the wallet setup, the gas implications, and the market risks.
Overview
This bot is designed around Polymarket complementary-token markets, especially the recurring btc-updown-5m-* markets.
At a high level, the main arbitrage engine:
- Loads your signer and Polymarket proxy wallet configuration.
- Ensures the required Polygon approvals are in place.
- Derives or refreshes Polymarket CLOB API credentials automatically.
- Discovers the next 5-minute BTC Up/Down market before it opens.
- Posts a symmetric buy ladder on both
UpandDown. - Aggressively buys both sides when the combined ask becomes favorable.
- Merges matched pairs back into USDC when economically sensible.
- Cancels open orders at market close.
- Waits for resolution and redeems winning positions.
The repository also supports copy-trading workflows for users who want to follow a target Polymarket wallet with configurable sizing and risk caps.
Screenshots
The following screenshots show the workflow this bot targets.
Performance
Activity Snapshot
Detailed Runbook
- Install dependencies:
npm install
- Create your local environment file:
Copy-Item .env.example .env
or:
cp .env.example .env
- Configure at minimum:
PRIVATE_KEYPROXY_WALLETPOLYGON_RPC(strongly recommended)
- Start with conservative limits and run:
npm start
Key Features
- Dual-sided ladder execution for recurring BTC 5-minute markets.
- Taker arbitrage logic wh