[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2792":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},2792,"polymarket-copy-trading-bot","Parallax-Trading\u002Fpolymarket-copy-trading-bot","Parallax-Trading","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,polymarket trading bot,polymarket copy trading bot,","https:\u002F\u002Fpolymarket.com\u002F@chattykraus?tab=activity",null,"JavaScript",390,3941,3,0,354,57,false,"main",true,[22,23,24,25,5,26,27],"bitcoin-market","copy-trading-bot","politics-market","polymarket","sports-market","trading-bot","2026-06-12 04:00:15","# 🤖 Polymarket BTC Up\u002FDown Trading Bot\n\n> **A beginner-friendly guide to setting up and running your first automated trading bot on Polymarket.**\n\n**Repository:** [https:\u002F\u002Fgithub.com\u002FParallax-Trading\u002Fpolymarket-copy-trading-bot](https:\u002F\u002Fgithub.com\u002FParallax-Trading\u002Fpolymarket-copy-trading-bot)\n\n---\n\n## ⚠️ Important Before You Start\n\nThis bot places **real money trades** on the blockchain. Please read this before doing anything:\n\n- You can **lose money**. This is not guaranteed to be profitable.\n- Start with **very small amounts** (e.g. $5–$10) while you're learning.\n- Use a **separate, dedicated wallet** — never your main crypto wallet.\n- This is a tool for experienced users who understand the risks. If you're brand new to crypto trading, take time to learn the basics first.\n\n---\n\n## 📖 What Does This Bot Actually Do?\n\nIn plain English: Polymarket runs short-duration prediction markets where you can bet on whether Bitcoin's price will go **Up** or **Down** in the next 5 minutes. Every pair of Up + Down tokens always resolves to a combined value of $1.\n\nThis bot exploits small pricing gaps in those markets:\n\n1. It watches for a moment when you can buy **both** Up and Down tokens for a combined price **less than $1**.\n2. It buys both sides simultaneously — no matter which direction Bitcoin moves, the pair is worth $1 at resolution.\n3. The difference between what you paid and $1 is your profit.\n\nIt also includes a **copy-trading mode** that mirrors the trades of a target wallet you choose to follow.\n\n---\n\n## 📊 Performance Screenshots\n\nHere's what the bot's activity looks like in practice:\n\n### 1-Day Performance\n![1D performance view](img\u002FScreenshot_3.png)\n\n### Past Week Performance\n![Past week performance view](img\u002FScreenshot_1.png)\n\n### All-Time Performance\n![All-time performance view](img\u002FScreenshot_2.png)\n\n### Redeem History\n![Redeem-heavy history view](img\u002FScreenshot_4.png)\n\n### Mixed Trade Activity\n![Mixed buy, loss, and redeem activity](img\u002FScreenshot_5.png)\n\n---\n\n## 🗺️ Choose Your Path\n\nThis repo has two main modes. Pick the one that fits your goal:\n\n| Mode | What it does | Best for |\n|------|-------------|----------|\n| **Main Arb Bot** | Automatically trades 5-min BTC markets | Hands-off automated trading |\n| **Copy Trader** | Mirrors trades from a wallet you choose | Following a successful trader |\n\n---\n\n## 🛠️ What You'll Need\n\nBefore installing anything, make sure you have all of the following:\n\n### Required\n- **A computer** running Windows, Mac, or Linux\n- **Node.js version 18 or newer** — [Download here](https:\u002F\u002Fnodejs.org). To check your version, run `node --version` in your terminal.\n- **A Polymarket account** — [Sign up at polymarket.com](https:\u002F\u002Fpolymarket.com)\n- **A Polygon wallet** — this is where your funds live (e.g. MetaMask set to Polygon network)\n- **Your wallet's private key** — the secret key for your trading wallet (⚠️ never share this with anyone)\n- **Your Polymarket proxy wallet address** — found in your Polymarket account settings\n- **USDC on Polygon** — the stablecoin used for trading (not Ethereum USDC, it must be on Polygon)\n- **A small amount of MATIC** — Polygon's native token, used to pay for gas fees (a few dollars' worth is enough)\n\n### Strongly Recommended\n- A **private Polygon RPC endpoint** from a service like [Alchemy](https:\u002F\u002Falchemy.com) or [Infura](https:\u002F\u002Finfura.io). The free public RPC can be unreliable. Both services have free tiers.\n\n---\n\n## 🚀 Installation (Step by Step)\n\n### Step 1 — Download the repository\n\nIf you have Git installed:\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FParallax-Trading\u002Fpolymarket-copy-trading-bot.git\ncd polymarket-copy-trading-bot\n```\n\nOr click the green **Code** button on GitHub and choose **Download ZIP**, then unzip it.\n\n### Step 2 — Install dependencies\n\nOpen a terminal inside the project folder and run:\n```bash\nnpm install\n```\n\nThis downloads all the libraries the bot needs. It may take a minute.\n\n### Step 3 — Create your configuration file\n\n**On Mac\u002FLinux:**\n```bash\ncp .env.example .env\n```\n\n**On Windows (PowerShell):**\n```powershell\nCopy-Item .env.example .env\n```\n\nThis creates a file called `.env` where you'll put all your private settings. This file stays on your computer only — it is never uploaded anywhere.\n\n### Step 4 — Fill in your `.env` file\n\nOpen `.env` in any text editor (Notepad, VS Code, etc.) and fill in your details. See the configuration section below for a full explanation of every setting.\n\n### Step 5 — Run the bot\n\n```bash\nnpm start\n```\n\nThat's it! The bot will start logging activity to your terminal and to a file called `bot.log`.\n\n---\n\n## ⚙️ Configuration Guide\n\nYour `.env` file controls everything. Here's what each setting means, explained in plain English.\n\n### 🔑 Essential Settings (Required)\n\nThese **must** be filled in or the bot won't start:\n\n| Setting | What to put here |\n|---------|-----------------|\n| `PRIVATE_KEY` | The private key of your dedicated trading wallet. Looks like a long string of letters and numbers. Keep this secret! |\n| `PROXY_WALLET` | Your Polymarket proxy wallet address. Find this in your Polymarket account settings. Starts with `0x`. |\n| `POLYGON_RPC` | Your RPC URL from Alchemy or Infura. Looks like `https:\u002F\u002Fpolygon-mainnet.g.alchemy.com\u002Fv2\u002Fyour-key-here`. |\n\n---\n\n### 📈 Main Arb Bot Settings\n\nThese control how aggressively the bot trades. **Start with conservative (smaller) values.**\n\n| Setting | What it does | Beginner tip |\n|---------|-------------|--------------|\n| `MAX_SPEND_PER_MARKET` | Maximum USDC to spend in one 5-minute market | Start with `5` (=$5) |\n| `TARGET_EDGE` | Minimum profit margin before the bot buys. `0.02` means it needs at least 2 cents per dollar of edge. | Higher = safer, fewer trades |\n| `MERGE_THRESHOLD_USDC` | Minimum matched pair size before merging back to USDC | Leave at default to start |\n| `MAX_TAKER_FILL_USDC` | Max size for a single buy order | Keep this small at first |\n| `MAX_INVENTORY_IMBALANCE_USDC` | Stops the bot if one side gets too much larger than the other | Safety guardrail — leave it |\n| `COMBINED_ASK_STOP` | Hard stop if the market price becomes unfavorable | Safety guardrail — leave it |\n| `MAX_LOSS_PER_HOUR_USDC` | The bot stops if it loses this much in an hour | Set this to a number you're comfortable losing |\n| `LADDER_LEVELS` | List of price points to post orders at on each side | Leave at default to start |\n| `LADDER_SIZE_PER_LEVEL_USDC` | How much to put at each price level | Start small (e.g. `1`) |\n\n---\n\n### 👛 API Credentials (Optional — Auto-Generated)\n\n```\nPOLY_API_KEY=\nPOLY_API_SECRET=\nPOLY_API_PASSPHRASE=\n```\n\n**Leave these blank on your first run.** The bot will automatically generate them from your wallet. Only fill these in if you've been given credentials directly from Polymarket.\n\n---\n\n### 🔁 Copy Trading Settings\n\nIf you want to follow another trader instead of running the arb bot, use these settings.\n\n#### Simple Copy Watcher (runs alongside the main bot)\n\n| Setting | What it does |\n|---------|-------------|\n| `TARGET_WALLET` | The Polymarket wallet address you want to mirror |\n| `COPY_TRADE_BUY_PERCENT` | What percentage of their trade size to copy. `50` means you spend 50% of what they spend. |\n| `COPY_TRADE_POLL_MS` | How often (in milliseconds) to check for new trades. `5000` = every 5 seconds. |\n\n#### Dedicated Copy Trader (standalone mode)\n\n| Setting | What it does | Example |\n|---------|-------------|---------|\n| `COPY_TARGETS` | Comma-separated wallet addresses to follow | `0xabc...,0xdef...` |\n| `COPY_SIZE_MODE` | How to size your copy trades | `FIXED` (easiest for beginners) |\n| `COPY_FIXED_USDC` | If using FIXED mode, how much to spend per copied trade | `2` |\n| `COPY_MAX_USDC_PER_TRADE` | Hard cap per single trade | `5` |\n| `COPY_MAX_USDC_PER_HOUR` | Maximum spend in any one hour | `20` |\n| `COPY_MAX_USDC_TOTAL` | Total session spending limit | `50` |\n| `COPY_MAX_SLIPPAGE` | Maximum price difference allowed vs. target's fill price | `0.05` = 5% |\n| `COPY_STALE_MS` | Ignore trades older than this (milliseconds). Prevents copying old signals. | `10000` |\n| `COPY_DRY_RUN` | **Practice mode** — logs what it would do without spending real money | Set to `true` first! |\n\n---\n\n## ▶️ Running the Bot\n\n### Option A: Main Arb Bot\n\n```bash\nnpm start\n```\n\nOr alternatively:\n```bash\nnpm run arb\n```\n\n### Option B: Arb Bot + Wallet Mirroring\n\nSet `TARGET_WALLET` in your `.env`, then run the same command:\n```bash\nnpm start\n```\n\nThe bot will mirror future buys from that wallet while also running its own arb logic.\n\n### Option C: Dedicated Copy Trader Only\n\n```bash\nnode src\u002Fcopy\u002Findex.js\n```\n\n> 💡 **Always test copy trading with `COPY_DRY_RUN=true` first** until you're confident it's working the way you expect.\n\n### Development Mode (auto-restarts on file changes)\n\n```bash\nnpm run dev\n```\n\n---\n\n## 📁 Project Structure (What Each File Does)\n\n```\n.\n├── .env.example          ← Template for your settings — copy this to .env\n├── package.json          ← Project metadata and scripts\n├── img\u002F                  ← Screenshots used in this README\n└── src\u002F\n    ├── index.js          ← Main entry point — starts everything up\n    ├── trader.js         ← Core arb logic (ladder posting, order management)\n    ├── market.js         ← Finds and tracks Polymarket markets\n    ├── clob.js           ← Handles communication with Polymarket's order book\n    ├── onchain.js        ← Blockchain interactions (approvals, merges, redeems)\n    ├── copy-trader.js    ← Integrated wallet-mirroring module\n    ├── pnl.js            ← Profit\u002Floss tracking\n    ├── logger.js         ← Logging setup\n    └── copy\u002F\n        ├── index.js          ← Entry point for standalone copy trader\n        ├── activityFeed.js   ← Watches target wallet for new trades\n        ├── copyTrader.js     ← Copy trade execution and risk checks\n        └── config.js         ← Copy trader configuration loader\n```\n\n---\n\n## 📋 Reading the Logs\n\nThe bot outputs two streams of logs:\n\n- **Terminal (console):** Color-coded logs so you can watch activity live\n- **`bot.log` file:** Full JSON logs saved to disk for review later\n\nUse `bot.log` to investigate any issues after a session — it contains full error details, order IDs, and timing info.\n\n---\n\n## 🔧 Troubleshooting\n\n### ❌ \"Bot exits immediately with a missing env var error\"\n\nYour `.env` file is missing required fields. Open it and double-check that these are filled in (not blank):\n- `PRIVATE_KEY`\n- `PROXY_WALLET`\n- `COPY_TARGETS` (if using copy trading)\n\n### ❌ \"Orders fail or bot can't authenticate\"\n\n- Make sure `PRIVATE_KEY` matches the wallet connected to your Polymarket account\n- Make sure `PROXY_WALLET` is the correct proxy address for that account (not your main wallet address)\n- Try using a private RPC endpoint (Alchemy\u002FInfura) instead of the default public one\n- Leave `POLY_API_*` fields **blank** — the bot will auto-generate them\n\n### ❌ \"Copy trades are not firing\"\n\n- Check that target wallet addresses are **all lowercase** in your settings\n- The target wallet must be placing **new buy orders** — the bot ignores sells and old fills\n- Check that your spend caps (`COPY_MAX_USDC_PER_TRADE`, etc.) aren't set to zero or too low\n- Make sure `COPY_DRY_RUN` is set to `false` if you want real orders\n\n### ❌ \"Merge or redeem transactions fail\"\n\n- Make sure you have enough MATIC for gas fees\n- The market must be **fully resolved** before you can redeem winnings\n- Check `bot.log` for the full error message — it will tell you what went wrong specifically\n\n---\n\n## ✅ Recommended First-Run Checklist\n\nFollow these steps your very first time:\n\n- [ ] Created a **separate, dedicated wallet** for the bot\n- [ ] Added a **small amount of USDC** on Polygon (start with $10–$20)\n- [ ] Added a **small amount of MATIC** for gas (a few dollars is enough)\n- [ ] Filled in `.env` with real wallet details\n- [ ] Set a **private RPC endpoint** (Alchemy or Infura free tier)\n- [ ] Set `MAX_SPEND_PER_MARKET` to a small value (e.g. `5`)\n- [ ] Set `MAX_LOSS_PER_HOUR_USDC` to a number you're comfortable losing\n- [ ] If testing copy trading: set `COPY_DRY_RUN=true` first\n- [ ] Ran the bot and reviewed `bot.log` after a session\n- [ ] Only scaled up after confirming everything works as expected\n\n---\n\n## 📚 Glossary (New to Crypto?)\n\n| Term | What it means |\n|------|--------------|\n| **Polygon** | A fast, low-fee blockchain where Polymarket runs |\n| **USDC** | A stablecoin worth $1 USD, used for all Polymarket trades |\n| **MATIC** | Polygon's native token, used to pay gas fees |\n| **Private key** | A secret code that proves you own your wallet. Never share it. |\n| **Proxy wallet** | A Polymarket-specific wallet that the platform uses on your behalf |\n| **RPC endpoint** | A URL that lets software communicate with the blockchain |\n| **Gas fee** | A small fee (in MATIC) paid to the Polygon network for every transaction |\n| **CLOB** | Central Limit Order Book — Polymarket's order matching system |\n| **Arb \u002F Arbitrage** | Profiting from price differences in a market |\n| **Taker order** | An order that buys immediately at the best available price |\n| **Merge** | Combining matched Up+Down pairs back into USDC |\n| **Redeem** | Claiming your USDC payout after a market resolves |\n| **Resolution** | When a market closes and the winning outcome is determined |\n\n---\n\n## ⚖️ Disclaimer\n\nThis software is provided for research and use by experienced traders. It is **not financial advice** and does not guarantee profit. Real-money trading involves market risk, execution risk, smart contract risk, and operational risk. You are fully responsible for how you configure and use this software.\n\n---\n\n*Built for Polymarket on Polygon. Not affiliated with Polymarket.*\n","这是一个用于Polymarket平台的自动化交易机器人，支持比特币涨跌预测市场的自动交易及跟单功能。项目使用JavaScript编写，核心功能包括监控并利用市场中比特币涨跌代币的价格差进行套利交易，以及通过复制指定钱包的交易来实现跟单操作。该机器人适用于希望在短时间内执行高频交易策略或跟随成功交易者的用户。需要注意的是，由于涉及真实资金交易，新手应从少量资金开始，并确保理解相关风险。",2,"2026-06-01 02:47:34","CREATED_QUERY"]