explaingit

alpha-vector-core/polymarket-trading-bot

Analysis updated 2026-05-18

79TypeScriptAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

An automated bot that trades real crypto on short-term Bitcoin, Ethereum, Solana, and XRP price bets on Polymarket.

Mindmap

mindmap
  root((Polymarket Bot))
    What it does
      Trades crypto bets
      Uses real funds
      Polls prices every second
    Tech stack
      TypeScript
      Node.js
      Polygon
    Strategies
      Exit only mode
      Entry and exit mode
      Emergency swap
    Setup needs
      Wallet private key
      USDC on Polygon
      Config file
    Audience
      Developers
      Crypto traders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automate short-term crypto up or down bets on Polymarket without watching prices manually.

USE CASE 2

Run a rules-based strategy that enters and exits fast prediction market trades.

USE CASE 3

Trade with a bot that reads live on-chain wallet balances after every trade.

What is it built with?

TypeScriptNode.jsPolygon

How does it compare?

alpha-vector-core/polymarket-trading-botalpha-vector-core/polymarket-arbitrage-trading-botjapp-fi/polymarket-mcp-server
Stars797979
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity4/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Node.js 20+ and USDC in a Polygon wallet.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Polymarket is a prediction market where traders take positions on whether crypto assets like Bitcoin or Ethereum will finish higher or lower over a set time window. This TypeScript repository is an open-source starter for automating those trades using Polymarket's central limit order book and real on-chain balances. The bot reads a configuration file called trade.toml, connects to the Polygon blockchain, and polls live bid and ask prices every second. Orders are submitted as Fill-and-Kill market orders, meaning they execute immediately or cancel with no resting limit orders left in the book. Your actual crypto wallet balance is checked after every trade so the numbers always reflect real on-chain state. Two strategies are included. The first, trade_1, is passive: it only exits an existing position when the market nears its close time or when the price deviates enough from the midpoint. The second, trade_2, runs a full entry and exit cycle. It buys the UP or DOWN side once per window when timing and price conditions match, then sells when the price hits a configured range. After a successful exit, an optional emergency swap can immediately buy the opposite side if the market looks favorable. Configuration is done through environment variables for your private key and wallet address, and through trade.toml for strategy choice, trade size in dollars, coin selection, and time period. Supported coins are Bitcoin, Ethereum, Solana, and XRP across periods from 5 minutes to 24 hours. The five-minute window is currently wired for Bitcoin only. The README suggests starting with one to three dollars per trade until you trust the setup. Running the bot requires Node.js 20 or later and USDC in a Polygon wallet. The repository is licensed under ISC and carries a disclaimer that it is for education and research only, with no guarantee against financial loss.

Copy-paste prompts

Prompt 1
Explain how the trade_1 and trade_2 strategies in this Polymarket bot decide when to buy or sell.
Prompt 2
Help me set up my private key and trade.toml for this Polymarket trading bot on Polygon.
Prompt 3
Walk me through the risks of running this bot with real USDC before I try it.
Prompt 4
Show me how the emergency swap feature works after an exit.

Frequently asked questions

What is polymarket-trading-bot?

An automated bot that trades real crypto on short-term Bitcoin, Ethereum, Solana, and XRP price bets on Polymarket.

What language is polymarket-trading-bot written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Polygon.

What license does polymarket-trading-bot use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is polymarket-trading-bot to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is polymarket-trading-bot for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.