Hydre
automated algorithmic trading
It collected its data, calibrated its signals, decided and placed its orders with no human in the loop. Designed, built and run alone, on free public data.
- 785
positions taken with real money
Decided and placed by the system with no human review, from July to late August 2026.
- 12.15
million automated decisions logged
Each with its reason, refusals included: every choice the system made can be audited after the fact.
- 1,004
automated tests
All green before every deployment, including an exact replay of a production incident.
ChapterProblemContents
Problem
Beating a price that already knows a lot
The quoted price already reflects almost all the available information. That is the bar to beat. The question behind the project: can a system built by one person, on data nobody charges for, produce a better-calibrated signal than that price, and act on it alone, with no one reviewing its decisions?
I designed Hydre in February 2026 to answer that end to end: collect, model, calibrate, decide, place orders, monitor. Three independent strategies, each on its own public source. Two of them then ran with real money.
Constraints
No paid data, nobody on call
- No paid data. Public weather forecasts, open APIs, the public trade feed: nothing bought, no quota.
- A sent order cannot be undone. No transaction can put the outside world back the way it was. So the intent was written before sending, never after.
- Third parties I do not control. Data providers, the order interface, the network: any of them could go down, stutter or answer wrong.
- A single operator. Nobody on call to notice a silence. The system had to stop cleanly on its own, and say so.
Architecture
The path of a signal
One asyncio process, three isolated strategies, one shared decision chain. Follow one example.
A public weather forecast departed from the quoted price, with a narrow interval.
Position taken: the intent written, then the order sent on its own.
SourcesWebSocket, aiohttp
A WebSocket trade feed that reconnected on its own after a drop, plus public APIs: no purchased data.
ModelSciPy, NumPy
Outcome models followed an event while it unfolded.
WeatherSciPy
Several public weather models, statistically corrected, gave a probability distribution rather than a single value.
PortfoliosNumPy
Each tracked portfolio got a Bayesian rating that accounted for its uncertainty, not just its past gains.
CalibrateNumPyro, JAX, scikit-learn, venn-abers
One calibration shared by all three strategies, hierarchical Bayesian, then isotonic, then Venn-Abers, returned an interval rather than a point.
Example written for the illustration.
Edge holds?lower bound, net of fees
The system only took a position if its edge still held at the lower bound of the interval, net of fees; a gap that looked too good was refused as a likely model error.
Example written for the illustration.
IntentPostgreSQL, asyncpg
The intent was written to the database before sending: if it could not be written, the order did not leave, and never left twice.
Example written for the illustration.
Orderasyncio
The order left with no human review, then the internal balance was reconciled with the account's real balance.
LogPostgreSQL, Grafana
Every decision, refusals included, was logged with its reason and its factors, so the filters could be checked afterwards.
Example written for the illustration.
Operations
- Supervise Every task was a supervised coroutine, restarted after a crash. A stall detector spotted a loop that had stopped beating.
- Watch from outside A watchdog that imported nothing from the application, run by its own systemd timer, queried the database directly. If it could not look, it raised an alert.
- Credit A gain only counted once it had actually been received, at the amount read on the account, never at a computed amount.
- Deploy Engine under systemd on a Linux VPS; PostgreSQL, Prometheus and Grafana under Docker Compose. No public port, administration over Tailscale.
Decisions
Safeguards born from measurement and outages
| Decision | Option ruled out | What settled it |
|---|---|---|
| One calibration shared by all three strategies | A calibration per strategy | A badly calibrated probability makes every decision wrong, whatever the model. A test blocked any return of local calibration. |
| An interval rather than a point, with Venn-Abers | A single probability; my own implementation | The decision was taken on the lower bound, so uncertainty acted as its own brake. The library I kept gave intervals just as tight, 55 times faster, on the same benchmark. |
| A weather model blind to the price | A calibrator that took the price as input | Target leakage: the model was reading the price it was meant to beat. The calibrator was removed. |
| Automatic pause for a transient outage, a freeze lifted by hand for a real loss | The same freeze for every incident | A provider stuttering for a few seconds froze everything, as if money had been lost. Exits were never blocked. |
| A signed balance difference: a shortfall stops, a surplus waits | One threshold in both directions | The system was shutting itself down because it was winning: a gain not yet received is just a bookkeeping delay. |
| Isolated strategies, checked by import analysis | Independence stated in the documentation | The check reruns with no database, no network and no money committed. It confirms that the three strategies do not depend on one another. |
Results
What the system produced
Every measurement states its dataset: production, out-of-sample test or repository.
Over its whole real-money period, the account ended net positive, after fees. It is a dated fact, read on August 27, 2026 from the account's own tally, and it is stated without an amount. The next chapter says what it does not prove.
The measurements
Gap between stated probability and observed frequency176 resolved decisions, lower is better
Gap between stated probability and observed frequency: 6% (After) vs. 13% (Before), ÷2.2, a gain.
6%vs. 13% (Before)The gap between what the model announces and what happens, from 0% (perfect) to 100%. Lower is better.
Expected calibration error, on an out-of-sample time split. Between before and after, only the calibrator changes: fragile segments are pulled toward the global mean.
176 resolved decisions, lower is better
When the system said seven chances in ten, reality landed on average within six points of the claim, compared with thirteen before the fix.
Better calibration creates no edge: it makes the probabilities honest, it does not make them better than the price.
Probability error (log-loss)lower is better
Probability error (log-loss): 0.782 (After) vs. 2.44 (Before), ÷3.1, a gain.
0.782vs. 2.44 (Before)The cost of misplaced probabilities, from 0 (perfect) upward, with no upper limit. Lower is better.
Measured on data the model had not seen. Before, the probability came from simply counting the ensemble forecast's members; after, from a statistically corrected forecast that yields a probability distribution.
lower is better
A better weather forecast does not prove an edge over the price: the page's finding about the price holds for this strategy too.
- Engineering. In the repository on August 24, 2026: 56,696 lines of Python, 28 PostgreSQL tables and 39 Grafana panels defined as code.
- Independence. The contract that isolates the three strategies holds, over 135 files and 323 dependencies between modules, checked by import analysis.
- Production. Positions read on August 27, 2026 from the account dashboard. Decisions counted in the production database, refusals included.
- Out of sample. Calibration measured on a temporal split, with an embargo between fitting a calibrator and using it. Between before and after, only the calibrator changes.
- The backtest. The market's public history, 41 months and 77,900,000 settled trades, rerun at the exact price of each trade.
- The gate. Four statistical checks: probability of backtest overfitting by combinatorial cross-validation, deflated Sharpe ratio, Romano-Wolf correction, minimum backtest length. Purging, per-event embargo, fees included. Three-state verdict: pass, fail, insufficient data.
Limitations and lessons learned
A gain is not an edge
My models added no information beyond the price. Across the traded universe, the observed success rate matched the entry price for all three strategies. A regression of the outcome on my probability and on the price kept only the price. The net gain is still consistent with a lucky run over a short period.
The statistical gate never gave a green light, not once. The strategies therefore ran with real money without its approval, at small scale and knowingly. The backtest said the same: in simulation, no capital policy survived a zero edge.
Reliability was built through post-mortems, not designed in from the start. Two outages showed it.
- July 30, 2026. An automatically installed system patch restarted the service. A startup check stricter than the steady-state checks refused to relaunch it. Down for 4.5 days, with no alert. The fix: start in degraded mode instead of stopping, plus an external watchdog.
- August 19 and 20, 2026. Three network failures of a few seconds froze the real-money strategies for 30 hours, with no loss, because a freeze blocked entries, never exits. Found by chance. After that, the 21 paths able to stop the system were cataloged and classified as transient or permanent, and three database probes were added to the watchdog.
If I started again
- The gate before the models. I built three families of models, then the instrument able to say whether they were worth anything. In the reverse order, it would have forced the only question that matters sooner: what can beat this price, and why?
- Two alert channels from day one. The alert channel stayed silent for a month without anyone noticing. The fix that works: a daily message expected at a fixed time, whose absence becomes the alert.
- The class of the problem from the first incident. It took three outages of the same family to stop fixing one path at a time.