86% Return? How to Use a Bot to 'Earn Passively' on Polymarket

marsbitPublished on 2025-12-30Last updated on 2025-12-30

Abstract

This article details the development and backtesting of an automated trading bot for the "BTC 15-minute UP/DOWN" market on Polymarket. The author identified market inefficiencies and automated a manual strategy to exploit them. The bot operates in two modes. In manual mode, users can directly place orders. In auto mode, it runs a two-leg cycle: First, it observes the market for a set time after a round begins. If either the "UP" or "DOWN" side drops by a specified percentage (e.g., 15%) within seconds, it triggers "Leg 1" and buys the crashed side. It then waits for "Leg 2," a hedging trade on the opposite side, which is only executed if the sum of the Leg 1 entry price and the opposite ask price meets a target threshold (e.g., ≤ 0.95). Due to a lack of historical market data from Polymarket's API, the author created a custom backtesting system by recording 6 GB of live price snapshots over four days. A conservative backtest with parameters of a 15% crash threshold and a 0.95 sum target showed an 86% ROI, turning $1,000 into $1,869. An aggressive parameter set resulted in a -50% loss, highlighting the critical role of parameter selection. The author acknowledges significant limitations of the backtesting, including its short data period, failure to model order book depth, partial fills, variable network latency, and the market impact of the bot's own orders. Future improvements include rewriting the bot in Rust for performance, running a dedicated node, and deploying on a ...

A few weeks ago, I decided to build my own Polymarket bot. The full version took me a few weeks to complete.

I was willing to invest this effort because there are indeed inefficiencies on Polymarket. Although there are already some bots exploiting these inefficiencies for profit, it's far from enough. The opportunities in this market still far outnumber the bots.

Bot Construction Logic

The bot's logic is based on a strategy I previously executed manually. To improve efficiency, I automated it. This bot runs on the "BTC 15-minute UP/DOWN" market.

The bot runs a real-time monitoring program that can automatically switch to the current BTC 15-minute round, stream the best bid/ask via WebSocket, display a fixed terminal UI, and allow full control via text commands.

In manual mode, you can place orders directly.

buy up / buy down : Buy a specific USD amount.

buyshares up / buyshares down : Purchase an exact number of shares using user-friendly LIMIT + GTC (Good-Til-Cancelled) orders, filled at the current best ask price.

Automatic mode runs a repeating two-leg cycle.

First, it only observes price fluctuations within the first windowMin minutes after each round starts. If either side drops sufficiently fast (a drop of at least movePct within about 3 seconds), it triggers "Leg 1," buying the side that just crashed.

After completing Leg 1, the bot will never buy the same side again. It waits for "Leg 2 (the hedge)" and only triggers it when the following condition is met: leg1EntryPrice + oppositeAsk <= sumTarget.

When this condition is met, it buys the opposite side. After Leg 2 is completed, the cycle ends, and the bot returns to the observation state, waiting for the next crash signal using the same parameters.

If the round changes during the cycle, the bot abandons the open cycle and restarts with the same settings in the next round.

The parameters for automatic mode are set as follows: auto on [sum=0.95] [move=0.15] [windowMin=2]

· shares: The position size used for both legs of the trade.

· sum: The threshold allowed for hedging.

· move (movePct): The crash threshold (e.g., 0.15 = 15%).

· windowMin: The duration from the start of each round during which Leg 1 is allowed to execute.

Backtesting

The bot's logic is simple: wait for a violent price drop, buy the side that just finished dropping, then wait for the price to stabilize and hedge by buying the opposite side, while ensuring: priceUP + priceDOWN < 1.

But this logic needed testing. Does it really work in the long run? More importantly, the bot has many parameters (shares, sum, move percentage, window minutes, etc.). Which parameter set is optimal and maximizes profit?

My first thought was to let the bot run live for a week and observe the results. The problem was that this would take too long and only test one parameter set, while I needed to test many.

My second thought was to backtest using historical data from the Polymarket CLOB API. Unfortunately, for the BTC 15-minute UP/DOWN market, the historical data endpoint kept returning empty datasets. Without historical price ticks, the backtest couldn't detect "a crash within about 3 seconds," couldn't trigger Leg 1, and would yield 0 cycles and 0% ROI regardless of parameters.

After further investigation, I found other users encountered the same issue fetching historical data for certain markets. I tested other markets that did return historical data and concluded that for this specific market, historical data simply isn't retained.

Due to this limitation, the only reliable way to backtest this strategy was to create my own historical dataset by recording the real-time best-ask prices while the bot was running.

The logger writes snapshots to disk containing:

· Timestamp

· Round identifier (round slug)

· Seconds remaining

· UP/DOWN token IDs

· UP/DOWN best ask prices

Subsequently, the "recorded backtest" replays these snapshots and deterministically applies the same automatic logic. This guarantees access to the high-frequency data needed to detect crashes and hedging conditions.

I collected 6 GB of data over 4 days in total. I could have recorded more, but I deemed it sufficient for testing different parameter sets.

I started testing this parameter set:

· Initial balance: $1,000

· 20 shares per trade

· sumTarget = 0.95

· Crash threshold = 15%

· windowMin = 2 minutes

I also applied a constant 0.5% fee and a 2% spread to stay in a conservative scenario.

The backtest showed an ROI of 86%, turning $1,000 into $1,869 in just a few days.

Then I tested a more aggressive parameter set:

· Initial balance: $1,000

· 20 shares per trade

· sumTarget = 0.6

· Crash threshold = 1%

· windowMin = 15 minutes

Result: -50% ROI after 2 days.

This clearly shows that parameter selection is the most critical factor. It can make you a lot of money or lead to significant losses.

Limitations of Backtesting

Even with fees and spreads included, backtesting has its limitations.

· First, it only used a few days of data, which might not be enough for a comprehensive market perspective.

· It relies on recorded best-ask snapshots; in reality, orders might be partially filled or filled at different prices. Furthermore, order book depth and available volume are not modeled.

· Micro-fluctuations below the second level are not captured (data is sampled once per second). The backtest has 1-second timestamps, but a lot can happen between seconds.

· In the backtest, slippage is constant, and variable latency (e.g., 200–1500 ms) or network spikes are not simulated.

· Each leg of the trade is considered "instantly" executed (no order queuing, no pending orders).

· Fees are charged uniformly, whereas in reality fees might depend on: market/token, maker vs. taker, fee tier, or conditions.

To be pessimistic (prudent), I applied a rule: if Leg 2 fails to execute before the market closes, Leg 1 is considered a total loss.

This is deliberately conservative but doesn't always match reality:

· Sometimes Leg 1 can be closed early,

· Sometimes it ends in-the-money (ITM) and wins,

· Sometimes the loss can be partial rather than total.

While losses might be overestimated, this provides a practical "worst-case" scenario.

Most importantly, backtesting cannot simulate the impact of your large orders on the order book or attracting other traders to hunt you. In reality, your orders can:

· Disturb the order book,

· Attract or repel other traders,

· Cause non-linear slippage.

The backtest assumes you are a pure price taker with no influence.

Finally, it does not simulate rate limits, API errors, order rejections, suspensions, timeouts, reconnections, or the bot being busy and missing signals.

Backtesting is extremely valuable for identifying good parameter ranges, but it is not a 100% guarantee, as some real-world effects cannot be modeled.

Infrastructure

I plan to run this bot on a Raspberry Pi to avoid consuming resources on my main machine and maintain 24/7 operation.

But there is still significant room for improvement:

· Using Rust instead of JavaScript would provide far superior performance and processing times.

· Running a dedicated Polygon RPC node would further reduce latency.

· Deploying on a VPS close to Polymarket's servers would also significantly reduce latency.

There are certainly other optimizations I haven't discovered yet. Currently, I am learning Rust as it is becoming an indispensable language in Web3 development.

Related Questions

QWhat is the core strategy used by the Polymarket trading bot described in the article?

AThe bot's core strategy is to wait for a sharp price drop (a 'flash crash') in the BTC 15-minute UP/DOWN market, buy the side that just crashed (Leg 1), and then wait to hedge by buying the opposite side once the combined price of UP and DOWN tokens meets a specific threshold, ensuring that priceUP + priceDOWN < 1.

QWhy couldn't the author perform a backtest using historical data from the Polymarket API?

AThe author couldn't perform a backtest using the Polymarket CLOB API's historical data because, for the specific BTC 15-minute UP/DOWN market, the historical data endpoint consistently returned empty datasets. No historical price ticks were available, which are required to detect the rapid price movements the strategy relies on.

QHow did the author create a dataset to backtest the bot's strategy despite the lack of historical API data?

AThe author created their own historical dataset by running a custom logger alongside the bot. This logger recorded real-time snapshots of the best-ask prices, timestamps, round identifiers, and other market data. These snapshots were then replayed in a 'recorded backtest' to deterministically apply the bot's logic.

QWhat was the result of the backtest using the conservative parameter set (sumTarget=0.95, movePct=15%, windowMin=2)?

AThe backtest using the conservative parameter set (20 shares per trade, sumTarget=0.95, movePct=15%, windowMin=2 minutes) showed a return on investment (ROI) of 86%, turning an initial $1,000 into $1,869 over a few days, even after applying a constant 0.5% fee and 2% spread.

QWhat are some key limitations of the backtesting method mentioned by the author?

AKey limitations include: using only a few days of data; relying on best-ask snapshots without modeling order book depth or partial fills; not capturing sub-second micro-fluctuations; assuming constant slippage and instant order execution; not simulating the market impact of large orders; and not accounting for API errors, network latency, or rate limits.

Related Reads

Near Returns to the AI Stage: Transformation into a Public Chain Due to 'Payroll Difficulties,' Agent and Privacy Emerge as New Growth Narratives

NEAR Returns to AI Origins: From Payroll Struggles to Blockchain, Now Focusing on AI Agents and Privacy NEAR Protocol's journey began not with grand blockchain ambitions, but from a practical hurdle: its AI startup founders, including Transformer paper co-author Illia Polosukhin, couldn't efficiently pay international developers in 2017. This led them to pivot and build a high-performance, scalable blockchain. After years navigating various crypto narratives like sharding and cross-chain interoperability, NEAR is now leveraging its AI roots to re-enter the AI arena. A key driver is its "NEAR Intents" layer, which abstracts complex cross-chain transactions. Users simply state their goal (e.g., swap BTC for ETH), and a solver network finds the optimal route. This system has processed over $20B in cross-chain volume, generating significant fee revenue. A major growth area is private transactions via "Confidential Intents/Swaps," which hide trade details until settlement to protect against MEV and front-running. Remarkably, private swaps recently accounted for over 40% of NEAR's transaction volume, highlighting strong demand but also potential regulatory scrutiny. With its AI-founder pedigree, NEAR is positioning itself at the intersection of blockchain, AI agents, and privacy, aiming to become infrastructure for the emerging agent economy while navigating the challenges of its rapid adoption.

marsbit46m ago

Near Returns to the AI Stage: Transformation into a Public Chain Due to 'Payroll Difficulties,' Agent and Privacy Emerge as New Growth Narratives

marsbit46m ago

From Ethereum to AI's 'CROPS': What Exactly is This Set of 'Slow Variables' That Vitalik Repeatedly Emphasizes?

In recent discussions, Vitalik Buterin has frequently emphasized the concept of "CROPS," a framework defining core values for Ethereum's development. CROPS stands for Censorship Resistance, Capture Resistance, Open Source, Privacy, and Security. Initially outlined in the Ethereum Foundation's "EF Mandate," it represents a commitment to user sovereignty, ensuring that the network resists external control, remains open, protects privacy, and prioritizes security. The relevance of CROPS extends beyond Ethereum's foundational principles, becoming crucial in the context of AI integration. As AI agents begin handling wallet operations and automated transactions, the risk increases that users may cede control over their digital assets, privacy, and intentions to centralized AI service providers. A "CROPS AI" would therefore emphasize local execution where possible, privacy-preserving remote model calls (e.g., using zero-knowledge proofs), and transparent, verifiable processes to maintain user agency. Vitalik highlights a significant convergence between "CROPS Ethereum access layer" and "CROPS AI." Both address the same fundamental challenge: how users can access powerful services—be it blockchain data via RPCs or AI models—without exposing sensitive information or relinquishing ultimate control. This intersection points toward a future digital entry point that is more private, secure, and user-controlled. Ultimately, CROPS is not merely an abstract ideal but a practical guidepost. It steers development—from protocol resilience and wallet design to AI agent safety—towards a future where users retain self-sovereignty even as digital systems grow more complex and powerful. In an era of accelerating AI adoption, these "slow variables" of censorship resistance, openness, privacy, and security may define Ethereum's enduring value.

marsbit57m ago

From Ethereum to AI's 'CROPS': What Exactly is This Set of 'Slow Variables' That Vitalik Repeatedly Emphasizes?

marsbit57m ago

Silicon Valley 'Startup Guru' Steve Hoffman: Web3 + AI Could Be a Trap

Silicon Valley investor and "Godfather of Startups" Steve Hoffman warns that combining Web3 with AI is likely a trap, not a promising venture. In an interview, Hoffman argues that while AI is a foundational technology touching all industries, Web3 adds complexity, friction, and regulatory risk without solving mainstream consumer or business needs. He advises founders to focus on deep, specialized applications where startups can out-iterate giants, rather than on generic features easily replicated by large tech companies. Hoffman observes that Silicon Valley will lead foundational AI research, while China excels at rapid, large-scale application and commercialization, particularly in robotics. He stresses that AI-driven autonomous agents capable of collaborative, multi-step tasks are 2-4 years away, which will cause significant job displacement. The solution is not to slow AI but to redesign business models around human-AI collaboration and reform social systems like education and retraining. For startups, Hoffman recommends focusing on vertical, expertise-heavy domains to build defensibility. He sees major opportunities in AI fraud detection and cybersecurity. Key founder mindsets include systemic thinking over feature-focus, relentless customer centricity, building adaptive teams, and deeply understanding AI's capabilities and limits. Hoffman is also leading a non-profit initiative to establish university centers aimed at training future leaders in responsible, human-value-aligned AI innovation.

marsbit2h ago

Silicon Valley 'Startup Guru' Steve Hoffman: Web3 + AI Could Be a Trap

marsbit2h ago

Token Inefficient, Economy Tokenless

The article "Tokens Aren't Economical, Economics Aren't Tokenized" analyzes a pivotal shift in the AI industry from a technology-driven narrative to one dominated by capital efficiency. It highlights two concurrent trends: a severe capital shortage due to the exorbitant and recurring costs of compute (e.g., OpenAI's high burn rate) and a wave of corporate spin-offs where major tech companies are separating their AI units (like Kuaishou's Kling and Baidu's Kunlunxin). The core argument is that AI's "anti-internet" business model, where user growth increases costs rather than profits, has created a disconnect between high valuations and actual cash flow. Spin-offs address this by allowing AI assets to be valued independently. Within a parent company, they are seen as cost centers, but as standalone entities, they are priced based on their growth potential and scarcity in the primary market, leading to massive valuation premiums (e.g., Kling's estimated value tripling post-spin-off). The industry is at an inflection point, moving from "model worship" to "value realization." The competition is evolving from a pure compute (GPU) race to a broader focus on systemic efficiency and full-stack engineering (involving CPUs and orchestration) to achieve viable commercialization. The year 2026 is framed as a critical moment where the industry must definitively answer how to economically translate AI capability into tangible business value, reshaping the sector's future power structure.

marsbit2h ago

Token Inefficient, Economy Tokenless

marsbit2h ago

Trading

Spot
Futures

Hot Articles

How to Buy SFP

Welcome to HTX.com! We've made purchasing SafePal (SFP) simple and convenient. Follow our step-by-step guide to embark on your crypto journey.Step 1: Create Your HTX AccountUse your email or phone number to sign up for a free account on HTX. Experience a hassle-free registration journey and unlock all features.Get My AccountStep 2: Go to Buy Crypto and Choose Your Payment MethodCredit/Debit Card: Use your Visa or Mastercard to buy SafePal (SFP) instantly.Balance: Use funds from your HTX account balance to trade seamlessly.Third Parties: We've added popular payment methods such as Google Pay and Apple Pay to enhance convenience.P2P: Trade directly with other users on HTX.Over-the-Counter (OTC): We offer tailor-made services and competitive exchange rates for traders.Step 3: Store Your SafePal (SFP)After purchasing your SafePal (SFP), store it in your HTX account. Alternatively, you can send it elsewhere via blockchain transfer or use it to trade other cryptocurrencies.Step 4: Trade SafePal (SFP)Easily trade SafePal (SFP) on HTX's spot market. Simply access your account, select your trading pair, execute your trades, and monitor in real-time. We offer a user-friendly experience for both beginners and seasoned traders.

656 Total ViewsPublished 2026.05.22Updated 2026.06.02

How to Buy SFP

How to Buy CTR

Welcome to HTX.com! We've made purchasing Citrea (CTR) simple and convenient. Follow our step-by-step guide to embark on your crypto journey.Step 1: Create Your HTX AccountUse your email or phone number to sign up for a free account on HTX. Experience a hassle-free registration journey and unlock all features.Get My AccountStep 2: Go to Buy Crypto and Choose Your Payment MethodCredit/Debit Card: Use your Visa or Mastercard to buy Citrea (CTR) instantly.Balance: Use funds from your HTX account balance to trade seamlessly.Third Parties: We've added popular payment methods such as Google Pay and Apple Pay to enhance convenience.P2P: Trade directly with other users on HTX.Over-the-Counter (OTC): We offer tailor-made services and competitive exchange rates for traders.Step 3: Store Your Citrea (CTR)After purchasing your Citrea (CTR), store it in your HTX account. Alternatively, you can send it elsewhere via blockchain transfer or use it to trade other cryptocurrencies.Step 4: Trade Citrea (CTR)Easily trade Citrea (CTR) on HTX's spot market. Simply access your account, select your trading pair, execute your trades, and monitor in real-time. We offer a user-friendly experience for both beginners and seasoned traders.

521 Total ViewsPublished 2026.05.25Updated 2026.06.02

How to Buy CTR

What is USOIL

USOILUSDT Perpetual Contract is the trading symbol for West Texas Intermediate (WTI) Crude Oil priced in US dollars, representing 1 barrel of crude oil.

520 Total ViewsPublished 2026.05.25Updated 2026.05.25

What is USOIL

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of A (A) are presented below.

活动图片