BTC's back at $80k — so I built an autonomous AI trader for crypto up/down markets

Sep 27, 2026

In August 2026, Bitcoin crawled back to $80,000. I'd been away from crypto for a while, but that number kept pulling me back — and this time I didn't just want to watch it. I wanted to build something that could act on it around the clock. The timing felt right: we're deep in the agentic era, where an LLM can do the thinking if you hand it the right guardrails. So I set out to build an autonomous money machine — an AI agent that trades BTC, ETH, and SOL up/down markets on prediction markets, 24/7, without me babysitting it.

This is the story of what I built, and what going from paper to real money taught me.

The idea

Polymarket's crypto up/down markets are the simplest bet in prediction markets: "Will BTC be above $X at 4pm ET?" Resolve "Up" or "Down," collect $1.00 per share if you're right. They roll every 5 minutes, 15 minutes, 4 hours, and daily, across BTC, ETH, and SOL — which means there's always a fresh market, always a price moving, and always a decision to make.

That's also the problem. Prediction markets trade 24/7, and any edge decays the moment you stop watching. I don't want to watch a market 24/7. I want a machine that watches for me, experiments to find an edge, and tells me how it's doing — without me babysitting it. That's the whole product.

The architecture

Three planes, kept strictly apart:

Execution plane (deterministic, boring, audited)
  market data: Polymarket Gamma + CLOB, Binance, Chainlink TWAP
  fill simulator · risk governor · executor · SQLite journal
        ▲
        │  structured proposals only
Decision plane (LLM, sandboxed)
  edge evaluator → order proposer  (OpenRouter / DeepSeek)
        ▲
Ops plane
  health · anomaly · self-review · Telegram digests

The rule that makes it safe: the LLM advises, deterministic code executes. The LLM never holds keys and never places an order. It emits a structured proposal, and the execution plane validates it against a risk governor — position limits, a daily loss cap, and a kill-switch — before anything touches the book. The LLM's freedom is in thinking; only that deterministic layer can spend money.

Paper first

I built the boring parts before anything exciting: adapters for market data (Polymarket Gamma and CLOB, Binance, and Chainlink TWAP), a fill simulator that models fees, slippage, and liquidity, and an append-only decision journal in SQLite that records every signal → decision → fill → outcome → reflection. The journal is the whole point — without an honest log, you can't tell an edge from a lucky month.

Paper trading needs no keys. The simulator fills against the real book, the journal accumulates, and after a few days I had a number to look at. On the VPS, paper printed +$395.76 over ~64.5 hours, driven almost entirely by the arbitrage strategy (+$463.45, profit factor 1.12), with the snipe and LLM paths turned off.

Encouraging. So I built the actual strategies.

The strategies

The first real idea was a split/merge arbitrage: in a two-outcome market, buying "YES" and "NO" should always cost $1.00 — but liquidity isn't symmetric, so sometimes YES + NO is available for less than a dollar, and the pair redeems for a full dollar. That's the classic arb.

I built two ways to play it:

  • Taker arb — cross the spread with fill-or-kill orders on both legs at once.
  • Maker arb — post passive, post-only bids on both sides and merge any filled pair back to $1.00. Slower, but it earns the spread instead of paying it.

On top of that, a two-tier LLM advisor: a fast, cheap model for the quick 5m/15m windows and a slower, deeper model for the 4h and daily ones. Plus a reflection loop — after every resolved trade, the agent writes one short reflection and re-injects it into the next decision, so it learns from its own record.

Going live

Paper is a sandbox. Real money lives on a VPS, 24/7, without me. I stood up the system on a Dublin box (about 19ms from the exchange origin — latency matters when you're crossing thin books), wired it to systemd so it restarts itself (with Herdr on top for visibility), traded through a deposit wallet so the hot path is gasless, and armed it with tight limits: $10 orders, a $5 daily loss cap, two positions max.

That's when paper and live started to disagree.

The paper-to-live gap

The paper numbers and the live numbers told two different stories:

WhatPaper (sim/replay)Live
Maker, 4h/daily+$162.01 optimistic, +$112 to +$162 across realism knobs-$6.51/day, then kill-switched
Taker arb+$463.45 over 64.5h (PF 1.12)≈ -$5.60 on day one
Realized P&L+$395.76 (journal)-$46.74 on-chain (journal read -$2.73)

Three failures, each one a lesson.

The taker arb was structurally broken in live. Fill-or-kill means all-or-nothing on a moving book. Live, one leg would fill and the other wouldn't — a "naked leg." My simulator assumed an order fills when it crosses the price; real FOK orders don't care about my model. The dead legs resolved against me, and the strategy bled out.

The maker looked profitable in replay but lost in live. Replaying ~2.4 days of real order-book snapshots, the passive maker earned +$162.01 (130 merged pairs, 13 naked legs) — and it stayed positive (+$112 to +$162) no matter how I dialed up the pessimism: queue priority, partial fills, marking naked legs to zero. Live, the same strategy lost -$6.51 a day. The gap wasn't a bug I could model away; it was the difference between a simulator and a market.

The journal was lying — and the kill-switch believed it. When I finally reconciled against the blockchain directly, I found the journal had seen only 24 of 245 fills and 23 of 122 redemptions — roughly 90% of on-chain activity was invisible to it. The kill-switch read the journal, so the circuit breaker that was supposed to stop the bleeding watched a screen that showed almost nothing. The bot traded blind. The journal said -$2.73; the chain said -$46.74.

⚠️

That last number is the honest one. The maker is currently kill-switch-halted (zero orders), and it stays that way until live data — not another model — shows a real edge.

What I learned

  • Your simulator is an optimist. A fill model without queue priority and partial fills will flatter every fast-market strategy. Treat every paper number as an upper bound, not a forecast.
  • Reconcile on-chain. The journal is a model of reality, not reality. True P&L is the signed sum of on-chain cash flows — nothing else counts.
  • A kill-switch is only as good as the source it reads. Gate on ground truth, not on the thing the bot itself writes.
  • Adverse selection is the real opponent. On one-sided 5m/15m markets, the pair never completes, so you keep the losing leg. That's a market-selection problem, not a code problem.
  • Measure first, then risk. Re-arm or scale only if live profit factor clears a bar (≥ 1.1) — not because a replay says it should work.
  • The seams paid off. Because the LLM only ever advised, and the executor was a paper/live seam, every bad call was a bounded loss — never a catastrophic one.

The agentic-era lesson is smaller than "AI trades crypto": the hard part isn't teaching an LLM to have an opinion — it's building the boring, auditable machinery around it so that opinion can't do more damage than you've already agreed to lose. The money machine runs. It just, so far, mostly tells me the truth.

Anthony Nguyen · llms.txt