zkdefi · notes

A monitor-only research scaffold for a hashpower-buying strategy

There's a manual strategy worth studying around buying Braiins hashpower and routing it through OCEAN — long enough to recover variance, short enough to react to fee-rate spikes. The market mechanics are quiet, the data is public, the risk shape is unusual. The problem is that whenever you write code to study a trading strategy, the code is one keystroke away from executing it. Most people don't draw the line. They end up with a bot, a position, and a question they meant to study still unanswered.

BraiinsRatchet is a piece of self-discipline. The code is monitor-only by design — it cannot place, modify, or cancel an order. The Braiins integration accepts a watcher-only token. The default strategy emits recommendations and stops. The state machine distinguishes manual_canary research experiments from manual_bid profit-seeking opportunities; both are observations, neither pulls the trigger. All mutable runtime state lives in a SQLite file under data/, with the kind of structured event log that makes "what did the strategy think at 3 a.m. last Tuesday" answerable.

The native macOS control room is the surface for everything. A single command — ./scripts/ratchet app — rebuilds the bundle, replaces any stale window, and opens the fresh app. SwiftUI for the front, Python standard library only for the lifecycle engine. No frameworks, no installer, no daemon hiding in launchd. The terminal commands exist as advanced fallback for when something needs to be debugged from outside the app.

The reason for all of this is what I keep finding the interesting part of strategy research: the conditions under which a strategy stops being viable are usually visible weeks before they become catastrophic, but only if your code is patient enough to just watch and your discipline is strict enough to not intervene. Hashpower markets are noisy. Recommendations from a monitor-only system have a different epistemic weight than recommendations from a system that's actively trading — the former is what you actually wanted to learn from. The latter is mostly an explanation of what your bugs were.

The repo is small (~376 KB at the moment), and intentionally so. The interesting part is the contract: every code path is read-only with respect to the exchange. Every "what if we just" instinct gets caught at the same boundary. That's the research instrument.

What becomes possible: a strategy researcher can be honest about what they would have done without paying for the privilege of having done it.

#bitcoin #mining #strategy-research #macos #swiftui