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.

Trending Cryptos

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

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

10,000 Scientists Get 1 Year of Free Access: OpenAI Brings the Scientific Research Pipeline into ChatGPT

OpenAI has launched the "ChatGPT for Academic Researchers" program, offering free one-year access to its flagship models for 100,000 university researchers globally, with 10,000 spots available this summer. Selected institutions include prestigious centers like ENS Paris and the IAS at Princeton. The initiative provides an integrated research workspace within ChatGPT, bundling tools like ChatGPT, ChatGPT Work, and Codex, along with expanded Deep Research capabilities, higher usage limits, and specialized tools for life sciences. The suite connects to platforms like Zotero and GitHub, aiming to streamline the entire research workflow from literature review and coding to data analysis and manuscript drafting. OpenAI notes that about 1.3 million people already use ChatGPT weekly for advanced science and math. The program targets building long-term user dependency by embedding these tools into daily research habits. However, access comes with limitations: it does not include API credits or model weights, and eligibility is restricted to verified academic researchers from supported countries. This approach contrasts with Anthropic's "AI for Science" program, which offers API credits but not an integrated workspace. Both companies emphasize preventing misuse by withholding model weights, a point of contention for AI researchers seeking transparency. The core strategy remains clear: provide a powerful, integrated environment to foster user reliance ahead of the post-free period.

marsbit7m ago

10,000 Scientists Get 1 Year of Free Access: OpenAI Brings the Scientific Research Pipeline into ChatGPT

marsbit7m ago

What's Going On with Gigadevice? Major Shareholder Cashes Out 44 Billion, Then Announces 20 Billion Buyback

Gigadevice Innovation, a leading Chinese memory chip company, has executed a controversial financial maneuver. The company's controlling shareholder and chairman, Zhu Yiming, sold approximately 44 billion RMB worth of his shares between early May and mid-June 2026, capitalizing on a soaring stock price that peaked at 846.66 RMB on June 29th. Following a subsequent stock crash—plummeting to around 350 RMB in 22 trading days and erasing over 330 billion RMB in market value—Zhu announced a combined "market rescue" plan on July 29th. This plan includes his personal commitment to buy back at least 1 billion RMB in shares and a company proposal to repurchase 1 to 2 billion RMB worth of stock. This sequence of high-selling followed by a low-buying plan has confused and unsettled many of the company's 240,000 retail investors. The stock's dramatic decline was attributed to several factors: the successful IPO of its sister company, Changxin Technologies, which ended Gigadevice's status as a primary investment proxy for the domestic memory sector; a Morgan Stanley report warning of a potential peak in the memory chip cycle; and a severe loss of market confidence triggered by the chairman's massive sell-off. While the sell-off was procedurally compliant, its timing has been criticized. The company's fundamentals appear strong, with preliminary H1 2026 results showing revenue up 177% year-on-year to 11.5 billion RMB and net profit skyrocketing 1099% to 6.9 billion RMB, driven by a boom in memory chips and MCU demand. However, a significant portion (2.05 billion RMB) of this profit came from non-recurring gains like securities investment, and the memory industry is notoriously cyclical. Analysts highlight the company's role in the domestic substitution of niche DRAM and NOR Flash memory, with some maintaining bullish price targets. Yet, the recent events underscore key risks: its fabless model creates dependency on foundries like Changxin, and the chairman's actions have raised serious questions about management's alignment with minority shareholders. The promised buybacks cannot commence until December 13th due to a mandatory six-month cooling-off period following an insider sale, leaving the stock vulnerable in the interim.

marsbit7m ago

What's Going On with Gigadevice? Major Shareholder Cashes Out 44 Billion, Then Announces 20 Billion Buyback

marsbit7m ago

Pi Network Price Forecast for August 2026: Will the August 11th Deadline Become a Catalyst for PI's Recovery?

Pi Network Price Forecast for August 2026: Will the August 11 Deadline Catalyze a Recovery? Pi Network (PI) traded at $0.0830 on July 30, up 1.13%, attempting to stabilize above its all-time low. The price is rebounding from the lower Bollinger Band around $0.07172. All key EMAs (20, 50, 100, 200-day) remain in a downtrend above the current price, with the 20-day EMA at $0.08810 acting as the first significant resistance level to confirm a recovery. August presents two key narratives. First, the Pi Core Team launched Protocol 26 with a hard deadline of August 11 for all node operators to upgrade; failure to do so results in disconnection. This is the final precursor to Protocol 27, a major technical upgrade planned for 2026. Second, a community debate challenges the widespread "GCV" (Global Consensus Value) concept, with a member stating there is no official GCV mechanism and that Mainnet apps price services independently. This could pressure price if holders selling on disillusionment. The 10-day price forecast table suggests a range of $0.072-$0.095 for early August amid Protocol 26 deadline pressure, $0.080-$0.110 in mid-August post-deadline clarity, and $0.085-$0.125 in late August, pending broader crypto market direction. The bullish case requires smooth Protocol 26 migration, clear Protocol 27 announcement, resolution of the GCV debate without major holder exits, and a close above the 20-day EMA. The bearish scenario involves node upgrade difficulties, GCV-related selling pressure, continued supply pressure from 775.8 million PI scheduled to unlock by December, and a fall back to or below the $0.07172 support zone.

cryptonews.ru32m ago

Pi Network Price Forecast for August 2026: Will the August 11th Deadline Become a Catalyst for PI's Recovery?

cryptonews.ru32m ago

Trading

Spot

Hot Articles

How to Buy DATA

Welcome to HTX.com! We've made purchasing DATA Network (DATA) 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 DATA Network (DATA) 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 DATA Network (DATA)After purchasing your DATA Network (DATA), 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 DATA Network (DATA)Easily trade DATA Network (DATA) 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.

960 Total ViewsPublished 2026.07.01Updated 2026.07.01

How to Buy DATA

What is ANSEM

I. Project IntroductionThe Black Bull ($ANSEM) is a transparent, community-driven memecoin on Solana built around one creed: charge forward no matter what. The project is frontend-first and fully verifiable — its website reads live on-chain and market data directly from Solana, including price, liquidity, volume, market cap, and holder distribution, so anyone can audit the claims with no login and no user-data collection. Beyond the token, it offers an Ansem-call Radar, non-custodial community liquidity Pods on PumpSwap, and a browser-based meme terminal. $ANSEM is a standard Pump.fun SPL token (6 decimals) trading against SOL and USDC.II. Token InformationToken Symbol: ANSEM(The Black Bull)III. Related LinksWebsite:https://www.blackbullsol.com/X: https://x.com/blknoiz06Contract Address: https://solscan.io/token/9cRCn9rGT8V2imeM2BaKs13yhMEais3ruM3rPvTGpumpNote: The project introduction comes from the materials published or provided by the official project team, which is for reference only and does not constitute investment advice. HTX does not take responsibility for any resulting direct or indirect losses.

2.8k Total ViewsPublished 2026.07.01Updated 2026.07.01

What is ANSEM

How to Buy ANSEM

Welcome to HTX.com! We've made purchasing The Black Bull (ANSEM) 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 The Black Bull (ANSEM) 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 The Black Bull (ANSEM)After purchasing your The Black Bull (ANSEM), 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 The Black Bull (ANSEM)Easily trade The Black Bull (ANSEM) 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.

1.0k Total ViewsPublished 2026.07.01Updated 2026.07.01

How to Buy ANSEM

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.

活动图片