[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92278":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":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},92278,"Polymarket-Arbitrage-Trading-Bot","rolekkona\u002FPolymarket-Arbitrage-Trading-Bot","rolekkona","polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot | | polymarket arbitrage trading Bot","",null,"TypeScript",566,2005,1,0,368,60.91,false,"main",true,[],"2026-07-22 04:02:05","# Polymarket Arbitrage Trading Bot\n\nAn automated prediction market trading bot that operates on Polymarket’s short-duration Up\u002FDown markets using real-time orderbook data and adaptive price prediction.\n\n---\n\n## Overview\n\nThis bot uses an **artificial trading strategy** to trade on Polymarket’s CLOB (Central Limit Order Book). It connects to live orderbook feeds, derives directional signals from price movements, places limit orders, and manages hedges with configurable risk controls.\n\n**Key features:**\n- Real-time WebSocket orderbook integration\n- Adaptive price prediction with confidence scoring\n- Configurable markets, position sizes, and risk limits\n- Graceful shutdown with balance, allowance, and market status checks\n\n---\n\n## Requirements\n\n- **Node.js** 18 or newer\n- **Polygon wallet** funded with USDC\n- **Polygon RPC** endpoint (for approvals and redemptions)\n\n---\n\n## Configuration\n\nCreate a `.env` file in the project root. You can copy from any existing template and configure at least your private key and target markets.\n\n### Core Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `PRIVATE_KEY` | Polygon wallet private key. **Never share this.** |\n| `BOT_MARKETS` | Comma-separated market slugs (e.g. `btc`, `eth`). |\n| `BOT_SHARES_PER_SIDE` | Shares per side per trade. |\n| `BOT_TICK_SIZE` | Price precision (e.g. `0.01`). |\n| `BOT_PRICE_BUFFER` | Optional execution buffer (cents). |\n| `BOT_WAIT_FOR_NEXT_MARKET_START` | Align start with the next 15‑minute boundary. |\n| `BOT_MAX_BUY_COUNTS_PER_SIDE` | Max buys per side per market (`0` = unlimited). |\n| `CHAIN_ID` | EVM chain ID (Polygon mainnet: `137`). |\n| `CLOB_API_URL` | Base URL for the CLOB API. |\n| `RPC_URL` \u002F `RPC_TOKEN` | RPC endpoint for approvals and redemptions. |\n| `BOT_MIN_USDC_BALANCE` | Minimum USDC balance required to start. |\n| `LOG_DIR` \u002F `LOG_FILE_PREFIX` \u002F `LOG_FILE_PATH` | Logging configuration. |\n\n> **Backward compatibility:** The bot still supports the legacy `COPYTRADE_*` variable names. New setups should use the `BOT_*` names above.\n\nAPI credentials are created on first run and stored under `src\u002Fdata\u002F`.\n\n---\n\n## Running the Bot\n\nStart the trading runtime:\n\n```bash\nnpm start\n```\n\nRedeem resolved markets and manage holdings:\n\n```bash\nnpm run redeem\nnpm run redeem:holdings\n```\n\n---\n\n## Development\n\n```bash\nnpx tsc --noEmit\nnpx ts-node src\u002Findex.ts\n```\n\n---\n\n## Architecture\n\nThe runtime is organized into three layers:\n\n### Application Runtime\n- **`src\u002Fapp\u002Frunner.ts`** — Orchestration: config validation, credentials, balance checks, allowance sync, and trading engine startup.\n- **`src\u002Findex.ts`** — Entrypoint that delegates to the runner.\n\n### Infrastructure & Integration\n- **`src\u002Fconfig\u002F`** — Loads `.env` and provides typed configuration.\n- **`src\u002Fproviders\u002F`** — Polymarket CLOB (HTTP\u002FWebSocket) and other external services.\n- **`src\u002Fsecurity\u002F`** — Wallet checks, minimum balance validation, and allowance management.\n- **`src\u002Futils\u002F`** — Balance polling, logging, and redemption helpers.\n- **`src\u002Fdata\u002F`** — Local JSON state and credentials.\n\n### Strategy Engine\n- **`src\u002Forder-builder\u002Ftrading.ts`** — Arbitrage trading strategy: market slug resolution, price prediction, and order placement.\n\n---\n\n## Disclaimer\n\nThis software is experimental. Use at your own risk and only with funds you can afford to lose. Maintainers are not responsible for financial losses, misconfiguration, or downtime.\n","这是一个面向Polymarket预测市场的自动化套利交易机器人，专为短周期Up\u002FDown二元市场设计。它通过WebSocket实时接入CLOB订单簿数据，结合自适应价格趋势预测与置信度评分生成交易信号，支持限价单执行、动态对冲及可配置的风险控制（如头寸规模、最大买卖次数、最低余额校验）。项目基于TypeScript构建，依赖Polygon链USDC资金和RPC接口完成链上操作，适用于熟悉预测市场机制、具备链上钱包管理能力的量化交易实践者进行低延迟跨市场或时序套利。",2,"2026-07-08 04:29:57","CREATED_QUERY"]