[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80293":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":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":13,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":13,"starSnapshotCount":13,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},80293,"Polymarket-Automated-Trading-Bot","Ronesfe\u002FPolymarket-Automated-Trading-Bot","Ronesfe","Automated trading bot for Polymarket prediction markets. Supports 4 strategies, optional AI integration, and full risk management.","",null,"TypeScript",10,0,77,1,false,"main",true,[20,21,22,23,24,25,26,27,28,29],"arbitrage-bot","btc-updown","crypto-trading","market-data","polymarket","polymarket-bot","polymarket-btc-5min-arbitrage-bot","polymarket-btc-arbitrage-bot","trading-bot","wallet-trading","2026-06-12 02:04:00","# Polymarket Trading Bot\n\nAutomated trading bot for Polymarket prediction markets. Supports 4 strategies, optional AI integration, and full risk management.\n\n## Strategies\n\n### 1. Market Making (`STRATEGY=market-maker`)\nPlaces two-sided bid\u002Fask quotes around a computed fair value. Profits from the spread when both sides fill. Optionally uses AI (Claude\u002FGPT) to tilt the midpoint based on event analysis.\n\n### 2. Momentum (`STRATEGY=momentum`)\nTracks price over a rolling window. When price moves sharply in one direction (news, event catalyst), enters in the same direction and rides the trend. Exits on take-profit or stop-loss. Works best on markets with breaking news flow.\n\n### 3. Mean Reversion (`STRATEGY=mean-reversion`)\nMaintains an EMA of price and a rolling standard deviation. When price deviates beyond N standard deviations from the EMA, bets on reversion back to the mean. Exits when price returns within a tighter band. Works best on stable-consensus markets with no new information.\n\n### 4. Copy Trading (`STRATEGY=copy-trade`)\nMonitors one or more target wallets (from the Polymarket leaderboard or anywhere) via the public Data API. When a target makes a trade, replicates it with configurable sizing and delay. No market scanning needed — just follows the targets.\n\n\n\n![img](https:\u002F\u002Fi.imgur.com\u002Fns2FIS6.png)\n\n\n\n## Architecture\n\n```\nsrc\u002F\n├── index.ts                    # Entry point\n├── setup.ts                    # Credential derivation & connectivity test\n├── config\u002Findex.ts             # Config loader (all strategies)\n├── types\u002Findex.ts              # Full type definitions\n├── ai\u002F\n│   ├── anthropic.ts            # Claude API\n│   ├── openai.ts               # GPT API\n│   └── router.ts               # Provider selection (supports \"none\" mode)\n├── strategies\u002F\n│   ├── market-maker.ts         # Spread quoting with layered orders\n│   ├── momentum.ts             # Trend-following with entry\u002Fexit signals\n│   ├── mean-reversion.ts       # EMA + z-score based fade strategy\n│   ├── copy-trader.ts          # Wallet monitoring + trade replication\n│   └── scanner.ts              # Market discovery & ranking\n├── services\u002F\n│   ├── polymarket.ts           # CLOB client wrapper\n│   ├── risk.ts                 # Exposure, PnL, drawdown tracking\n│   └── bot.ts                  # Orchestrator (routes to active strategy)\n└── utils\u002F\n    ├── logger.ts\n    └── helpers.ts\n```\n\n## Setup\n\n```bash\nnpm install\ncp .env.example .env\n# Edit .env: set PRIVATE_KEY, FUNDER_ADDRESS, STRATEGY, and strategy-specific params\n\n# Test connectivity (derives CLOB API creds)\nnpm run setup\n\n# Run\nnpm run dev\n```\n\n### AI is optional\nSet `AI_PROVIDER=none` (the default) to run any strategy without AI. The market maker will use pure order-book-derived midpoints. Momentum and mean reversion don't use AI at all. Copy trading doesn't use AI at all.\n\nIf you want AI-assisted market making, set `AI_PROVIDER=anthropic` or `openai` or `fallback` and provide the corresponding API key.\n\n## Copy Trading Setup\n\n1. Find wallet addresses on the [Polymarket leaderboard](https:\u002F\u002Fpolymarket.com\u002Fleaderboard)\n2. Set them in `.env`:\n   ```\n   STRATEGY=copy-trade\n   COPY_TARGETS=0xabc123...,0xdef456...\n   COPY_SIZE_MULTIPLIER=0.5\n   COPY_MAX_SIZE_USD=25\n   ```\n3. The bot polls the Data API every `COPY_POLL_INTERVAL_SEC` seconds for new trades from those wallets\n4. First poll marks existing trades — it won't retroactively copy the target's history\n\n## Key Config\n\n| Parameter | Default | Strategies | Description |\n|-----------|---------|-----------|-------------|\n| `STRATEGY` | market-maker | all | Which strategy to run |\n| `AI_PROVIDER` | none | market-maker | `none`, `anthropic`, `openai`, `fallback` |\n| `SPREAD` | 0.02 | market-maker | Bid-ask spread width |\n| `ORDER_SIZE` | 10 | all | USDC per order |\n| `MOMENTUM_THRESHOLD` | 0.03 | momentum | Min price move to trigger |\n| `MEAN_REVERSION_BAND` | 1.5 | mean-reversion | Z-score entry threshold |\n| `COPY_TARGETS` | (empty) | copy-trade | Comma-separated wallet addresses |\n| `COPY_SIZE_MULTIPLIER` | 0.5 | copy-trade | Your size relative to target |\n| `MAX_DRAWDOWN` | 200 | all | USDC loss before full shutdown |\n\n## Risk Management\n\nApplies to all strategies:\n- Per-market loss cap → stops quoting that market\n- Total drawdown cap → cancels everything, pauses\n- Exposure cap → no new orders\n- Inventory skew → tilts quotes to offload (market-maker only)\n\n## Warnings\n\n- **Real money.** Start with tiny sizes ($1-2) and low exposure caps.\n- Market making in prediction markets is risky — markets can resolve 0 or 1 and wipe your inventory.\n- Copy trading adds latency — the target gets better prices than you.\n- The bot requires token allowances set on Polygon for the CTF Exchange before placing orders.\n- Polymarket cancels all open orders when your session goes inactive — the bot must run continuously.\n","这是一个为Polymarket预测市场设计的自动化交易机器人，支持四种策略、可选的人工智能集成以及全面的风险管理。核心功能包括市场制造、动量追踪、均值回归和跟单交易，每种策略针对不同的市场条件进行了优化。技术上，该项目使用TypeScript编写，并通过模块化的设计将不同策略与服务分离，便于扩展与维护。此外，项目提供了一个简单的配置流程，用户可以根据需要启用或禁用AI辅助决策。适合希望在Polymarket平台上实现自动交易、提高效率并控制风险的个人投资者或团队使用。",2,"2026-06-11 04:00:12","CREATED_QUERY"]