Sovereign-Computing.com

Reclaim your digital life. Own your sovereignty.

Illustration of a robot wearing a Bitcoin badge working at a desk of trading charts

I Built an Autonomous Trading Bot in Four Hours for Twenty Bucks. Here’s the Honest Ledger.

My AI agent team shipped a crypto trading bot yesterday. Four hours from green light to a live soak on Binance's testnet. Total model spend: about twenty US dollars.

Let me tell you what actually happened, because the gap between the press release version of "AI agents build software" and the reality is where all the interesting stuff lives.

The setup, briefly

The plan wasn't improvised. I'd spent the previous evening turning a design conversation into a build spec: three isolated containers (one holds the exchange key, one does research, one is a disposable workshop), Freqtrade as the execution engine, and an AI coding team with a fixed review pipeline — a coder writes code, a different model family audits it read-only, a third model gates the merge, and nobody merges their own work. Four containers, it turned out, once I added in a watchdog.

The AI models doing the work were not frontier-flagship models. They were near-frontier open-weight models from DeepSeek and Z.ai, routed through OpenRouter, chosen the way you'd choose a plumber: capability for the task, price per token, nothing shiny for its own sake.

The highs

The highs were quiet ones. The Proxmox host took four Debian containers in eleven minutes. The fork-and-mirror pipeline worked first try. The first AI-generated MR arrived with 62 passing tests and a clean secret scan.

And the moment worth the whole day: my audit agent found that the regime gate — the rule that stops the bot buying altcoins in a bear market — was correctly written but never wired in. Freqtrade needed one flag flipped. Every test passed because the tests tested the helper, not the wiring. The bot would have traded for weeks with the safety brake documented but disconnected. That's exactly the class of failure that human review teams miss at 5 p.m. on a Friday, and it cost me one audit round.

The lows

The lows were a series of small, humbling comedies.

A coder's test suite passed everywhere except the container where the bot actually runs, because upstream Freqtrade had renamed a module, deleted a classmethod, started demanding a user-data directory, and changed its exchange config format — four separate API drifts, each discovered one deploy cycle at a time. I stopped guessing and started introspecting the installed API, then handed the coder verified facts instead of hunches. Converged in one round.

A one-line append to my own credentials file truncated the whole thing to zero bytes mid-write. Restored from the clone vault in ninety seconds, incident report filed, prevention rule recorded. The lesson is old and boring and true: backups you haven't tested restoring from are souvenirs.

And the content filter once mangled an agent's closing report so badly it registered as a failure — while the work itself sat completed in the repo. Verification beats vibes. Always check the artifact, not the status line.

What we uncovered

Three things I'd underline.

Small models are enough when the pipeline is strict. The coders weren't the best models money can rent. They didn't need to be. The review pipeline carried the quality: strict schema, mandatory tests, an auditor from a different model family so writer and reviewer don't share blind spots. Model quality is one term in a product; pipeline quality multiplies it.

The interface between components is where projects die. Not the algorithms. Not the AI. The seams — module renames, config formats, a flag nobody flipped, an IP that's redacted in logs but very real on the wire. Every one of the day's genuine failures was a seam, and every one was caught by testing in the real runtime rather than a clean sandbox.

Sovereignty is a design habit, not a purchase. The exchange key lives in exactly one container. The research container physically cannot read it. The workshop can't reach either. The watchdog's silence is the alarm. None of this is exotic — it's just what happens when you decide blast radius matters before you write line one.

The ledger

Four hours. Twenty dollars. Five repositories, four audit reports, roughly two hundred tests, three merged pull requests, and a bot that is — as of this morning — watching testnet candles with its safety brake actually connected.

The code count, measured from the running containers rather than estimated: about 4,500 lines. Only 2,500 of those are production code — the other 2,000 are the tests that police it, a 0.8:1 test-to-code ratio. And that's net new lines only; the engine underneath is Freqtrade's hundred-thousand-line codebase, because writing your own trading engine is how you end up with a personal accounting of every bug in existence.

The number I like best: roughly 230 audited lines per dollar. Not generated lines — lines that were written, tested, reviewed by a model from a different vendor, and survived an adversarial audit before merging. About four and a half cents per finished line. My hourly rate is considerably higher, which is why the human stayed out of the code path.

It has not made me rich. That was never the Phase 1 goal; the goal was to find out whether the plumbing holds before real money gets near it. A week of soak data will tell me more than any backtest, and if the answer is no, the whole thing cost less than a dinner.

The interesting question isn't whether an AI agent can write a trading bot. Clearly it can, with the right guardrails. The question is whether you'd trust it with the keys — and the answer to that is a design decision, not a model choice. Design accordingly.

Note: I would not call this a profitable success — the bot is still in testing, running on Binance's testnet, and the backtesting win/loss rates are unreviewed. Whether the strategy actually works is a question for the weeks and months ahead.