An agent breeds trading strategies, then tries to prove itself wrong
We gave an agent two years of Hyperliquid and Lighter perps history, a backtester with fees and funding, and a genetic search, and asked it to find a cross-sectional strategy that would survive its own overfitting checks.

A few weeks ago 0xArchive posted a simple strategy: each week, buy the five Hyperliquid perps that rose the most out of the 25 most traded, and short the five that fell the most. They reported +71.4% from June 2025 to July 2026 after fees and funding, while BTC fell 41.9%. The part we liked best came after the result. They compared it with random and stale versions of itself, kept a slice of the data back, and counted every setting they tried against it.
We wanted to see whether an agent could do that kind of research on ftw.trade by itself, with the same honesty, across more ideas than a person would bother to try. So we built the pieces it needed and let it run.
What the agent gets
Three things, all exposed as MCP tools:
- A history store. Every perp on Hyperliquid and Lighter, including the ones since delisted, with daily candles and hourly funding, downloaded once and kept up to date by the indexer. Backtests read from the store, never from the venues. Leaving out delisted markets would quietly drop every coin that went to zero, which flatters any long book.
- A cross-sectional backtester (
backtest_rotation). Every N days it takes the most traded markets by 30-day USD volume, ranks them by a score, goes long the top slice and short the bottom slice, and pays the venue's taker fee, 5 bps of slippage and each day's funding. - A genetic search (
start_strategy_search). It breeds settings of that book and reports the winner alongside every check it ran.
The score is a Flowscript program run on each market separately. Ranking across markets happens in the book, so anything a strategy can compute can be used to rank.
A strategy is eight genes. The first picks the score family: momentum, risk-adjusted momentum, reversal, trend, or funding carry. The next two set its lookback and skip. The other five shape the book: how many markets, what share to hold long and short, how often to rebalance, and whether to weight equally or by inverse volatility. Each generation has 40 settings. The two best carry over unchanged, and the rest are bred from tournaments of three, with crossover and the occasional mutation.
The three checks
A genetic search is built to find the best-looking backtest, and with enough tries the best-looking backtest is almost always luck. So every winner goes through three checks before anyone sees it.
- A holdout. The last 30% of the window is never shown to the search.
- Twins. The same book is run 16 times on random rankings, and 4 times on the score as it stood 7, 14, 28 and 56 days earlier. If the twins do as well, the score isn't doing the work.
- The deflated Sharpe ratio (Bailey and López de Prado). It raises the bar by how well the best of that many tries would score by luck alone, and gives the odds the edge is real. Every distinct setting the search tries counts as one try.
Each result gets one of three verdicts: promising, not proven or no edge.
First, the original idea
The agent's first call reproduces 0xArchive's book: the 25 most traded, long the top fifth and short the bottom fifth by 7-day return, rebalanced weekly, on Hyperliquid, from June 2025 to July 2026.
backtest_rotation {"from": 1748736000, "to": 1782864000,
"score": {"builtin": "momentum", "args": {"lookback": 7, "skip": 0}}}
It made +68.3% while BTC fell 43.2%, with a Sharpe of 1.68 and a worst drawdown of 22.2%. Fees cost 9.9% of starting equity and funding another 6.0%. That is close to 0xArchive's +71.4% against BTC's −41.9%, from our own copy of the data and our own backtester. It also held up on the holdout, with a Sharpe of 1.75 over the last four months.
The verdict was still not proven. Three of the twenty twins matched it on the holdout. On one try the probabilistic Sharpe gave 89% odds of a real edge, short of the 95% we ask for.
Then the agent asked a question the original post didn't: does it matter which day of the week you rebalance?
It matters a great deal. On the same data with the same rules, starting on a Tuesday instead of a Sunday turns +4.9% into +150.6% over June 2025 to October 2026. A strategy whose result swings that much on the start day is mostly measuring which weeks it happened to catch. No headline number for a weekly book means much until it has been run from every start day.
Then, the search
Next the agent ran 25 generations of 40 settings over all five score families on Hyperliquid, from June 2025 to October 2026, with the last 154 days held out. That came to 519 distinct settings and took a minute and a half.
start_strategy_search {"from": 1748736000, "seed": 1,
"genes": {"universe": [10, 15, 20, 25, 30]}}
By generation 8 the best had stopped improving, and the top of the population had settled on one family. The score is risk-adjusted momentum: the return over 10 days, skipping the latest day, divided by volatility. The book takes the 25 most traded markets, goes long the top half and short the bottom 30%, and rebalances every 3 days. On the days it trained on, that scored a Sharpe of 4.19 and +104%.
The dashed line is the problem. With 519 tries whose Sharpes spread as much as these did, luck alone would be expected to produce a best of 4.20. The winner sits right on that line.
On the holdout, every one of the top ten made money (+1.5% to +30.0%), but all of them did much worse than in training. The winner fell from 4.19 to 1.79. A strategy that had learned something real would hold more of its edge than that, and one that had memorised noise would fall further. These sit in between.
It beat 19 of its 20 twins on the holdout. The only one that matched it was the same score, read 56 days late.
Over the whole window it made +139.3% while BTC fell 24.3%, and its worst drawdown on the holdout was 7.7%. It is the best-looking result in this post, and its verdict is no edge. After 519 tries, the deflated Sharpe ratio gives it 49% odds of a real edge, a coin flip. The holdout and the twins are encouraging. The trial count says we can't tell it apart from the luckiest of 519 random tries.
Here is what that strategy held at the end of the window, to make it concrete:
And this is the score program the search wrote out for it, exactly as the report returns it. The book runs it on each market in turn:
// Cross-sectional (ftw.trade strategy search): every 3 days, rank the 25 most traded Hyperliquid perps
// (30-day USD volume) by this score; long the 50% highest, short the 30% lowest, equal weight, 1x gross.
uses { bars: "^1", paper: "^1" }
const market = "perp:hyperliquid:<each market>";
const interval = "1d";
const lookback = 10;
const skip = 1;
const close = bars.close(market, interval);
const daily = close / close[1] - 1;
metric("score", (close[skip] / close[lookback + skip] - 1) / stddev(daily, lookback));
The same search on Lighter
Lighter lists more markets than Hyperliquid, including stocks, indices and commodities, and has a younger history. From July 2025 to October 2026 the 7-day book there made +16.9%, with a 44.8% drawdown along the way. It lost 1.9% on the holdout, where 12 of its 20 twins did as well, so its verdict is not proven.
The search on Lighter shows the textbook case of what the checks are for. After 634 tries its winner had a training Sharpe of 3.83 and +104%. That was risk-adjusted 7-day momentum, the 40 most traded markets, rebalanced every two weeks.
On the holdout it lost 8.0% with a Sharpe of −0.99, and 12 of its 20 twins did as well or better. It is the same algorithm, run the same way, on the next venue over. The verdict is no edge.
What we take from it
- The 0xArchive result reproduces. On our data, the 7-day winners-minus-losers book on Hyperliquid's top 25 made about what they reported, after fees and funding.
- It is fragile. The rebalance day alone moves the result between +5% and +151%, and on Lighter the same book went through a 44.8% drawdown to make 16.9%.
- A search finds better backtests and no proof. The genetic search doubled the training Sharpe. Once its 519 tries are counted, the deflated Sharpe can't separate the winner from luck. The holdout made money and beat the twins, which is worth paper trading. It is not worth funding.
- The agent's job is the checks, not the search. Breeding 519 strategies takes a minute and a half. Its value is that every result comes back holdout first, beside its twins, with a verdict, so a 4.19 Sharpe never appears without its 49%.
What the backtest leaves out: fills at the daily close at the named fee and slippage, with no market impact beyond that; funding summed per day and charged on the position held at the start of that day; and no margin or liquidation per market, because the book is resized to equity at each rebalance.
Agents on build.ftw.trade can run all of this
over MCP: get_perp_universe to see what history is stored,
backtest_rotation for one book, and start_strategy_search for a search.
Every answer comes with its holdout, its twins and its trial count.