polymarket-copytrading-bot

skill
Guvenlik Denetimi
Uyari
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 9 GitHub stars
Code Uyari
  • network request — Outbound network request in package-lock.json
  • process.env — Environment variable access in src/config/env.ts
  • network request — Outbound network request in src/services/clob.ts
  • network request — Outbound network request in src/services/gamma.ts
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Comprehensive analytics dashboard for AI coding agents — Cursor, Windsurf, Claude Code, VS Code Copilot, Zed, Antigravity, OpenCode, Command Code

README.md

Polymarket Trading Bot (TypeScript)

A professional, configurable Polymarket trading bot built with TypeScript and the official CLOB client.
This repository is designed for developers who want a production-style starter for a Polymarket bot focused on crypto prediction markets, with clean environment setup, strategy configuration, and extensible trading logic.

This project can also be used as a foundation for a Polymarket copy trading bot workflow by extending the Trade engine and strategy modules.

What This Bot Does

  • Connects to Polymarket CLOB using authenticated API credentials.
  • Selects markets by coin and timeframe (BTC/ETH/SOL/XRP with 5/15/60/240/1440 minutes).
  • Continuously fetches YES/NO prices for market tokens.
  • Runs internal decision logic through the Trade class.
  • Supports strategy and risk controls via config (TOML + environment variables).

Tech Stack

  • Node.js (>= 20.6.0)
  • TypeScript
  • @polymarket/clob-client
  • ethers
  • dotenv
  • zod

Project Structure

  • src/index.ts - Main runtime loop: market selection, client initialization, polling, and strategy execution.
  • src/types.ts - Shared market and type definitions.
  • src/config/ - Config and market slug generation.
  • src/services/ - API and service integration helpers.
  • src/trade/ - Core trading and decision engine.
  • .env.example - Required environment variables.

Requirements

  • Node.js >=20.6.0
  • A funded Polymarket-compatible wallet setup
  • Polymarket private key
  • Proxy wallet address (only when proxy mode is enabled)
    To get started, clone this repository:
git clone https://github.com/YraseUp/polymarket-copytrading-bot.git
cd polymarket-copytrading-bot

Environment Setup

Copy .env.example to .env and fill in your values:

POLYMARKET_PRIVATE_KEY=
PROXY_WALLET_ADDRESS= # needed only if execution.use_proxy_wallet=true

Installation

npm install

Run the Bot

Development mode:

npm run dev

Build and run:

npm run build
npm start

Available Scripts

  • npm run dev - Run the trading bot with tsx.
  • npm run build - Compile TypeScript to dist/.
  • npm start - Run compiled JavaScript from dist/index.js.

How It Works (Runtime Flow)

  1. Loads environment/config values.
  2. Initializes the Polymarket CLOB client and derives API credentials.
  3. Generates a market slug from configured coin + period.
  4. Fetches token IDs for UP/DOWN (YES/NO style) outcomes.
  5. Polls live prices in a loop.
  6. Updates strategy state and calls trade decision logic every second.

Configuration Notes

  • Market coin and period are configurable in your TOML config.
  • Position sizing uses the configured USD trade size.
  • Trader-manageable controls are available in trade.toml:
    • execution.enabled - master kill switch
    • execution.buy_enabled / execution.sell_enabled - allow only buy/sell side
    • execution.buy_price_range / execution.sell_price_range - enforce price windows
    • execution.min_seconds_between_trades - cooldown between order attempts
    • execution.use_proxy_wallet, execution.signature_type, execution.funder_address - wallet/proxy mode control
    • risk.min_trade_usd / risk.max_trade_usd - bounds trade size automatically
  • Strategy behavior is implemented in the Trade class and can be customized for:
    • directional entries/exits
    • threshold-based logic
    • copy-trading style mirroring (custom extension)

Use Cases

  • Build your own Polymarket trading bot
  • Extend into a Polymarket copy trading bot
  • Backtest or paper-trade custom market logic
  • Integrate signal sources and execution rules

Keywords

  • Polymarket trading bot
  • Polymarket bot
  • Polymarket copy trading bot
  • Polymarket TypeScript bot
  • Polymarket automation

Security and Operational Best Practices

  • Never commit .env or private keys.
  • Start with small position sizes.
  • Add logging/alerts before running unattended.
  • Test strategy behavior in safe conditions first.

Disclaimer

This software is for educational and research purposes only.
Trading on Polymarket involves significant financial risk. You are solely responsible for your strategy, execution, compliance, and losses.

Yorumlar (0)

Sonuc bulunamadi