explaingit

heyfive-dev/polymarket-arbitrage-trading-bot-v2

Analysis updated 2026-05-18

93TypeScriptAudience · developerComplexity · 4/5Setup · hard

TLDR

An automated bot that trades short 15-minute Bitcoin up-or-down prediction markets on Polymarket using a predict-and-hedge strategy.

Mindmap

mindmap
  root((Polymarket bot))
    What it does
      Predicts price direction
      Places hedge order
      Adapts weights over time
    Tech stack
      TypeScript
      Polygon blockchain
      USDC
    Use cases
      Automate 15-min market trades
      Hedge both sides of a bet
      Manually redeem winnings
    Audience
      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

Automatically trade 15-minute Bitcoin up/down markets on Polymarket

USE CASE 2

Hedge both sides of a prediction market bet to reduce risk

USE CASE 3

Adapt a trading strategy over time using recent order book data

What is it built with?

TypeScriptPolygonUSDC

How does it compare?

heyfive-dev/polymarket-arbitrage-trading-bot-v2dataants-ai/cutscripthisorange/artgen
Stars939395
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyhardmoderatemoderate
Complexity4/53/53/5
Audiencedevelopergeneraldeveloper

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

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a funded Polygon wallet with USDC and carries real financial risk even when hedged.

In plain English

This is an automated trading bot for Polymarket, a prediction market platform where users bet on the outcome of real-world events using cryptocurrency. Specifically, it targets 15-minute Up/Down markets, short-duration bets on whether a cryptocurrency price (like Bitcoin) will be higher or lower in 15 minutes. The bot's strategy works in two steps called predict-and-hedge. First, it analyzes the live order book (the list of current buy and sell offers) using a built-in price prediction algorithm to decide whether the price will go up or down. Then it places a "first leg" order on the predicted outcome, followed immediately by a "second leg" hedge order on the opposite outcome at a carefully calculated price. The goal is for the combined cost of both sides to be low enough that whichever outcome wins, the position is still profitable after fees. The prediction algorithm uses momentum, volatility, and trend signals extracted from the real-time price feed, and adapts its weights over time using a technique called online gradient descent, meaning it continuously updates its strategy based on recent performance. The bot requires a Polygon blockchain wallet funded with USDC (a US dollar-pegged cryptocurrency), an API connection to the Polymarket order book, and a connection to the Polygon network. Configuration is done through environment variables. After markets resolve, winning positions must be manually redeemed using separate included scripts, the bot does not redeem automatically. The README explicitly notes this is high-risk: the hedge reduces but does not eliminate losses, and both sides of a trade can fill at worse prices than intended. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
Help me configure this Polymarket bot with my Polygon wallet and USDC funding
Prompt 2
Explain how the predict-and-hedge strategy places its first and second leg orders
Prompt 3
Show me how to manually redeem winning positions after a market resolves
Prompt 4
Walk me through the online gradient descent weighting used in the price predictor

Frequently asked questions

What is polymarket-arbitrage-trading-bot-v2?

An automated bot that trades short 15-minute Bitcoin up-or-down prediction markets on Polymarket using a predict-and-hedge strategy.

What language is polymarket-arbitrage-trading-bot-v2 written in?

Mainly TypeScript. The stack also includes TypeScript, Polygon, USDC.

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

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is polymarket-arbitrage-trading-bot-v2 for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.