Skip to main content
Avana logo

Liquidators

How any address calls LPVaultSwap, funds the repayment directly or through the flash liquidation helper, sizes the call, and what each failure means.

Overview

An account can be liquidated once Aave allows it: its health factor is below 1 and the prices of its market and the repaid debt reserve are fresh. Every liquidation goes through LPVaultSwap on its chain, which has one liquidation entry point and one settlement entry point:

  • liquidate: open to any address that is not frozen, with either route mode, PrimaryThenBackup or BackupOnly.
  • settlePending: open to any address; settles stranded units and pays the caller nothing.

There is no keeper check and no second, restricted path. Every check that protects Avana and the borrower runs on every call, whoever the caller: the health factor, the price, grace and sequencer gates, the Hub share check, the recovery floor with its per-leg minimums, Avana's fee, the borrower surplus, the deadline, the caller's minimum payout and the address freeze.

The caller brings the debt asset. It funds the call from its own balance, or through Avana's public flash liquidation helper, which flash-borrows the debt asset from the chain's Aave V3 Pool, calls liquidate and repays the loan from the caller's payout. An operator may also run its own helper. LPVaultSwap itself takes no flash loan in a liquidation.

The caller is always msg.sender at LPVaultSwap: it funds the call and its payout goes to msg.sender. Through a helper, msg.sender is the helper. No recipient, route, recovery-floor override or executable calldata is taken from the caller. Every amount is in base units of the debt asset being repaid.

Eligibility rules and the reasons liquidation is never paused are on the design page: Liquidation Design.

The liquidate Call

Any address that is not frozen calls liquidate(LiquidationParams params), which returns a LiquidationResult. One call liquidates one account, in its one collateral market, against one debt reserve. A registered committed operator has no power any other caller lacks.

FieldMeaningRule
proxyThe borrower's PositionProxy, the Aave account for one marketMust be a valid proxy of the market's vault token, else UnknownProxy
marketIdThe collateral market to seize fromMust be the proxy's market; Registered, Active and Offboarding markets are accepted
debtReserveIdThe debt reserve to repayMust be enabled for the Spoke, else UnknownDebtReserve
debtToCoverThe debt asset LPVaultSwap pulls from msg.sender; the amount that arrives is Aave's boundGreater than 0; a bound, never an exact amount
routeModePrimaryThenBackup or BackupOnlyEither value, for every caller; applied as set, and no pool price changes it
minAmountsOptional least amount of each market token the unwind must returnEmpty, or one value per market token; it can only make the call revert
deadlineLast valid block timestamp, in secondsChecked first, before the lock and any external call, else DeadlineExpired
minPayoutThe smallest caller payout accepted: the funding plus the smallest net payoutChecked after the payout waterfall, else PayoutTooLow
maxShortfallThe most of the caller's own debt asset the call may pull, beyond its funding, to close a gap below the recovery floor0 disables the top-up

The struct has no funding or flash-amount field: the caller always funds debtToCover itself, and how it obtains the debt asset is outside LPVaultSwap. debtToCover and maxShortfall are each at most 2^128 − 1. The deadline, minPayout and minAmounts change no amount, route or recipient: they can only make the call revert. The recovery floor is computed from oracle prices alone, so minPayout protects the caller while the floor protects Avana and the borrower.

The LiquidationResult returns the debt asset, the debt repaid, the units seized, the amount of each token the unwind returned, the caller funding received, the amount recovered, the recovery floor, Avana's fee, the caller reward, the caller payout, the borrower surplus and the shortfall pulled from the caller.

A direct call to the CDP Spoke's liquidationCall from any other address fails, because the vault token accepts seized collateral only to LPVaultSwap. The Hub's transfer to that caller reverts with UnauthorizedTransfer and the account is unchanged.

Route Modes

Each market has, for each of its tokens and each enabled debt asset, a primary and a backup swap route recorded in the MarketRegistry. Both are held to the same recovery floor and per-leg minimums, and both modes are open to every caller.

ModeBehaviour
PrimaryThenBackupCalls the primary route if it is usable. If the primary is not usable or reverts, emits RouteFailed for a revert and calls the backup if it is usable.
BackupOnlyCalls only the backup route of each token. It only selects an approved route held to the same floor and leg minimums.

If no usable route converts a token, the call reverts with NoRouteAvailable. There is no in-kind fallback: the caller waits for a standby or replaced route. A token that is itself the debt asset needs no route.

Funding a Call

The caller is LPVaultSwap's only source of the debt asset. Before any other transfer, LPVaultSwap pulls debtToCover from msg.sender and measures what arrived, Kf, as its own balance change. It reverts with FundingMismatch unless Kf is above 0 and at most debtToCover. For a debt asset without a transfer fee, Kf equals debtToCover.

  • LPVaultSwap approves the CDP Spoke for exactly Kf and passes Kf to Aave's liquidationCall, with receiveShares set to false. Aave pulls the repayment D, at most Kf.
  • The Kf − D that Aave did not use is not swapped. It returns to the caller inside its payout, with the recovered principal, in the same transaction. Oversizing debtToCover costs the caller nothing at LPVaultSwap.
  • Caller funds and the unused debt asset are outside the window in which the recovery R is measured, so prefunding cannot raise R.
  • Before calling, the caller approves LPVaultSwap for debtToCover, plus maxShortfall if it allows a floor top-up.

A caller without the debt asset uses the public flash liquidation helper or its own helper. When the Aave V3 Pool behind a helper is short, paused or charges above the caller's bound, the helper reverts before LPVaultSwap is called, and the caller funds the debt itself or uses a smaller amount.

Example: the Base V3 Pool holds about 0.13M idle GHO. The public helper refuses a 400,000 GHO loan before any state change, and Avana's keeper repeats the liquidation by calling liquidate directly with 400,000 GHO of its own.

Flash Liquidation Helper

The flash liquidation helper lets a caller that holds no debt asset liquidate. It is a periphery contract outside the core contracts: public and immutable, with no owner, admin, upgrade path, setter, sweep or rescue function, and it holds no funds or allowances between transactions. One public instance per chain borrows from that chain's Aave V3 Pool: the Ethereum Core Pool, and on Base the Pool at 0xA238Dd80C259a72e81d7e4664a9801593F98d1c5. Anyone can use it.

LPVaultSwap treats every helper as an ordinary caller. The helper is msg.sender: it funds liquidate and receives the caller payout, and no check or formula of LPVaultSwap depends on the loan.

Interface

The public helper implements IFlashLiquidator, whose entry point is flashLiquidate(FlashLiquidationRequest request), returning the net payout. It also exposes executeOperation, the Pool callback, and the views maxFlashLoan, flashPremium, POOL, LP_VAULT_SWAP, MARKET_REGISTRY and PARAMETER_STORE.

Request fieldMeaning
paramsThe LiquidationParams, passed to liquidate unchanged
flashAmountThe loan F, above 0 and at most debtToCover; any rest of debtToCover comes from the caller
maxPremiumThe most premium the caller accepts on the loan
maxTopUpThe most debt asset the helper may pull from the caller after liquidate to repay the loan and premium
minPayoutThe smallest net payout accepted after the loan and premium are repaid

The request's minPayout is net of the loan; params.minPayout stays the gross bound LPVaultSwap checks on its payout, and a helper's caller may leave it at 0 because the helper's own check binds.

What the helper does

  1. It checks, in order, that none of its calls is open (ContextActive), that the caller is the signer in the operator variant (NotSigner), and that the loan is above 0 and at most debtToCover (InvalidFlashAmount). It reads the debt asset from the MarketRegistry and reverts with InsufficientFlashLiquidity if the loan exceeds what the Pool can lend. It refuses a Pool recorded as an Avana Hub (FlashSourceIsHub), at deployment and on every call.
  2. It records a single-use context in transient storage: the Pool, itself as initiator, the debt asset, the loan, maxPremium, maxTopUp, the hash of params, its payer and its payout recipient.
  3. If the loan is smaller than debtToCover, it first pulls the difference from the payer.
  4. It calls the Pool's flashLoan. It uses flashLoan, not flashLoanSimple, because only flashLoan waives the premium for an address holding FLASH_BORROWER.
  5. In the executeOperation callback it requires the recorded Pool, itself as initiator, one asset, the recorded asset, amount and params hash, and an active, unused context; otherwise it reverts with InvalidFlashCallback. It reverts with PremiumTooHigh above maxPremium, and with FlashFeeTooHigh when the premium exceeds maxFlashFeeBps of the loan.
  6. It approves LPVaultSwap for exactly debtToCover, calls liquidate(params), resets the allowance and measures the caller payout as the rise of its own balance.
  7. It owes the loan plus the premium. If the payout is smaller, it pulls the difference from the payer up to the top-up bound and reverts with TopUpExceeded beyond it, which reverts the whole liquidation. It then approves the Pool for exactly what it owes.
  8. After flashLoan returns, it computes its net payout (payout plus top-up, less loan and premium), reverts with PayoutTooLow below the request's minPayout, and sends the net payout and any market-token residues or dust legs to its payout recipient. It emits FlashLiquidated.

The helper takes no swap step, route, foreign recipient or executable calldata: the unwind and the routes stay in the core. It pays out only after flashLoan returns, so nothing leaves the helper while the loan is open.

Premium and quotes

  • The premium is 0 once Aave grants the helper FLASH_BORROWER on the Pool, which the deployment payload requests. Otherwise it is the Pool's premium, 5 bps at launch.
  • flashPremium quotes 0 while the helper holds FLASH_BORROWER, otherwise the premium rounded up. Example: 1,950 USDC at 5 bps without the role quotes 0.975 USDC; with it, 0.
  • maxFlashLoan returns the smaller of the reserve's aToken balance and its virtual underlying balance, or 0 if the reserve is inactive, paused or not flash-enabled.
  • The premium on the whole loan, including any part the debt did not need, and any transfer-fee loss on the helper's own transfers, come out of the caller's payout. They never reduce Avana's fee or the borrower surplus.

Public helper and operator helpers

  • The public helper takes its payer and payout recipient from msg.sender, so a caller can pull from and pay only itself. It is named in each chain's deployment manifest and is never registered as a committed operator, because it commits to nothing.
  • The public helper has no claim function. A residue or dust leg that LPVaultSwap could not deliver to it stays credited to the helper in the PayoutEscrow; that happens only when a market token refuses transfers to the helper.
  • An operator may deploy its own helper, which implements IOperatorFlashLiquidator with the views SIGNER, FUNDING_SAFE and MAX_TOP_UP_BPS. Only SIGNER may call it, it pulls inventory and top-ups only from FUNDING_SAFE and pays only to it, and each top-up is bounded by MAX_TOP_UP_BPS of debtToCover as well as maxTopUp.
  • Its claimEscrowed function, callable only by SIGNER, claims the helper's PayoutEscrow credit to FUNDING_SAFE. The operator registers this helper's address, or its signer's address when it calls liquidate directly, as its committed operator.
  • An operator's own helper holds no FLASH_BORROWER grant unless an Aave proposal adds one, so it pays the Pool premium.
Example: with MAX_TOP_UP_BPS set to 100, a call with debtToCover 9,800 USDC can pull at most 98 USDC of top-up from the Safe, whatever maxTopUp the signer sends. A compromised signer key can only start liquidations that pay the operator's own Safe.

Committed Operators

The keeper list on each chain's LPVaultSwap is a registry of committed operators, one per chain covering every Hub. 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: liquidate is open to every address that is not frozen.

  • The registry feeds keeperFloor, the borrowing halt at zero active operators, and monitoring, which tracks how fast each account below a health factor of 1 is liquidated.
  • At launch the only committed operator on each chain is Avana's keeper. It runs primary instances plus a standby on separate infrastructure; Avana funds it with each chain's debt assets and pays its gas, and it repays as much as Aave allows per call, so no liquidation depends on a keeper's profit.
  • Others, such as Aave Labs or a risk provider, are added through the timelock at the normal delay, up to 32 per chain. The Aave DAO can have a committed operator of its choice registered.
  • The registered address is the operator's own key or Safe that calls liquidate, or its per-operator helper. The public helper is never registered.
  • Each committed operator holds, on each chain, debt-asset inventory of at least the largest single debtToCover the caps of that chain's markets allow.
  • keeperFloor is 1 active committed operator per chain. When none remains, new borrowing and withdraw-with-debt halt on every CDP Spoke of the chain with LiquidationHalted. Liquidation itself never halts: liquidate stays open to every address.
Function or viewRule
addKeeper(operator)Timelock at the normal delay (5 days); because it restores liquidation capacity, only the Aave governance executor can cancel it. Reverts with InvalidKeeper for the zero address or a registered operator, AddressIsFrozen for a frozen address, and TooManyKeepers above 32.
removeKeeper(operator)Timelock at the short delay (12 hours). Reverts with KeeperFloor if fewer than 1 active committed operator would remain on the chain.
isApprovedKeeper, activeKeeperCount, approvedKeeperCount, getKeepersViews of the registry; the active count excludes frozen operators. No liquidation check reads them.
KEEPER_FLOOR, MAX_KEEPERS1 and 32 per chain

The functions, views and the KeeperAdded and KeeperRemoved events keep the word keeper in their names; there it means committed operator. A removed operator returns to the registry only through addKeeper, and removal never stops its liquidate calls.

Example: the Ethereum governance multisig schedules addKeeper(0x3b9f…e210) for a risk provider on 2 March at 12:00 UTC. It executes on 7 March at 12:00 UTC, and from that block the operator counts toward keeperFloor and is monitored against its commitment. Its liquidate calls were accepted before that block too, like anyone's.
Example: Ethereum has two committed operators, Avana's keeper K1 and a risk provider K2. Removing K2 leaves one, and borrowing continues; a removal of K1 then reverts. If K1's key is compromised, a guardian freezes it at once, because a freeze is never blocked by the floor. With zero active committed operators, new borrowing on every CDP Spoke of Ethereum halts while liquidate stays open to every address, until a replacement is registered.

The Aave DAO liquidates Avana accounts like any other caller: through liquidate from its executor or any address it controls, directly or through the public helper, at once and with no Avana action.

Caller Payout

After the swaps, LPVaultSwap splits the result in the debt asset. V is the oracle value of the seized units, R the debt asset recovered and R′ the recovery plus any shortfall top-up.

TermFormula
Oracle gain Gmax(0, V − D)
Realized surplus Ymax(0, R′ − D)
Avana fee Amin(⌊G × 20%⌋, Y)
Caller reward Krmin(Y − A, G − A)
Borrower surplus BY − A − Kr
Caller payout keeperOutKf + R′ − D − A − B
  • What the caller receives: when R′ is at least D, keeperOut is Kf + Kr, the whole funding back (the unused part and the recovered principal) plus the reward. When R′ is below D, keeperOut is Kf − (D − R′): the caller bears the difference. keeperOut is never negative.
  • The caller's net result is keeperOut − Kf − shortfall. Through a helper, the helper also repays the loan and premium from keeperOut before paying its caller.
  • Avana's fee is 20% of the oracle gain, capped by the realized gain, so a caller's routing cannot lower it while the realized gain covers it. Any recovery above the seized collateral's oracle value goes to the borrower.
  • In a market whose slippage allowance reaches the limit the bonus sets, a caller that routes the recovery down to the floor can reduce Avana's fee to about zero, so the fee there is best-effort. The floor still protects the debt repaid and the borrower.
  • Conservation: Kf + R + shortfall = D + A + B + keeperOut.

Payout order and delivery

  1. Avana's fee A goes to the fee recipient (InvalidFeeRecipient if it is the zero address).
  2. The borrower surplus B goes to the account's wallet, with the event BorrowerSurplusPaid.
  3. keeperOut goes to msg.sender by a plain transfer. Route residues and dust legs also go to msg.sender.

A transfer of the fee, the borrower surplus, a route residue or a dust leg that reverts, returns false or runs out of gas does not revert the liquidation: the amount goes to the payout escrow (the PayoutEscrow contract), credited to its recipient, who claims it later. The caller's payout is the exception. keeperOut includes the returned funding and a flash-funded caller repays its loan from it, so it is never escrowed: it is paid directly to msg.sender or the whole call reverts. A blocklisted caller blocks only its own call; any other address can liquidate the account.

minPayout and deadline

Because keeperOut includes the returned funding, minPayout is the funding plus the smallest net payout the caller accepts. Callers set it at least 1% of the previewed net payout below the preview: minPayout ≤ debtToCover + ⌊0.99 × (previewed keeperOut − debtToCover)⌋. The call reverts with PayoutTooLow if keeperOut falls below it.

Example: a caller funds 9,800 USDC and sets minPayout to 9,909 USDC, the funding plus a net 109 USDC, more than 1% below the previewed net 110.8 USDC. The liquidation pays keeperOut = 9,910.8 USDC and succeeds. Had the routes returned 9,935 USDC, the reward would be 95.8 USDC, keeperOut 9,895.8 USDC, and the call reverts with PayoutTooLow(9,895,800,000, 9,909,000,000).

The deadline is checked first, so a transaction left pending cannot execute later at a price and bonus its caller never saw. 120 s is 10 Ethereum blocks and 60 Base blocks.

Sizing a Call

Callers size each call by simulating it against the current block: LiquidationParams that can be sent unchanged, plus the expected seizure, the recovery floor, the gross and net payout, and the loss the caller may bear at oracle prices.

  • The preview sets routeMode to PrimaryThenBackup when the primary route of every pool token is usable, else BackupOnly. It leaves minPayout and maxShortfall at 0 and minAmounts empty, so the caller sets its own risk and capital limits.
  • Set debtToCover to the previewed Aave amount: the repayment to Aave's target health factor, or the whole debt in the reserve when Aave's dust rule applies. There is no minimum size per call.
  • Aave V4's dust rule can raise the repayment needed to finish a liquidation to the whole debt. For a whole-debt close callers quote debtToCover as the whole debt plus a 500 bps margin, rounded up, or stays at least 500 bps below Aave's dust boundary. Aave pulls only what it needs, and the rest returns inside keeperOut.
  • Set minPayout to the funding plus the previewed net payout, less at least 1% of that net payout.
  • Set a deadline a short time ahead. 120 s is 10 Ethereum blocks and 60 Base blocks.
  • Through a helper, read its maxFlashLoan and flashPremium, and set its top-up bound to at least the premium plus the previewed caller loss, less the previewed net payout.

Caller inputs are bounds, not exact values. A borrower who repays 1 wei, or repays enough to leave the debt just under the dust threshold, changes the amounts but not the outcome. Oversizing costs a self-funded caller nothing; through a helper it costs only the premium on the part Aave did not use.

Example: a simulation shows a whole debt of 1,950 USDC with a 500 bps margin, so debtToCover is 2,047.5 USDC. A 1-wei repayment lands first. Aave pulls 1,949.999999 USDC, and the 97.500001 USDC it did not pull returns to the caller inside keeperOut.
Example: the same 2,047.5 USDC borrowed whole through the public helper at 5 bps carries a 1.02375 USDC premium. LPVaultSwap pays the helper keeperOut = 2,118.3 USDC; the helper repays 2,048.52375 USDC and pays its caller 69.77625 USDC. The premium on the unused 97.5 USDC, 0.04875 USDC, falls on the caller alone.

Rounding loss

The recovery floor may sit slightly below the debt repaid so that dust liquidations settle, and that slack can leave the recovery a few base units under D. Such a shortfall reduces only the caller's payout; no Avana contract pays any part of it. For any recovery at or above the floor, the loss is at most one vault unit's value plus one raw unit per leg, the reserve's floor rounding allowance and a few base units of Aave rounding. Avana's keeper accepts that loss. A flash-funded caller covers it through the helper's top-up bound, or the helper reverts.

Shortfall top-up

A caller that sets maxShortfall above 0, and approves that much, lets each swap leg run at more slippage: the leg slippage rises by up to maxShortfall as a share of V, capped at 1,000 bps, so at most 10% more. After the swaps LPVaultSwap pulls the gap between the floor and R from the caller, or reverts with RecoveryBelowFloor if the gap exceeds maxShortfall. Avana's fee does not fall with it, and the borrower surplus is 0 whenever a shortfall is paid.

Example: V = 12,422.6 USDC, effective slippage 100 bps and maxShortfall 200 USDC. The legs run at 260 bps, the routes return 12,174 USDC, 123.373998 USDC is pulled from the caller, and the liquidation settles at full size.

Pending Settlement

The function settlePending(marketId, debtReserveId) settles vault tokens that an earlier, unsettled seizure left at LPVaultSwap's fixed address. Collateralization keeps those units backed by real pool tokens in a pending balance, reconciled from the borrower's records during the next seizure or withdrawal. Any address can call it, the pause state is not read, and it never runs inside a liquidation.

  1. Before taking the lock, LPVaultSwap requires a known market and a non-zero fee recipient. It settles the smaller of its own vault-token balance and Collateralization's pending units, and reverts with NothingPending if that is 0.
  2. It reads the sequencer gate (SequencerDown while down), pokes the market's LP Oracle and applies the collateral price gate (StalePrice).
  3. The AaveAdapter burns the units, and Collateralization releases the matching pool tokens to LPVaultSwap.
  4. Each token is swapped into the settlement asset over the market's routes in PrimaryThenBackup mode, with a slippage allowance of the smaller of the market's allowance and 30 bps.
  5. The recovery must reach the pending-settlement floor, else RecoveryBelowFloor.
  6. The recovered amount is added to the Avana Umbrella (Coverage Spoke) of the settlement reserve's funding Hub and asset through its public fund function.
  7. Any unconverted route residue goes to the fee recipient, or to the payout escrow if that transfer fails. The call emits PendingSettlementForwarded.

The caller receives nothing. The unsettled seizure already repaid debt and the borrower's records were already debited, so no waterfall applies. The Avana Umbrella is the layer that absorbs the loss of that incident. Each market names its settlement debt reserve at listing, its first enabled debt reserve, changeable at the normal delay.

A pending balance never blocks a liquidation. If the call reverts (price or sequencer gate, no usable route, the floor, or the Coverage Spoke refusing the funds), the tokens stay in custody backing the outstanding units, and anyone can repeat the call later.

Operator Practice

How Avana's keeper and other committed operators run liquidations:

  • Size by simulation: re-simulate each account at each new block and keep signed calls current, with the helper's flash amount checked against the Aave V3 Pool's idle liquidity and the operator's own funds ready for the rest.
  • Submit through private order flow on Ethereum, so a pending call is not front-run or left in the public mempool.
  • Poke oracles: the LP Oracle and DebtOracle poke function is a permissionless cache write that keepers run on every feed update. LPVaultSwap also pokes the seized market and the repaid reserve inside every call. A poke needs a minimum amount of gas, and a gas-starved poke reverts the whole liquidation.
  • Send one account per transaction. Separate transactions never contend for the lock, which is released at the end of each call.
  • On Base, size each block's flash loans to the Base Pool's idle debt asset and spread larger liquidations over successive 2 s blocks.
  • Answer RecoveryBelowFloor with a shortfall top-up from the operator's own funds or with an arbitrage bundle, never with repeated halving, whose gas would exceed the debt each call repays.
  • When the helper reverts because the Pool is short, paused or charges above the bound, call liquidate directly with the operator's own inventory.
  • During an Aave halt of a CDP Spoke, stop sending calls for that market, keep the prepared calls current, and submit them in ascending health-factor order in the first block after the halt is lifted.
  • Liquidate an account with several debt reserves with successive calls until its health factor is at least 1 or a deficit is recorded. Skip accounts with no collateral left.

Failed floors and route failures are not counted on-chain. Avana's monitoring records each RouteFailed event and each RecoveryBelowFloor or NoRouteAvailable revert, and raises an alert at 3 failures in 1 hour on a market. The guardian freezes new borrowing on the market only once the approved routes are confirmed unable to settle valid liquidations at the required size; liquidation, repayment and debt-free exits stay open.

Gas Model

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
  • One record: 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 about 5.15M gas. That is under half of the 16,777,216 per-transaction gas limit, so the largest account always fits in one transaction.
  • Ethereum counts execution gas. Base counts execution gas plus the L1 data fee of each transaction.
  • Avana budgets its keeper's gas per chain from this model, the expected number of liquidations and the gas price, plus the L1 data fee on Base. No protocol rule reads the gas price.
Example (Base): an account owing 40 USDC with one record falls below a health factor of 1. Its liquidation uses 1,550,000 gas. With a 2% bonus, a 0.3% swap cost and Avana's 20% share, the keeper's reward is (40 × 1.02 × 0.997 − 40) − 0.2 × (40 × 1.02 − 40) = 0.6776 − 0.16 = 0.5176 USDC. Avana's keeper liquidates the account whether or not that covers the gas.

Example: Any Caller

Example values; each market's parameters are set at listing. The account is the USDC-debt account on the Uniswap v3 USDC/USDT market 1 on Ethereum, worked through fully on the examples page, and the caller is an address with no registration.

  1. The caller holds 9,800 USDC and approves LPVaultSwap for it.
  2. It calls liquidate with debtToCover 9,800 USDC, routeMode BackupOnly, a deadline 120 s ahead, minPayout 9,909 USDC and maxShortfall 0. If it were frozen, the call would revert with AddressIsFrozen.
  3. LPVaultSwap pulls Kf = 9,800 USDC. Aave repays D = 9,800 USDC and seizes 4,998 vault tokens, worth V = 9,996 USDC at oracle prices. The recovery floor is 9,895.039998 USDC.
  4. The backup route returns the same 4,952 USDC for the USDT leg, so R = 9,950 USDC and no shortfall is pulled.
  5. Avana's fee of 39.2 USDC goes to the fee recipient and the caller receives keeperOut = 9,910.8 USDC, a net 110.8 USDC.

Variant: through the public helper

A caller with no USDC sends the same params to the public helper with a flash amount of 9,800 USDC. When the helper holds FLASH_BORROWER the premium is 0: the helper receives 9,910.8 USDC, repays the Pool 9,800 USDC and pays its caller 110.8 USDC. On Bob's account from the examples page, where the helper pays a 5 bps premium, it repays 1,950.975 USDC from a 2,020.8 USDC payout and pays its caller 69.825 USDC.

Freezes and Stops

Address freeze and the helper

A caller on the chain's freeze list reverts with AddressIsFrozen when it calls liquidate directly. The check runs after the deadline check. The freeze binds msg.sender only: a frozen address that calls through the public helper reaches LPVaultSwap as the helper, so the freeze does not stop it, and freezing the public helper would stop every caller that uses it.

A freeze therefore stops an address's direct calls and removes a frozen committed operator from keeperFloor; it cannot stop an address from liquidating. A freeze checks no floor and may freeze the last active operator. A frozen wallet's own accounts are liquidated like any other.

What can stop a liquidation

No Avana pause, circuit breaker, configuration drift or address freeze stops liquidation, and an Aave freeze of a reserve does not either. Liquidation waits only for:

  • a fresh price of the market being seized and of the debt being repaid;
  • the Base sequencer check: no call while the sequencer is down, and for one hour after a restart only accounts below a health factor of 0.95;
  • Aave-side halts: a Hub halt or deactivation of the Spoke, or an Aave pause of the vault-token or debt reserve.

The listing payload commits the Aave DAO to contain a Spoke with a reserve freeze and a zero draw cap, which leave liquidation open, and to halt or pause only a faulty Spoke. A short or paused Aave V3 Pool stops only helper-funded calls: a caller that holds the debt asset still liquidates.

Failures and Responses

Every failure reverts the whole transaction: the helper's flash loan if any, seizure, burn, record debits, deficit report, shortfall top-up and payouts. None depends on the pause state, a breaker or a drift reason. A caller that is not a committed operator causes no failure.

ErrorCauseResponse
DeadlineExpiredThe block timestamp is past the deadlineRe-preview and resubmit
AddressIsFrozenThe direct caller is on the chain's freeze listAnother address must call
LockHeldThe protocol lock is already held (re-entry)Send one account per call
InvalidAmountdebtToCover is 0, debtToCover or maxShortfall is above 2^128 − 1, or minAmounts has the wrong lengthFix the parameters
UnknownProxy, UnknownMarket, UnknownDebtReserveThe proxy, market or debt reserve does not match the registryFix the parameters
NotLiquidatableThe health factor is at least 1Nothing to do
StalePriceThe market's price is Cached or Expired, too old, or in a feed disagreement pauseWait for a fresh price or a standby price route
DebtPriceStaleThe repaid reserve's DebtOracle is not Live or too oldRepay the account's other debt reserves meanwhile
GraceHealthFactorInside a recovery grace window with a health factor of 0.95 or moreRetry after the window or once the health factor is below 0.95
SequencerDownThe Base sequencer is reported downWait for the restart
SequencerGraceWithin 3,600 s of a sequencer restart with a health factor of 0.95 or moreRetry after the grace period
SharesNotEqualAssetsThe home Hub's shares differ from its assets for the vault-token assetRaised as an alarm for the emergency playbooks
FundingMismatchThe funding received is 0 or above debtToCover, or the shortfall received differs from the shortfallCheck approvals and balances
NothingSeizedAave seized 0 vault-token unitsSize the call larger
NoRouteAvailableNo usable route converts a token, or the routes the mode allows all failTry the other route mode, or wait for a standby or replaced route
RecoveryBelowFloorThe recovery is below the floor by more than maxShortfallRaise maxShortfall or bundle an arbitrage
InsufficientProceedsThe balance cannot pay the fee, surplus and payout; ruled out by construction, a guard against a faulty measurementReport it; it signals a fault
PayoutTooLowkeeperOut is below minPayout, or a helper's net payout is below the request's minPayoutRe-preview, or accept a lower payout
InsufficientGasToo little gas left before a gas-limited payout transferRetry with more gas
InvalidFeeRecipientThe fee recipient is the zero addressGovernance sets a fee recipient
Transfer of keeperOut failsmsg.sender cannot receive the debt asset, for example an address its issuer blocksCall from an address that can receive it
Aave errorsSpokeHalted, SpokeNotActive, ReservePaused or another upstream checkPassed through unchanged; follow the Aave halt procedure

Helper errors

These revert in the helper, all but the last two before LPVaultSwap is called, and nothing changes.

ErrorCauseResponse
ContextActive, NotSignerA nested or reentrant helper call, or a caller other than the signer of an operator helperOne account per call; call from the signer
InvalidFlashAmountThe flash amount is 0 or above debtToCoverFix the request
InsufficientFlashLiquidityThe Pool's idle debt asset is below the flash amount, or the reserve is inactive, paused or not flash-enabledSmaller flash amount with the rest from own funds, or call liquidate directly
PremiumTooHigh, FlashFeeTooHighThe Pool's premium is above maxPremium, or above maxFlashFeeBps of the loanRaise maxPremium within the cap, or fund from own balance
FlashSourceIsHubThe helper's Pool is recorded as an Avana HubFund from own balance
InvalidFlashCallbackA callback not from the recorded Pool, with a wrong initiator, asset, amount or params, or with no active unused contextNothing to do; forged or replayed callbacks fail
TopUpExceededkeeperOut plus the allowed top-up is below the loan and premiumLarger top-up bound, or fund from own balance
PayoutTooLowThe net payout after repayment is below the request's minPayoutRe-preview, or accept a lower payout

A transfer of Avana's fee, the borrower surplus, a route residue or a dust leg that fails, for example to an address an issuer has blocked, does not revert the liquidation. The amount goes to the payout escrow, credited to its recipient, who claims it later.