Liquidation Design
One liquidation entry point on every chain, open to any address: a partial seizure sized by Aave V4, funded by the caller and settled by LPVaultSwap in the debt asset that was repaid.
Overview
Avana has one liquidation route on every chain: a partial seizure through LPVaultSwap, settled in the debt asset that was repaid. There is one LPVaultSwap per chain, at a fixed address, serving every Hub, CDP Spoke and market of that chain. Its one entry point, liquidate, is open to any address that is not frozen once Aave allows the liquidation (health factor below 1). In a single transaction LPVaultSwap:
- pulls up to debtToCover of the debt asset from the caller and measures what arrived. It takes no flash loan itself;
- calls Aave's standard liquidation on the CDP Spoke, which sizes the repayment and the seizure, pulls the repayment out of the caller's funding and sends the seized vault tokens to LPVaultSwap;
- has the AaveAdapter burn exactly the seized vault tokens, Collateralization debit them from the account's records, and the market's LP Vault unwind exactly the seized units into the market's tokens;
- swaps each token that is not the debt asset into the debt asset over the market's fixed swap routes, each leg with a minimum output derived from oracle prices;
- pays out in the debt asset: Avana's fee, any borrower surplus, and the rest to the caller, including the funding Aave did not use.
A caller that holds no debt asset uses Avana's public flash liquidation helper, an immutable periphery contract anyone can use. It flash-borrows the debt asset from the chain's Aave V3 Pool, calls liquidate, and repays the Pool from the caller's payout. Operators may run their own helper.
The borrower keeps the rest of the position and all of its fees. GHO appears only when the debt being repaid is GHO. If any step fails, the whole transaction reverts and the account is unchanged.
The requirements for liquidation callers are on the Liquidators page: Liquidators.
Every step of a settlement, with its checks and formulas, is on the flow page: Liquidation Flow.
Accounts Are Per Market
Each wallet has one PositionProxy per CDP Spoke and market. Each proxy is a separate Aave account that holds exactly one collateral reserve, the market's vault token, and may hold several debt reserves. A wallet using two markets has two accounts, so a falling price in one market never liquidates an account in another market.
The PositionProxy is a logic-free, immutable account. It holds no settlement authority, and its binding to the wallet, the Spoke and the market never changes.
When an Account Is Liquidatable
An account can be liquidated when its health factor on the CDP Spoke is below 1, whether from falling collateral value, a rise in the debt asset's price or accrued interest, and the prices used for the call are fresh. LPVaultSwap checks each condition below before it pulls the caller's funding.
| Condition | Rule | Error if not met |
|---|---|---|
| Health factor | Below 1, read from the Spoke's account data. Aave applies the same check inside its liquidation call. | NotLiquidatable |
| Collateral price of the seized market | The market's LP Oracle price is Live or Drifting, not Cached or Expired. Every input is at most its feed's heartbeat plus a 1,800 s margin old, and no feed disagreement pause is active. | StalePrice |
| Price of the repaid debt reserve | GHO always passes, because Aave prices it at a fixed $1. Any other debt asset needs a Live DebtOracle with every input within its heartbeat plus 1,800 s. | DebtPriceStale |
| Sequencer gate (Base) | While the sequencer is down, liquidation stops. For 3,600 s after a restart, only accounts with a health factor below 0.95 can be liquidated. Ethereum has no sequencer and is always open. | SequencerDown, SequencerGrace |
| Recovery grace | For 1,800 s after a market's price recovers from Expired, only accounts with a health factor below 0.95 can be liquidated. | GraceHealthFactor |
| Hub shares equal assets | The home Hub's added shares equal its added assets for the vault-token asset, so Aave's seized shares equal vault-token units. | SharesNotEqualAssets |
| Listed market and debt reserve | The market is listed on the account's CDP Spoke (Registered, Active or Offboarding), and the debt reserve is enabled for the Spoke with a funding Hub and an Avana Umbrella recorded. | UnknownMarket, UnknownDebtReserve |
Freshness follows each feed's heartbeat
A Chainlink feed publishes on its deviation trigger or after its heartbeat, so an age up to the heartbeat is normal. A USD stablecoin feed with an 86,400 s heartbeat is fresh for 88,200 s: an answer published 23 hours ago passes. A 3,600 s feed is fresh for 5,400 s.
Drifting, disagreement and Expired markets
- A market that is Drifting only because of its time-weighted price guard, an observation failure or a price-band breach, with both feed routes of each token fresh and agreeing, can still be liquidated. Aave decides eligibility and sizes the seizure at the served price.
- When a token's primary and alternate feeds are both fresh but disagree beyond tolerance, liquidation of that market pauses for up to 3,600 s from the first recorded observation. If they still disagree after that, the market is treated as Expired for liquidation until they agree, a standby price route is switched in, or governance approves a fix.
- Once a market is Expired, its collateral counts as almost 0, so the account's health factor falls, but the account cannot be seized until a fresh price returns.
- Other debt reserves of the account are not gated. A failing debt price only raises the debt's value, which lowers the health factor, and no debt is ever repaid at a stress price.
How the LP Oracle produces these price states is described on the Price Oracles page: Price Oracles.
Partial Seizure Sized by Aave
Every liquidation goes through Aave's standard liquidationCall on the CDP Spoke, called by LPVaultSwap with receiveShares set to false and the caller's measured funding as Aave's bound. Aave sizes the repayment and the seizure inside the call. The caller only sets an upper bound on the repayment.
- Aave sizes the repayment to bring the account to its target health factor (1.10 is Avana's recommended value; the Aave DAO sets it), with its dynamic liquidation bonus and its dust rule.
- The dust rule can require the whole debt in the reserve to be repaid, so callers size debtToCover for that case up front. Aave pulls only what it needs, and the rest returns to the caller in its payout.
- LPVaultSwap measures the debt repaid and the vault tokens seized as balance changes within the call. It never reads them from Aave's return values or events.
- LPVaultSwap does not reimplement Aave's account or liquidation math. Whole-position settlement does not exist, because Aave sizes every seizure itself. Liquidation is always partial.
- A liquidation that seizes nothing reverts, so debt is never repaid without collateral being taken.
After a liquidation that leaves collateral and is not limited by the dust rule or the collateral cap, the account's health factor is at least Aave's target. The seized value is at most the debt repaid times the bonus, plus one vault-token unit at the served price.
LPVaultSwap as the Only Receiver
The vault token's transfer rule accepts only three movements: a registered proxy to its home Hub (supply), the home Hub to a registered proxy (withdrawal, burned in the same call), and the home Hub to LPVaultSwap (seizure). Every other recipient is rejected, including zero-amount transfers.
Aave delivers seized collateral with a transfer from the Hub to the liquidator. A liquidation called by any address other than LPVaultSwap therefore reverts on that transfer:
- with receiveShares set to true, the Spoke reverts with CannotReceiveShares, because the reserve has share receipt disabled;
- with receiveShares set to false and a seizure of at least one unit, the Hub's transfer to the caller reverts with the vault token's UnauthorizedTransfer error and the whole call reverts;
- a call sized so that its seizure rounds to 0 units moves no collateral. It only repays debt for the borrower with the caller's own funds.
Every LiquidationCall event on a CDP Spoke that seized vault tokens therefore names LPVaultSwap as the liquidator. No vault token moves, and no deficit is reported, except through LPVaultSwap. An LPVaultSwap upgrade keeps the same proxy address, so it stays the only allowed seizure recipient.
Exclusivity on a Standard Spoke
The CDP Spoke is a standard, unmodified Aave V4 Spoke, and its liquidation function has no caller restriction. Exclusivity comes from the vault token's transfer rule together with three Aave settings on every Avana collateral reserve:
| Aave setting | Value | What it closes |
|---|---|---|
receiveSharesEnabled | false | A liquidator cannot take the seized collateral as Hub shares instead of vault tokens. |
liquidationFee | 0, or paid to Avana's fee receiver | No fee shares reach a third party during a liquidation. |
reinvestmentController | address(0) | No contract can move the Hub's vault tokens, and Hub shares stay equal to assets. |
The listing settings also make the vault-token reserve non-borrowable, list the vault-token asset on no other Spoke (with a draw cap of 0 everywhere), and grant no position-manager approval on any proxy.
The RiskModule checks these settings on every new-account pledge, borrow and withdrawal with debt, and monitoring checks them every block. Drift in any setting trips the market's CONFIG_DRIFT breaker: new pledges, borrows and withdrawals with debt stop, while liquidation, repayment, top-ups, debt-free withdrawal and fee collection continue. The listing payload agreement commits the Aave DAO to keep these settings while Avana debt exists.
One Entry Point
Every liquidation of an Avana account runs through LPVaultSwap.liquidate. There is no second liquidation function and no keeper check. Every call liquidates one account, in its one collateral market, against one debt reserve.
| Function | Caller | What it does |
|---|---|---|
liquidate | Any address that is not frozen, with no role, registration or agreement | The full liquidation, with either route mode: PrimaryThenBackup (primary route with backup fallback) or BackupOnly. The caller funds the repayment and receives the caller payout. |
settlePending | Any address | Settles vault tokens an earlier, unsettled seizure left at LPVaultSwap. It pays the caller nothing and sends the proceeds to the Avana Umbrella (Coverage Spoke). |
Who calls it
- Committed operators: Avana's keeper on each chain at launch, and any operator later added to the registry through the timelock, such as Aave Labs or a risk provider.
- Any other address, funding the call from its own debt asset, through the public flash liquidation helper, or through its own helper.
- The Aave DAO, from its executor or any address it controls, at once and with no Avana action, directly or through the public helper. It can also have a committed operator of its choice registered.
The caller is always the address that calls LPVaultSwap (msg.sender): LPVaultSwap pulls the funding from that address and pays the caller payout to it. No caller or recipient address is taken from calldata, so a front-runner that copies a call must fund it itself and gains only what the original caller would have. Through a helper, the caller LPVaultSwap sees is the helper.
Every check runs on every call
Whoever the caller is, liquidate runs the same checks:
- the health factor, the price gates of the seized market and the repaid reserve, the recovery grace and the sequencer gate;
- the Hub share check;
- the recovery floor and each swap leg's oracle-derived minimum;
- Avana's fee and the borrower surplus;
- the deadline, the caller's minimum payout and the address freeze on the caller.
These checks cover everything a caller could exploit: the floor comes from oracle prices, the routes are fixed, and the payout goes to the caller itself. Restricting the caller would add no protection and could only leave an account unliquidated. BackupOnly only selects an approved route held to the same floor and leg minimums. One path also means one set of code, tests and monitoring.
Funding and the Flash Liquidation Helper
The caller funds the repayment
LPVaultSwap pulls debtToCover of the debt asset from the caller before any other transfer and measures what arrived as its own balance change. The caller is LPVaultSwap's only source of the debt asset: liquidate takes no flash loan, calls no lender, and never buys the debt asset with another token.
- LPVaultSwap approves the Spoke for exactly the amount it received and passes that amount to Aave as the bound, so Aave never pulls more than the caller funded.
- The debt asset Aave does not pull is not swapped. It returns to the caller inside the caller payout, so oversizing debtToCover costs the caller nothing at LPVaultSwap.
- For a debt asset with a transfer fee, LPVaultSwap uses the amount that arrived as Aave's bound, and the fee on the funding and on the payout falls on the caller.
The public flash liquidation helper
A caller that holds no debt asset uses the public flash liquidation helper. It is a periphery contract outside the core contracts: immutable, with no owner, admin, upgrade path, setter, sweep or rescue function, and holding no funds or allowances between transactions. One public instance per chain borrows from that chain's Aave V3 Pool: the Core Pool on Ethereum, and on Base the Pool at 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5. Anyone can use it, and no core contract calls it.
- The caller calls
flashLiquidatewith the liquidation parameters, a flash amount up to debtToCover, a maximum premium, a top-up bound and its own minimum net payout. - The helper flash-borrows the debt asset from the Aave V3 Pool with its flashLoan function, which waives the premium for an address that holds Aave's FLASH_BORROWER role.
- Inside the Pool's callback, the helper calls liquidate with the parameters unchanged. LPVaultSwap treats it as an ordinary caller: it pulls the funding from the helper and pays the caller payout to it.
- When liquidate returns, the helper repays the Pool its principal and premium from that payout, pulling a top-up from its caller up to the bound if the payout falls short.
- Only after the loan is repaid does the helper pay the rest to its caller.
The deployment payload requests FLASH_BORROWER for the public helper on each chain. Until Aave grants it, each loan carries the Pool's premium (5 bps at launch). The premium, including the premium on any part of the loan the debt did not need, comes out of the caller's payout. It never reduces Avana's fee or the borrower surplus. A payout too small to repay the loan reverts the whole transaction.
Operator helpers
An operator can deploy its own instance of the operator variant of the helper. It accepts calls only from its bound signer, pulls inventory and top-ups only from the operator's funding Safe, pays only to that Safe, and caps each top-up at a fixed share of debtToCover set at deployment. A compromised signer key can then only start liquidations that pay the operator's own Safe, and can lose at most the bounded top-up per call. An operator's own helper holds no FLASH_BORROWER grant unless an Aave proposal adds one, so it pays the Pool premium.
When flash liquidity is short
When the Aave V3 Pool is short of the debt asset, paused, not enabled for flash loans, or charges more than the caller accepts, the helper reverts before LPVaultSwap is called and nothing changes. The caller then funds debtToCover from its own balance or asks for a smaller amount. Each committed operator holds, on each chain, debt-asset inventory of at least the largest single debtToCover that chain's caps allow, so liquidation never depends on the Pool.
Avana's core flash source, read from the MarketRegistry, still exists, but only repay with collateral uses it. A liquidation never calls it.
What Never Blocks Liquidation
LPVaultSwap never reads the MarketRegistry's pause state, the pause reason, a circuit breaker or a configuration-drift reason. Both liquidate and settlePending run in every one of these states:
- application pause states None, Frozen, Paused(General) and Paused(MintPathSuspect);
- any market, debt or POOL_DEPTH breaker tripped;
- any Spoke setting drifted (CONFIG_DRIFT);
- a market in Offboarding or in its wind-down ramp, and a frozen Aave reserve;
- a frozen borrower wallet;
- zero active committed operators on the chain, which halts new borrowing but leaves liquidate open to every address;
- an Aave V3 Pool that is short of flash liquidity or paused, because a caller can always fund the call from its own balance;
- a pool spot price at any distance from the oracle price. There is no pool spot gate, so a moved pool never reverts a liquidation or changes its route mode.
Pause states, breakers and drift stop actions that add risk, such as new pledges and borrowing. They stop no action that reduces risk. A liquidation that cannot run lets an unhealthy account's loss grow toward a deficit, while repayment and debt-free withdrawal stay open anyway.
What Can Stop Liquidation
No Avana pause, circuit breaker, configuration drift or address freeze stops liquidation, and neither does an Aave freeze of a reserve. Liquidation waits only for the following:
- Stale prices of the seized market or the repaid debt reserve, as described above. The account's other debt reserves can still be repaid meanwhile.
- The chain's sequencer gate on Base: down, or the grace period after a restart for accounts at or above a health factor of 0.95.
- Aave-side halts: a halted or deactivated CDP Spoke on its home or funding Hub, or a paused vault-token or debt reserve. Aave's own errors (SpokeHalted, SpokeNotActive, ReservePaused) pass through unchanged, and Avana cannot override them.
- Settlement legs: no usable swap route for a token, or a recovery below the floor that the caller does not top up. Either reverts the call with nothing changed.
An address freeze stops only the frozen address's direct calls to LPVaultSwap. It cannot stop that address from liquidating through the public helper, and it never stops anyone else.
The listing payload agreement commits the Aave DAO to contain a faulty CDP Spoke first with a vault-token reserve freeze and a draw cap of 0, which leave liquidation open, and to halt or pause only a faulty Spoke. During an Aave halt, keepers keep their liquidations prepared at every block, with the helper's flash amount checked against the Aave V3 Pool's idle liquidity and their own funds ready for the rest, and submit them in ascending health-factor order in the first block after the halt is lifted.
If both swap routes of a token fail, monitoring raises an alert, and a guardian freezes new borrowing in the market once the approved routes are confirmed unable to settle valid liquidations at the required size. Liquidation, repayment and debt-free exits stay open while the routes are replaced.
Committed Operators
LPVaultSwap's keeper list is a registry of committed operators, one per chain covering every Hub of that chain. Each registered operator commits to liquidate every account below a health factor of 1 on its chains, whatever the account's size and whether or not the bonus covers the gas.
The registry gates no call. A registered operator has no power any other caller lacks: everyone uses liquidate with both route modes and every check. The registry feeds three things only: the keeper floor, the borrowing halt when no active committed operator remains, and monitoring of how fast each account below a health factor of 1 is liquidated.
- At launch, Avana's keeper is the only committed operator on each chain. It runs primary instances plus a standby on separate infrastructure. Avana names its address per chain, funds it with that chain's debt assets and pays its gas.
- Others, such as Aave Labs or a risk provider, are added through the timelock at the normal delay, up to 32 per chain.
- An operator registers its own key or Safe that calls liquidate, or its own operator helper. The public helper is never registered, because it commits to nothing.
- The function and event names keep the word keeper (addKeeper, removeKeeper, isApprovedKeeper, activeKeeperCount, getKeepers, KeeperAdded, KeeperRemoved). In them, keeper means committed operator.
| Item | Value |
|---|---|
keeperFloor | 1 active (registered and unfrozen) committed operator per chain: Avana's keeper at launch |
MAX_KEEPERS | 32 committed operators per chain |
addKeeper | Timelock operation at the normal delay (5 days). Only the Aave governance executor can cancel it. It reverts for a frozen address, for an address already registered, and when 32 operators are registered. |
removeKeeper | Timelock operation at the short delay (12 hours). It reverts with KeeperFloor if fewer than keeperFloor active committed operators would remain. |
Zero active operators halts borrowing, never liquidation
If 0 active committed operators remain on a chain, the RiskModule halts new borrowing and withdrawals with debt on every CDP Spoke of that chain (LiquidationHalted), because no party is then bound to liquidate accounts whose bonus does not cover the gas. Liquidation itself never halts: liquidate stays open to every address. The RiskModule halts a debt reserve in the same way when some market token has no usable swap route into its asset (DebtLiquidationHalted). Repayment, fee collection and debt-free withdrawal stay open.
How the Aave DAO liquidates
The Aave DAO liquidates Avana accounts through LPVaultSwap like anyone else: through liquidate from its executor or any address it controls, at once and with no Avana action, directly or through the public flash liquidation helper. It can also have a committed operator of its choice registered through the timelock at the normal delay. A direct liquidationCall by the DAO reverts on the vault token's transfer rule, like any other.
Gas and Small Accounts
Every account is liquidated, whatever its size, and no liquidation depends on a keeper's profit. Avana has no minimum debt and no minimum repayment on any chain. Avana's keeper liquidates every account below a health factor of 1, repays as much as Aave allows per call, and Avana pays its gas as its own cost.
What the protocol bounds is the gas of one call, so that the largest account always fits in one transaction. A liquidation that touches n records uses about this much gas, measured on a fork of each chain:
G(n) = 1,310,000 + 240,000 × n- A one-record liquidation uses about 1.55M gas, which is about $3 at a gas price of about 1 gwei.
- An account holds at most 16 records per market, so the largest liquidation uses 5.15M gas, below the 16,777,216 per-transaction gas limit.
- The gas model of each chain is stated in gas units: execution gas on Ethereum, and execution gas plus each transaction's L1 data fee on Base. The gas price feeds only the keeper's gas budget; no protocol rule reads it.
Address Freeze and the Helper
The address freeze is the only check on the caller of liquidate. A frozen address that calls LPVaultSwap directly reverts with AddressIsFrozen. The freeze binds only the address that calls LPVaultSwap:
- A frozen address that goes through the public flash liquidation helper reaches LPVaultSwap as the helper, so the freeze does not stop it.
- Freezing the public helper itself would stop every caller that uses it.
- Freezing a committed operator removes it from the keeper floor count. A freeze checks no floor, so a guardian may freeze even the last active operator.
- addKeeper reverts for a frozen address.
- A frozen borrower's own accounts are liquidated like any other.
A freeze therefore stops an address's direct calls and removes a frozen committed operator from the keeper floor. It cannot stop an address from liquidating.
Fees and Payouts
After the swaps, LPVaultSwap splits the proceeds in a fixed order, all in the debt asset that was repaid:
- Avana's fee: 20% of the oracle gain (the seized collateral's oracle value minus the debt repaid), capped by the realized gain (the recovery minus the debt repaid). A caller's routing cannot lower it while the realized gain covers it, and it never makes a liquidation revert by itself.
- Borrower surplus: any recovery above the seized collateral's oracle value, paid to the borrower's wallet. It is non-zero only when the swap routes beat the oracle price.
- The caller: everything else. That is the funding Aave did not use, the recovered principal and the caller's reward (the rest of the oracle gain, capped by what was realized). It is paid directly to the caller, or the whole transaction reverts.
This fee is Avana's only on-chain revenue. Avana charges no fee on borrow interest, and no Avana contract reimburses gas.
Best-effort fee near the slippage limit
In a market whose slippage allowance reaches the limit the bonus sets, the recovery floor falls to about the debt repaid. A caller that routes the recovery down to the floor then leaves almost no realized gain and can reduce Avana's fee to about zero, so the fee there is best-effort. Avana accepts this: the floor still protects the debt repaid and the borrower, whose loss is fixed by Aave's bonus either way.
Recovery below the debt repaid
Aave pulls the repayment out of the caller's own funding, so the caller always holds the debt it repaid. A recovery a few units below the debt repaid, which the floor's rounding allowances permit so that dust liquidations settle, reduces only the caller's payout. No Avana contract pays any part of a settlement, and Avana's keeper accepts that loss. A caller that borrowed through a helper covers it through the helper's top-up bound, or the helper reverts.
Refused payouts
Avana's fee, the borrower surplus and any route residue or dust leg owed to the caller are delivered with a gas-limited transfer. If the token refuses one of them, for example because the recipient is on the token's blocklist, the amount goes to Avana's payout escrow (the PayoutEscrow contract), credited to that recipient, who claims it later. The liquidation still completes. Holding refused payouts is the escrow's only job.
The caller payout is never escrowed. It includes the caller's returned funding, and a flash-funded caller repays its loan from it in the same transaction, so it is paid directly or the call reverts. A blocklisted caller blocks only its own call; any other address can liquidate the account.
The formulas, the payout order and worked numbers are on the flow page: Liquidation Flow.
Deficits and Multi-Debt Accounts
Aave reports a deficit inside its liquidation call only when the call empties the account's collateral and debt remains. It then reports the remaining debt of every borrowed reserve, each on its funding Hub and in that reserve's asset, and zeroes the account's debt. Avana accepts this behaviour unchanged. The Avana Umbrella (Coverage Spoke) of each affected Hub and asset covers its deficit within the coverage window, never with another asset's or another Hub's coverage.
A call that reports a deficit settles like any other. If the recovery floor or the funding check fails, the whole transaction reverts, deficit report included. A borrower surplus is still paid when the same call leaves a deficit, because the deficit is debt the collateral could not cover at oracle prices, while the surplus is what the collateral produced above those prices. Avana does not net one against the other.
After a full seizure, every record of the account stays open with 0 credited units. The depositor can collect fees and take the position back with the AaveAdapter's releaseZeroCredit, which needs no debt check. Callers skip accounts with no collateral left, because Aave has already reported their deficit.
An account with several debt reserves is liquidated by successive calls, one debt reserve each, in the order the caller chooses. A committed operator continues until the health factor is at least 1, when Aave rejects further calls, or a deficit has been recorded.
Not in the Design
Earlier versions of these docs described mechanisms that are not part of the protocol. None of the following exist:
- settling a whole position at once, a per-market choice of how to settle, and in-kind settlement;
- swaps through an off-chain or batch-settled order protocol;
- flash minting GHO, and buying the debt asset with GHO;
- a flash loan taken by LPVaultSwap during a liquidation: the caller funds every repayment;
- a second, separate liquidation function for unregistered callers, and a keeper-only rule: liquidate is the one entry point, open to every address that is not frozen;
- a protocol settlement budget or any Avana balance that pays settlement gaps;
- escrowing the caller's payout;
- a health factor across several positions: each account holds one market.
