A loan that pays for its own liquidation. Borrowers keep most of the 5% bonus bots take today.
Liquidation is the one moment a borrower can least afford to lose money, and it's exactly when DeFi charges them the most. When a loan gets risky, an outside bot repays it and walks away with about 5% of the debt. Aave alone liquidated around $429M in a single crash week this February. That bonus doesn't pay for anything essential. It exists because a loan can't act on its own: someone has to watch it, sign a transaction, bring capital and pay gas.
Autolysis lets the loan do it itself. Every market has a contract account that authorizes and pays for its own liquidations, using EIP-8141 frame transactions on the ERC-8421 alternative mempool. Nobody signs anything. Anyone can broadcast the transaction, because the account's validation code checks that it's the one allowed liquidation for a position that's genuinely unhealthy at a fresh oracle price.
The market then sells just enough collateral to bring the loan back to health, through a Uniswap v4 hook. The hook fills the sale at the oracle price: first from 1inch Aqua makers, whose USDC sits in their own wallets until a liquidation needs it, then from a backstop, and only then from the pool's curve. A custom SwapVM opcode means those makers can only be filled by a liquidation, so nobody can pick them off when the oracle lags.
The borrower pays gas and a small spread instead of the bonus. Lenders keep a classic liquidation as a fallback if self-liquidation ever stalls.
It runs on the EF devnet. A keyless, self-paid liquidation was included in block 2865. In a 12-position crash, the canonical mempool rejected all 12 (StorageReadNonSender, because validation reads live market and oracle state), and the alternative mempool included all 12 from a single account. Five attack transactions were all rejected. The Uniswap and Aqua parts are proven against the official contracts on a Unichain mainnet fork.
I'm also proposing EXO-010, a narrow reputation rule for the alt mempool, so a sender isn't punished when an oracle update cancels its pending liquidations.
Solidity with Foundry for the contracts, TypeScript for the transaction kit, and a small dashboard. Solo build, with Claude Code as a pair programmer and a lot of review rounds where I tried to break it.
The account (EF frames + alt mempool). AutolysisAccount is both the sender and the gas payer. Its VERIFY frame reads the transaction through Alex Forshtat's hegota-support helpers and approves exactly one shape: two frames, the selfLiquidate call with the right arguments, one nonce key equal to hash(market, position), a recent oracle round inside a price band, a position unhealthy at both the cited and latest price, and a max cost under the fee cap. Every rule has a mutation test. The first version cost 131k gas on our mock, over the sidecar's 100k validation cap, so I rewrote it to read 15 fixed parameters into a fixed-size struct instead of decoding whole frames. On the devnet it measures 94,168. TIMESTAMP is banned during validation, so freshness comes from the oracle's round index, and wall-clock checks live in the execution frame. The signature is a single ARBITRARY entry: the code is the authorization. One EIP-8250 nonce key per position is what lets one account keep 12 liquidations pending at once.
Gas is billed from the borrower's WETH collateral, unwrapped and sent to the account, capped at 0.3% of what's sold. A failed attempt can be billed at most once per price round, so nobody can grind a position down.
The sale (Uniswap v4). V4Venue settles the collateral before calling swap, so the hook can pay makers in real tokens inside beforeSwap instead of handing them ERC-6909 IOUs. BackstopHook authorizes on the swap's sender, never on hookData, and uses beforeSwapReturnDelta to run the waterfall. Anyone else sees an ordinary pool. Invariants check that every swap nets to zero and that the hook ends each liquidation holding nothing.
The buyers (1inch Aqua + SwapVM). Tier 1 calls our fork of AquaSwapVMRouter with one new opcode, LiquidationGate (0xf9): an order only fills if the taker is our hook and a liquidation is in progress. Makers ship strategies to the official Aqua registry and get paid WETH straight into their wallets in the same transaction. The fun part: SwapVM needs solc 0.8.30 and v4-core pins 0.8.26, so the hook talks to the router through an ABI-only interface, and the tests deploy the 0.8.30 build artifacts with vm.deployCode.
Hacky but notable: our first devnet liquidation was admitted and then never included. The gateway sidecar runs in manual bundling mode, so I rebuilt the exact signed bytes, checked the hash matched, and relayed through the miner sidecar. With Alex's tip to retry with fresh entities, it landed in block 2865. The crash scene now checks whether the sidecar already has a transaction before retrying, so a network blip can never liquidate twice.
Testing: 165 tests plus 12 stateful invariants, green in CI, including differential tests (TypeScript vs Solidity math) and fork tests against the official Uniswap PoolManager and Aqua registry on Unichain. One honest gap: replacing a pending liquidation with a fee bump is designed in but wasn't demonstrated on the devnet, so I don't claim it.

