# An AI Agent Rebuilt My 2018 NiceHash Buyer. It Threw Out the Old ROI Math, and It Still Will Not Place a Live Order by Default.

> Source: <https://blakelapierre.substack.com/p/an-ai-agent-rebuilt-my-2018-nicehash>
> Published: 2026-12-05 00:09:27+00:00

**Recommendation:** When handing a rebuild to a coding agent, write the spec first and explicitly forbid porting legacy formulas like the CryptoNight ROI shortcut, then keep live order placement off by default.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

In 2018 I had a buyer bot for NiceHash. It rented hashrate, pointed it at pools I operated, mined coins, sold them, and put the BTC back into orders. The public repo is still there: [github.com/blakelapierre/nicebot](https://github.com/blakelapierre/nicebot). The `master` branch last moved in April 2018. I have not turned that bot back on for this post, and I am not reporting any earnings from it.

On the evening of Nov 21, an AI coding agent started a new branch, `modern-roi-prototype`, and spent about 80 minutes on it: four commits, from 7:18 PM to 8:37 PM PT. First a live scanner experiment, then a written spec, then an implementation of that spec.

This is a story about rebuilding the decision rule, not about running it with real money. It is also a different story from my [trading bot](https://blakelapierre.substack.com/p/debugging-a-4-trading-bot-it-made) and [scanner](https://blakelapierre.substack.com/p/two-ai-trading-scanners-one-said) posts, which were about exchange trading, not about renting hashrate.

## What was wrong with the old math

The spec is in `docs/SPEC.md` on that branch. It is the contract for the new work, and it says not to rewrite `master`.

The old bot talked to NiceHash’s v1 API. It was CryptoNight-only. ROI was a shortcut for that algorithm, not a general formula. The spec writes the old expression down so nobody ports it: it assumed 1 MH/s, a CryptoNight difficulty, and a price already in the old API’s units, and it subtracted the 3% fee from the ratio instead of applying it to cost. One of the old sell venues is gone. The v1 order shape is not the v2 API.
