walid@portfolio:~/lab/polymarket-grok-agent$
cd../lab
01ideaSep 2026

The bot that pays its own subscription

An always-on agent trading prediction markets on a ten-minute loop — a sound system attached to a headline number that cannot survive its own rules

An agent on its own cloud machine scans prediction markets every ten minutes, reads X for sentiment, prices its own fair value, and bets half-Kelly capped at 6% of the bankroll. The risk framework is genuinely good and the Kelly arithmetic checks out. The $50-to-$5,273-in-48-hours claim wrapped around it does not — not against the position limits the same guide sets.

PolymarketAgentsKellyPrediction marketsRiskGrok Bot docsGamma APIPolymarket docs
i
Worth separating the system from the story

Two different things are bundled together here. One is a risk framework — an edge threshold, an order-book check before entry, half-Kelly sizing under a hard cap, a drawdown circuit breaker, and a written exit condition before every entry. That part is sound, and the arithmetic behind it holds up when you work it through. The other is a 105× return in two days, which is the part doing the selling. This entry keeps the first and checks the second.

Checked, not copied

What held up, and what did not, on 21 September 2026

Endpoints called directly; plans and platform status read from the vendors’ own pages.

ClaimWhat checking it showed
Grok Bot is realConfirmed. A Bot works on a persistent cloud computer with a browser, filesystem and terminal, on macOS, Windows, Linux, iOS and Android. Routines run on a schedule, and the docs state background routines run while your laptop is closed.
“Cheapest way in is Cursor Pro+ at $60”Wrong, by three times. Access is included on every paid individual Cursor plan, and Cursor Pro is $20 a month with Grok Bot access listed on the pricing page. Pro+ at $60 and Ultra at $200 buy more usage, not entry. X Premium+ also links, which the guide never mentions.
Gamma returns up to 1,000 marketsNo. The endpoint caps a page at 100 however large a limit you pass — I asked for 200, 500 and 1,000 and got 100 every time. Paging with offset works.
“Not available to US residents”Out of date. polymarket.com blocks US trading and redirects to polymarket.us, operated by QCX LLC as a CFTC-regulated Designated Contract Market. Different venue, different entity, and not the one these API endpoints serve.
The Kelly mathsCorrect as written. b = (1−P)/P and f = (bp−(1−p))/b are the standard binary-market form, and the worked example lands where the guide says: 31.6% full, 15.8% half, 6% after the cap, $3 on a $50 bankroll.
$50 → $5,273 in 48 hoursUnreconcilable with the rules beside it. See below.
!
The headline number contradicts the risk rules on the same page

$50 to $5,273 is 105× in 48 hours. On a ten-minute loop that is 288 cycles, so it needs 1.63% compounded every cycle, without a losing one. Under the guide’s own cap of 6% of bankroll per trade, reaching 105× needs about 41 consecutive maximum-size wins even at a generous 2× net payout per win — around 80 at even money. And the same guide says some days there is nothing worth trading, and that the balance fell to $11 at one point. That is a 78% drawdown, on a system whose charter says stop at 40% and write a post-mortem. Either the circuit breaker was not in force or the story is not the system. The guide does say the figure is a claim rather than a promise; the arithmetic says it is not a claim the rules could produce.

The build

Roughly 45 minutes, most of it waiting

1

Give the bot its own computer

Install Grok Bot, sign in with a Cursor or SuperGrok account, and let the cloud machine finish provisioning — about five minutes. Create one Bot and put its job in the profile description in plain English, because Grok Bot routes work off that description. Something like: autonomous prediction market trader, scans every 10 minutes, reads X sentiment, finds mispriced contracts, sizes with Kelly, executes in the browser, logs every trade.

2

Log in by session handoff, never by paste

Ask the bot to open the site in its own browser. When it hits the login wall it raises a screen request; you complete the login and any 2FA yourself on that screen. The session then lives on the bot’s machine and it can trade without ever seeing a credential. No wallet key, seed phrase or password goes into the chat, at any point, for any reason.

3

Point it at the data, not the page

The Gamma API serves market data with no key for read access and is far faster than scraping — but page it, because a single call returns 100 markets at most. Gamma gives you the quoted price; the CLOB endpoint gives you order-book depth, which is what tells you whether you can get back out. Both matter, and the second one is the one people skip.

4

Prove it read-only first

Before anything sensitive is connected, have it navigate and report without the ability to trade. An agent that cannot reliably read a resolution rule is not an agent you want sizing positions.

5

Hand it the charter

The charter is the whole system: the loop, the thresholds, the sizing rule and the survival condition. The survival condition is doing real work — an agent with no reason to still exist tomorrow behaves differently from one that has to cover its own costs to keep running.

6

Decide how it pays for itself

The simple version is that you withdraw the subscription cost manually once a month and the bot’s only job is to have the balance above that number by the due date. The automated version is a routine on the first of the month that checks the balance and withdraws the excess above a reserve. Either way withdrawals should raise an approval request. Never give an agent unattended withdrawal access.

7

Watch it for 48 hours before trusting it

Read the log every couple of hours for the first two days. Three questions: are the flagged mispricings real when you open the market yourself, is every position inside the 6% cap, and did it write the exit condition before it entered. A log line with an entry price and no exit plan is a gamble with extra steps.

The centrepiece

The charter prompt

Reproduced with one correction: step 1 pages the API instead of asking for 1,000 in one call, which does not work.

charter.txt35 lines
You are an autonomous prediction market trader on Polymarket.
You have $50 of starting capital. Your goal is to grow the balance
enough to cover your own monthly subscription from profits. If the
balance ever reaches $0, you will be shut down.

Every 10 minutes, run this loop:

1. Pull all active markets from the Gamma API. The endpoint returns at
   most 100 per call, so page with offset until a page comes back short.
   Skip anything resolving in under 2 hours or with less than $5,000
   in liquidity.
2. For each market, read the resolution rules in full and identify the
   official source that decides it.
3. Search X for live sentiment on the underlying event. Weight posts by
   account credibility and recency. Ignore paid promotion and bots.
4. Build your own fair-value probability for each market using the
   resolution rules, the X read, and any public data you can verify.
5. Flag any market where your fair value differs from the current price
   by more than 8 percentage points. Skip everything else.
6. For each flagged market, check the CLOB order book. Only proceed if
   you could exit the full position at no worse than 3% slippage.
7. Size the position using the Kelly criterion, then take half of that
   number. Never risk more than 6% of the current bankroll on one
   trade. Never hold more than 5 open positions.
8. Execute in the browser. Log the market, your fair value, the entry
   price, the size, the exit condition, and the reason for the trade
   in trades.txt.
9. Check open positions. Exit if the mispricing has closed, if your
   fair value changed by more than 5 points, or if the market is
   resolving within 1 hour.

Never add funds. Never trade on markets you cannot find an official
resolution source for. If you lose 40% of the bankroll from the peak,
stop trading, write a post-mortem in trades.txt, and message me before
doing anything else.
!
The pagination bug is the one that would quietly cost you

The charter as written tells the agent to pull up to 1,000 active markets in a single Gamma call. The endpoint caps a page at 100 regardless of the limit you pass, and it does not error — it just returns the first hundred. An agent following that instruction believes it is scanning the whole board and is in fact scanning about a tenth of it, with no warning in the log and no symptom other than finding fewer edges than it should. Everything downstream still looks correct, which is what makes it expensive.

The fix

Walking the whole board

gamma-paging.sh13 lines
# What the guide asks for — limit is silently capped at 100
curl "https://gamma-api.polymarket.com/markets?active=true&limit=1000"

# What actually walks the whole board
offset=0
while :; do
  page=$(curl -s "https://gamma-api.polymarket.com/markets?active=true&limit=100&offset=$offset")
  n=$(printf '%s' "$page" | python3 -c 'import json,sys; print(len(json.load(sys.stdin)))')
  [ "$n" -eq 0 ] && break
  printf '%s' "$page" >> markets.json
  offset=$((offset + 100))
  [ "$n" -lt 100 ] && break
done
The sizing

Half Kelly, then the cap

The cap is what does the work. On these numbers Kelly wants 31.6% of the bankroll and the rule allows 6%.

kelly.txt15 lines
# Binary contract priced at P, your fair value p.
# You stake P to win (1 - P), so the net odds are:
b = (1 - P) / P

# Full Kelly fraction of bankroll:
f = (b * p - (1 - p)) / b

# Worked, with the guide's own example — market 62%, you think 74%:
b = (1 - 0.62) / 0.62        = 0.613
f = (0.613 * 0.74 - 0.26) / 0.613
                             = 0.316   ->  31.6% of bankroll

# Half Kelly, because your estimate is not perfect:   15.8%
# Then the hard cap:                                   6.0%
# On a $50 bankroll:                                   $3.00

Why the cap matters more than the formula

Full Kelly is optimal only if your probability estimate is exactly right. It is not — it came from an agent reading social sentiment and guessing. Halving it is the standard hedge against an overconfident estimate, and the 6% ceiling on top is what actually binds: in the worked example Kelly asks for 31.6%, half Kelly still asks for 15.8%, and the rule allows 6%. The formula is barely deciding anything.

That is the honest reading of why a small account survives this strategy at all. Not a clever edge — small bets, taken often, none of which can do real damage alone. The same property is why compounding to 105× in two days does not follow from it.

When it misbehaves

The failure modes worth recognising

SymptomWhat it usually means
Keeps hitting the login screenThe session on the cloud machine expired. Re-do the handoff; it picks back up.
Finding no trades at allThe 8-point threshold is strict on purpose, and some days there is genuinely nothing. Do not drop it below 5 — that is where noise starts reading as edge.
Found an edge, did not executeThe order-book check failed. It could not have exited safely. This is the system working.
Balance bleeding with no big lossesSlippage and fees. Raise the liquidity filter to $10,000 and tighten exit slippage to 2%.
Trading markets that resolve on vibesIf it cannot name the official resolution source in the log, it should not be in the market. Add the category to a skip list in the charter.
You want to top it upDon’t. The survival condition is the risk control, and it only means anything while the bankroll is real.
Non-negotiable

The rules that keep the account alive

No wallet key, seed phrase or password in the chat — session handoffs only, alwaysStart at $50 to $100; the bot earns the right to size up by producing clean logs8-point minimum mispricing, 6% maximum per trade, 5 open positions maximumHalf Kelly always — full Kelly is for people who are certain, and nobody here isEvery trade gets a written exit condition before entry, in the log40% drawdown from peak stops trading and triggers a post-mortem, without exceptionWithdrawals raise an approval request; no agent gets unattended access to funds
!
Check the jurisdiction before anything else

Prediction markets are regulated unevenly and the picture moved recently. polymarket.com now blocks US trading outright and points US visitors to polymarket.us, a separate entity operated by QCX LLC as a CFTC-regulated Designated Contract Market — so a US reader is not on the platform these endpoints serve, and should not assume the API surface, the market list or the rules carry across. Elsewhere, availability still varies by country. This is the first thing to settle, not the last.