← Notes

Two nights of real liquidations

A copy of mainnet tells you whether a liquidation works. Two sharp price moves told us how it races. What held up, what didn't, and what we changed between them.

Our last note on the liquidator ended with a caveat: a fork of mainnet can tell you whether the system does the right thing when prices move, but how often prices move, and how many races you win, only mainnet can tell you. Over two nights it told us.

Twenty-three quiet hours, then everything at once

The first night was calm until it wasn’t. The price of a major collateral asset fell about four percent in twenty minutes, and for those twenty minutes the liquidator sent more transactions than it had in the previous week. Borrowers’ liquidation prices sit in tight clusters, because people pick similar leverage, so a fast move runs through a whole cluster at once. The next morning a slightly lower low did the same thing to the positions that had survived the first move.

That shape matters for how you judge a system like this. Almost all of the decisions that count are made in a few minutes a day, under the heaviest load, against everyone else who saw the same price.

What held up

The parts we had tested on the fork worked the first time they met real money. Every liquidation that landed was accepted by its lending program, sized within what the program allowed and sold its collateral in the same transaction, and the wallet’s balance changes matched what the system believed it had earned. A handful landed. Most didn’t, and most of what we learned came from those.

What didn’t

The channel that never answered. We send each liquidation several ways at once, one of them as a bundle to a block engine. Across both nights, none of the bundles landed, and nothing told us why. The natural guesses were that we were slow or bid too little. When we subscribed to the block engine’s own verdicts, neither was true: the bundles were rejected in simulation within milliseconds of sending. We were reacting to price updates so early that the engine’s copy of the chain didn’t contain them yet, so to it our liquidations were simply invalid. We were too early, not too late. We now send again once the chain has had time to catch up. The broader lesson is older than this system: a channel that fails silently will be blamed for whatever you already suspected, so make it say why before you tune anything.

An optimisation that broke something it didn’t know about. To keep transactions small, the system learns which addresses it uses often and stores them in a lookup table. It had learned some of a sending service’s tip addresses. A tip that is read from a table is invisible to the service, which refused those transactions, about a third of that route’s copies on the first night. Nothing was wrong with either piece on its own. Tip addresses are now never stored, and the ones already stored are hidden from the compiler.

An attempt is not a win. To avoid paying fees on races that are already lost, we held back our paid copies when a rival was seen attempting the same liquidation. On the second night a bot that had been failing on the same positions every second and a half kept that rule switched on at exactly the wrong moment, and a rival took the opportunity one block later. Most attempts in a contested market fail, so an attempt is weak evidence. Whether to stay out now depends on what a copy costs against what is at stake.

Reading the race from the block. The question “why did we lose?” has a direct answer on chain. Laying out every transaction in the winning block by position showed exactly where we stood. On some races we were in the same block as the winner, a few dozen transactions behind it. That is a latency gap, and no patch closes it. It is the next thing to measure.

Between the moves

None of this was visible on the fork, and it couldn’t have been: there are no competitors there, no block engine with its own view of the chain and no rate limits shared with anyone. What the fork did do was make each fix cheap to check. The loop over these two days was the same each time: reconstruct the race from the chain, fix the single most expensive mistake, run it against the fork, and ship it before the next move.

The next move will show which of these fixes hold.