Aave v3-v4 liquidation bot

I spent several months building and running a liquidation system for Aave V3 and V4 across Ethereum, Arbitrum and Base. I have written up how it works and am attaching it here.

There is a lot of public material on MEV in general and very little on how liquidations actually reach Aave. Most descriptions stop at “watch health
factors and call liquidationCall”, which skips almost everything that matters once you try to compete. This is the part that gets skipped.
What the document covers:
• The state engine — census, event listening, and why position health is
computed entirely offline. With scaled balances, reserve indices and prices,
health becomes pure arithmetic, so a price update triggers a local evaluation
of ~19,000 positions in milliseconds rather than thousands of RPC calls.
• Decoding an SVR frame — the exact structure of a Chainlink Smart Value
Recapture update, why the report has to be decoded as parameters rather than
as a tuple, and why filtering by selector alone is not enough.
• Four execution paths, because the chains are not the same:
• Atlas on Arbitrum and Base — solver operations, the owner/signer
constraint, the gas ceiling, and why parallel auctions require two bonded
wallets
• MEV-Share on Ethereum — hash-referenced bundles, why builder multiplexing
is not optional, and simulating against a state that does not exist yet
• Direct execution — where there is no auction to win, and what the gas
profile of that channel reveals about who is using it
• Timeboost via Kairos on Arbitrum — 60-second rounds, the express lane, and
why network latency stops being the constraint
• The economics — how the bid is calculated, where the liquidation protocol
fee has to be discounted and where it must not, and a coupling between two
parameters that silently raises the size floor of the whole system.
• On-chain execution — flash loan cascades and the fact that providers
collect in two incompatible ways, explicit swap routing, batch liquidations,
and same-asset positions whose health factor is mathematically invariant to
price.

A few measurements are included where they changed how I built things. The one that reframed everything: in a traced auction, the winning liquidator paid of extracted value to the block builder and retained under two dollars. You do not win these by bidding less — you win by having lower costs than the second-best bidder.

Contract addresses, configuration parameters and wallet details are left out.

Everything structural is there.

I am moving my time to other projects and will not be operating this going forward. If anyone is interested in the codebase itself, or wants more detail on any of the above, feel free to reach out and we can discuss it privately.

sentinel-architecture.pdf (130.1 KB)

2 Likes

Hey Burnbytes, Raoul here from Chainlink Labs.

Would love to chat a bit about your system. Could you reach out to me at raoul.schipper@smartcontract.com?

4 Likes

Done.

Im send you email

2 Likes

Curious to know: is it profitable to run a liquidator bot? I understand this is a game of speed and, as mentioned, “You do not win these by bidding less — you win by having lower costs than the second-best bidder.”

2 Likes

Speed and latency aren’t as critical as they used to be; with SVR Atlas you have 2 seconds to place your auction bid, and on mainnet, up to 12 seconds.

Speed is mainly necessary because if you have 90,000 borrowers, scanning and calculating their Health Factor (HF) must be extremely well programmed so you know who drops below 1 and becomes liquidatable.

The real issue is that bots are bidding higher and higher, barely capturing any of the bonus.

If you use your own capital to liquidate, you can play with that margin and reduce latency, but if you use flash loans and then swap (adding slippage), the margins shrink drastically.

A concrete example, traced end to end on-chain.
Aave V3 mainnet, block 25832630. WETH collateral, USDT debt:

On a $11,809 operation, with a $615 gross bonus, the liquidator kept nothing.

Every wei of extracted value went out — 99.66% of it to the block builder.

Their actual return, if any, is whatever cost advantage they hold over the second-best bidder. Not the bonus.

For context, my own bid on that same auction was $441.40. I lost it, and I would have lost it even bidding 100% of my computed net — my net came out at $520 against their $530, because their route was slightly cheaper and they sized about 0.5% larger.

That $10 gap is the entire game.

Debt covered |**$11,809**

||Collateral seized|5.0502 WETH — **$12,424**

| |Gross bonus |**$614.56** (5.20%)

After the exit swap, the winning liquidator withdrew 0.2162 WETH ($531.90).

They then paid out:

|to block.coinbase|0.215488 WETH |$530.10 — 99.66%|
|to a second address|0.000732 WETH |$1.80 — 0.34% |
|retained |0.000000 WETH|$0.00 |

3 Likes

How do you make money with a liquidation bot? On a day-to-day basis, it’s practically impossible.

You can only do it during market crash or surge events that trigger price spikes, when there are 100-200 liquidatable borrowers at the same time and the big players can’t handle all of them.

So on those days, you can make a killing and pull in $1,000 “$2,000 in liquidations in just a few hours.

3 Likes

Thanks for publishing the traced numbers. The retained-value figure is the useful part and it is rarely shown.

On whether bots are profitable: I think the answer depends on which liquidator you mean. Aave sets one bonus parameter, and it serves two populations with very different cost structures.

An atomic liquidator flash-loans the debt, repays, sells, and closes in one transaction. Its warehouse holding period is zero, so it has no multi-day funding, capital-hurdle, hedge-carry, or recovery exposure. It still pays the protocol fee, flash-loan fee, gas, swap slippage, and auction bid.

Your WETH/USDT trace makes that decomposition unusually clear. Against the reported $11,809 debt covered, the $614.56 gross bonus is 5.20% on a debt-relative basis. After the exit swap, the winner withdrew $531.90 and paid $530.10 to the builder. The builder payment was therefore 99.66% of post-execution value, but 86.26% of the gross bonus. The competition is for post-execution value, not for a costless gross bonus.

For comparison, the 6% wstETH liquidation bonus has a theoretical no-carry break-even slippage of 6% / 1.06 = 5.66% before protocol fees, gas, financing fees, and an auction payment. That is the wstETH parameter used below, not the bonus in the WETH/USDT trace.

A warehouse liquidator is a different business: real capital, collateral held and hedged, exit over days through DEX depth or primary redemption. I published a balance sheet for that case on mainnet wstETH, where the position is $256.52m against $2.73m of instant routed depth inside the 6% bonus, about four orders of magnitude above the operation you traced. The canonical run assumes 10% annual funding, a separate 10% capital hurdle, 0.1% hedge entry, 2% annual hedge carry, 1% DEX execution loss, a 4% canonical recovery loss, and illustrative redemption throughput of $25m/day after 24 hours:

route                                 exit horizon   minimum bonus
optimized route (100% redemption)        11.3d            4.66%
quiet DEX only                           30.1d            6.29%
stressed DEX only                       241.9d           13.49%

Method, commands, and manifests: aave-risk-engine/docs/results.md at v0.3.0 · BianchiGiacomo/aave-risk-engine · GitHub

The fixed bonus can therefore leave auctionable surplus on a small atomic clear while being marginal or insufficient for a position that requires multi-day capital. The two examples use different collateral pairs and should not be read as a like-for-like profitability comparison.

That matters for how auction data should be read. An auction clearing with near-zero retained value tells you the atomic population is competitive. It does not tell you whether a warehouse liquidator would show up for a position that cannot be cleared in one block. The observed auction samples an opportunity that was atomically executable; it does not test multi-day balance sheet capacity.

It also raises a question I have not tested. The value targeted by OEV recapture remains after an atomic liquidator pays its execution costs, and competition can auction most of that residual away. At sizes where the marginal liquidator has to carry the position for days, the same spread is compensation rather than rent.

Chainlink’s risk-adjusted SVR analysis already recognizes this size effect by applying a lower assumed capture rate to the top decile of liquidation OEV. Exit horizon and required capital could make that adjustment more directly economic than a value percentile alone. One way to state the design problem is: maximize OEV recapture subject to preserving reliable liquidation participation across size and exit horizon.

@RaoulSchipper-CLL, can public SVR or Atlas auction data connect bid retention to liquidation notional and execution route closely enough to estimate that boundary?


Independent research, unaffiliated with Aave Labs, the DAO, or any service provider. Everything above is reproducible from the linked manifests.

2 Likes

@Burnbytes Agreed, it’s actually pointless at this stage. There is practically no incentive to liquidate any position on a SVR rail, you can do everything right, but the reward is often counted in cents, not dollars. When you factor in the costs involved, it’s disproportionate to the rewards. To get to the point you can actually realise/match the bids on offer it’s a mountain, and the reward is a dollar, and the cost to get there is likely higher than the prize on offer.

@GBQuant There’s a lot of risk involved in the capital route, IMO the bot with a flash loan route with a guaranteed $1 will end up beating most capital players, the spread you speak of is actually the tip that the flash loan bot pays. The best markets for liquidators with capital, are the tokens that can’t be atomically unwound, or have redemption dates (for example a non-expired PT’s).

3 Likes

Totally agree, running liquidations using SVR Atlas isn’t even worth it anymore.

Between the bid you pay and the route you use, plus the flash loan, slippage, fees, etc… you’re left with pennies. And the ones with higher bonuses (exotic tokens) usually don’t have enough flash loan liquidity and revert during the swap.

There was one time where a borrower went several days without getting liquidated, and the net bonus was $400. But for the EURS token, since there was no liquidity, nobody could liquidate it, and every day their HF kept dropping even lower (I think I saw it at 0.80).

2 Likes

They removed the carrot from the stick, and some donkeys are obediently following the stick. The biggest issue with SVR, is there’s almost no incentive for the searcher any more to even do the work required, there was but Aave/Chainlink realised they can cream off the rewards. I think it’s a scummy move tbh, it’s like it’s their money in the first place which is why they call it “recapture”, why “re”? They are capturing the debtors collateral from the liquidator, when it’s the debtors money that is being used to balance the books, the penalty for going insolvent is on the borrower, it’s not actually Aave’s money (it’s called DEFI, they just ignore the “DE”…), if anything it should be added to the interest rates for the lender whereas the loan being repaid means less interest for the lenders.

And oh yes, indeed, trying to get some tokens anywhere near “oracle price”, just lol. I’ll see that 5% bonus, and raise you >6% slippage :smiley: . I guess the lenders are happy to sit on bad debt, in the hopes it becomes solvent at some point.

3 Likes