12 August 2026 · 5 min read

A liquidation is a race funded by the loser

On Aave the liquidation bonus comes out of the borrower's collateral, so the race only runs when the bonus beats gas. Below that line positions rot into bad debt.

A lending protocol does not liquidate anyone. It publishes a price for doing so, and waits for someone to accept it. On Aave the price is the liquidation bonus, a slice of the unhealthy borrower's collateral handed to whoever repays their debt, and the bonus is paid by the borrower, not by the protocol. That makes liquidation a race funded by the loser, and a race only gets run when the prize exceeds the cost of entering. The cost is gas. Below the line where the bonus no longer covers gas plus execution, no rational actor liquidates, the position sits unhealthy, and if the collateral keeps falling it becomes bad debt that the protocol's depositors eventually eat. The line has a value per asset, it moves with the base fee, and the total value of positions under it is a risk number that lending protocols should publish and mostly do not.

The mechanism

Aave's liquidation documentation describes the current design plainly: a liquidator repays some of a borrower's debt and receives collateral worth more than the repayment, with the difference being the bonus, and in the fourth version of the protocol the bonus follows a Dutch auction in which lower health factors earn higher bonuses. The documentation's own advice to liquidators is the whole economics in a sentence: when choosing positions, ensure the liquidation bonus exceeds the gas cost. A share of the bonus, currently 10 percent for most Ethereum collateral and 20 percent for the major stablecoins after a governance change, goes to the protocol as a fee, which lowers the liquidator's take and moves the line further up.

A flash-loan-funded liquidation in one transaction, from borrow to repay A sequence of six steps in one transaction: borrow the debt asset with a flash loan; call the pool's liquidation function to repay the borrower's debt; receive the borrower's collateral plus the bonus; swap enough collateral back to the debt asset on an exchange; repay the flash loan with its premium; keep the remainder as profit. If the remainder is below the gas paid, the transaction is a loss and the rational liquidator does not send it. Atomic, or not at all 1. Flash-borrow the debt asset no capital of your own 2. Repay the borrower's debt the pool's liquidation call 3. Collateral plus bonus paid from the borrower's side 4. Swap back to debt asset slippage comes off the bonus 5. Repay the flash loan plus its premium 6. Keep the remainder minus the gas already paid Every step succeeds or the whole transaction reverts; the gas is paid either way. the liquidator sends it only when step 6 is expected to beat the gas: that is the line the bonus in step 3 is the borrower's collateral, not the protocol's money
Illustrative: the canonical atomic liquidation on a pool that offers flash loans, drawn as a sequence; the shape is the same whichever asset is involved.

The flash loan is what makes this a race anyone can enter. A liquidator needs no capital, only the gas to send the transaction and the code to run the six steps atomically, so the field of competitors is everyone with a bot, and the prize goes to whoever lands first in the block. That competition is good for the protocol on large positions, where the bonus is worth fighting for. It is what abandons small ones.

The dust line

Call the dust line the position size at which the liquidation bonus, net of the protocol's fee share and of the slippage on the swap, equals the gas cost of the transaction. Above it, someone will liquidate. Below it, nobody rational will, because the transaction loses money. The line is a simple product: gas units times gas price, divided by the net bonus rate.

A liquidation of the kind drawn above uses on the order of 400,000 gas. At a base fee of half a gwei, which is where Ethereum mainnet has sat for much of 2026, that is 0.0002 ETH; at 5 gwei, 0.002; at 50 gwei, during a crash, 0.02. Divide by a 5 percent bonus and the line sits at 0.004, 0.04 and 0.4 ETH of collateral respectively. At a 1 percent bonus, which is the low end for the safest assets, the line at 50 gwei is 2 ETH.

The dust line against gas price for three liquidation bonuses, with 400,000 gas per liquidation Three rising lines on log axes: collateral value in ether at which the bonus equals gas, against gas price in gwei from 0.1 to 100. At a 1 percent bonus the line runs from 0.004 ether at 0.1 gwei to 4 ether at 100 gwei; at 5 percent, from 0.0008 to 0.8; at 10 percent, from 0.0004 to 0.4. Everything below a line is dust that a rational liquidator will not touch at that gas price. Where the race stops being worth running Collateral where the bonus equals gas, 400,000 gas each; log axes 1% bonus 5% 10% 10 ETH 1 0.1 0.01 0.001 0.1 gwei 1 10 100 gwei Gas price 5% at 10 gwei: 0.08 ETH Below the line a position is dust: unhealthy, unliquidated, drifting toward bad debt.
Illustrative: computed from the formula in the text with 400,000 gas per liquidation and no slippage; real bonuses vary by asset and, in the fourth version of the protocol, by health factor.

The chart's most important feature is that the lines move with gas, and gas rises exactly when liquidations are needed. A crash pushes prices down, which pushes positions under their thresholds, which brings out the bots, which fills blocks, which raises the base fee, which raises every dust line by an order of magnitude in the space of a few minutes. Positions that were comfortably above the line at half a gwei are below it at 50, and they stay unliquidated through the crash, which is precisely when their collateral is losing value fastest.

Slippage moves the line further than the formula shows. Step four of the sequence sells the seized collateral for the debt asset, and on a thin market or during a crash that sale pays a spread that comes straight out of the bonus. A 5 percent bonus with 2 percent slippage is a 3 percent bonus, and the dust line for it is two thirds higher than the chart draws. The bots that run this race price slippage from the live order book before sending, which is another way of saying that the line is not one number but a function of the moment, and that the moment it matters most is the moment it is highest.

The protocol has noticed

The design has been catching up with the arithmetic. Aave's third version introduced a rule that lets a liquidator close small positions entirely rather than the usual fraction, so that the bonus on a small position is at least the whole bonus and not half of it, and the current documentation states the leftover rule in its present form: if the debt remaining after a liquidation would fall below 1,000 dollars, the entire debt in that reserve must be liquidated. That number is the protocol admitting where the line sits. A position left with 900 dollars of debt is a position nobody will come back for, so the rule forbids leaving it. The Dutch auction on the bonus is the same admission from the other side: as a position gets unhealthier, the protocol raises the prize, which lowers the dust line for that position and widens the field of liquidators who will run for it.

Neither mechanism removes the line; they move it. A position that was below the line before the auction started may be above it once the health factor has fallen far enough for the bonus to rise, but by then the collateral has fallen too, and the race is being run for a smaller pot. What the mechanisms cannot do is make gas free, and gas is the only term in the formula the protocol does not set.

Publish the total under the line

So the number I would want from a lending protocol, alongside total value locked and the health factor distribution, is the total collateral value in positions below their dust line at the current base fee, and the same total at a stressed base fee of, say, 50 gwei. It is computable from public state: every position's collateral, its asset's bonus, the current gas price and a gas estimate per liquidation. The first number says how much of the book is already abandoned. The second says how much becomes abandoned the moment a crash raises gas, which is the moment the abandonment matters. Together they are the protocol's real bad-debt exposure, as opposed to the bad debt it has already recognised, and a protocol whose stressed total is a meaningful fraction of its reserve fund has a risk it has not priced.

How the value under the dust line would be reported, at current and stressed gas A table with three rows: total collateral in positions below the dust line at the current base fee; the same at a stressed base fee of 50 gwei; and the protocol's reserve fund for comparison. Values are shown as placeholders because the point is the shape of the report, not a measurement. The two numbers a risk page should carry MEASURE HOW IT IS COMPUTED Value under the line, now sum of collateral where bonus is under gas at the current base fee Value under the line, stressed the same sum at 50 gwei the gas a crash brings Reserve fund what absorbs bad debt if the stressed number lands The second row divided by the third is the exposure the bonus schedule has not priced.
Illustrative: the report as I would want it laid out; the inputs are all public on-chain state and the computation is the dust-line formula per position.

Why a searcher cares

I write this from the liquidator's side of the race, or rather from the side of someone whose flash-loan code runs on the same pool and understands what the six steps cost. A bot that liquidates rationally is, by construction, a bot that ignores everything under the line, and the line is where the protocol's risk quietly accumulates. There is no villain in that. The borrower funded a prize, the prize was too small to claim, and the protocol's depositors will find out on the day gas spikes and the small positions go under together. Publishing the total under the line is how the depositors find out beforehand, and it is a number any team with a node and an afternoon can compute.

AaveDeFiLiquidations
All writing

Written by Mohd Shayan

Get new posts by email

Occasional essays on engineering, AI, and building for the people technology leaves behind.

One email per new post. Unsubscribe any time.

Subscribe with RSS