Security
The invariants Avana preserves, the attacks it blocks or bounds, the dependencies it relies on, and how each is verified.
Overview
This page summarises Avana's security specification: the global invariants every transaction preserves, the attack scenarios the design blocks or bounds, the external dependencies it relies on, the main design decisions, and how all of it is verified. Internal identifiers (INV-, ATTACK-, EXT-) are given so reviewers can find each item in the specification.
| Item | Count |
|---|---|
| Global invariants | 99 (INV-001 to INV-099) in 11 groups |
| Attack scenarios | 197 (ATTACK-001 to ATTACK-197) in 16 categories |
| External dependencies | 32 (EXT-001 to EXT-032) |
| Design decisions | 400 recorded decisions with their reasons |
| Requirements traced | 3,454 |
Global Invariants
Each invariant holds at the end of every transaction, in every price state, pause state, breaker state, address-freeze state, sequencer state and governance state, on every chain and for every Hub, CDP Spoke, market and AMM integration, unless it states a narrower scope. The rules that preserve an invariant link to its ID.
| Group | Count | What it covers | Key invariants |
|---|---|---|---|
| Backing and custody | 9 | Every vault token is backed by credited units of a pledged position, and one position backs one record in one account. The Hub's vault-token balance, its added assets and the proxies' supplied shares stay equal. | INV-001 supply ≤ credited + pending units; INV-005 one position, one record; INV-007 an LPVault returns a position only to its depositor of record or LPVaultSwap; INV-058 reconcile on exit |
| Mint, burn and holders | 10 | Only the AaveAdapter mints and burns, balances move only on the allowed paths, and every seizure debits records largest-first with matching share and supply drops. | INV-009 mint only to a registered proxy; INV-011 transfer allowlist; INV-014 seizure check; INV-080 backing one-sided for any LPVaultSwap |
| Accounts and upgradeable custody | 8 | Each PositionProxy is a logic-free account that executes only Adapter calls, there is one proxy per (wallet, CDP Spoke, market), and each upgradeable contract has a stated blast radius. | INV-018 blast radius of upgradeable contracts; INV-063 Adapter-only proxy access; INV-064 one proxy per wallet, Spoke and market; INV-072 account-wide gates for new debt |
| Balances and approvals | 2 | No Avana contract keeps an allowance or an Avana-originated balance between transactions, and users approve only one position or an exact amount. | INV-021 zero allowances at the end of every transaction; INV-022 two kinds of user approval |
| Borrowing and pledging | 13 | Borrow-side gates (prices, freshness, Aave flags, drift, caps, breakers, freeze) run before new debt; caps are keyed by Hub; rescue units never support new debt. | INV-023 pre-borrow check; INV-025 health after borrow; INV-028 caps; INV-029 drift check; INV-069 minimum pledge value; INV-082 rescue units; INV-092 caps keyed by Hub |
| Liquidation and settlement | 24 | Who can liquidate, how much can be seized, the settlement balance in the debt asset, the caller's funding and rounding-loss bound, the Avana fee bound, the flash-source rules, per-asset coverage and the payout escrow. | INV-062 one liquidation entry point, open to any caller that is not frozen; INV-032 seizure bounded by debt × bonus; INV-035 settlement balance; INV-037 no settlement budget; INV-038 bounded caller loss below the debt funded; INV-039 no in-kind settlement; INV-070 settlement in the debt asset; INV-083 oracle minimum on every swap; INV-095 flash source rules |
| Liveness | 9 | Repay, fee collection, debt-free withdrawal and liquidation stay available; pauses, breakers and the address freeze never reach exits or liquidation; one liquidation always fits in one transaction. | INV-043 repay by any payer; INV-045 debt-free exit; INV-046 liquidation of an account below 1; INV-048 keeper floor; INV-081 stops never reach exits; INV-096 at most 16 records |
| Governance and structure | 13 | Every privileged change goes through the AvanaTimelock with its delays and cancellers; pause-state transitions; admin roles only for the timelock; the Lock has exactly two members. | INV-051 timelock only; INV-052 immutable contracts; INV-068 timelock timing; INV-084 admin roles only for the timelock; INV-085 address-freeze bounds; INV-091 the Lock |
| Oracle | 4 | The LPOracle never reverts and never returns 0, reports original source timestamps, honours the L2 sequencer gate, and an oracle switch never stops liquidation. | INV-055 never reverts, at least 1; INV-056 source timestamps; INV-098 sequencer gate; INV-099 oracle switch |
| System-level economic invariants | 4 | Solvency per debt asset, no zero-risk profit loop, conservative valuation by fair composition, and conservation of each settlement asset across sequences. | INV-074 solvency per debt asset; INV-077 no zero-risk profit loop; INV-078 fair composition; INV-079 settlement-asset conservation |
| Aave-side bounds Avana relies on | 3 | Draw caps per debt asset, the standard-Spoke settings and cross-Hub credit lines capped by the funding Hub. | INV-057 draw gate; INV-093 standard-Spoke settings; INV-094 cross-Hub lines |
Attack Scenarios
The attacker model: flash loans, block-builder access or private order flow, the ability to deploy contracts, holdings of every debt asset and pool token, the roles of borrower, LP, payer or keeper, or control of one compromised key or one hostile upgrade that passed the 5-day timelock delay without any canceller acting. Each scenario lists the calls the attacker would make, the expected protection and a result.
| Category | Scenarios | IDs | What it covers | Examples |
|---|---|---|---|---|
| Custody and minting | 16 | 001, 003 to 017 | Unbacked vault tokens, duplicate or foreign positions, stray-position returns, donations and rounding on release | Duplicate LP collateral registration (001); unbacked mint through the minter's upgrade path (011) |
| Vault-token escape and seizure paths | 12 | 002, 018 to 028 | Vault tokens leaving the allowed holders, third-party liquidation, receive-shares and hostile LPVaultSwap seizures | Liquidation outside the authorized route (002); hostile LPVaultSwap debits a healthy account's records (025) |
| Proxies, Adapter, RiskModule and approvals | 11 | 029 to 039 | Proxy front-running, gate bypass, hostile Adapter or RiskModule, nonce replay, standing approvals | Credit-line drain through a malicious AaveAdapter upgrade (032); borrow-nonce replay (036) |
| Oracle and price states | 17 | 040 to 056 | Price manipulation, TWAP abuse, stale and lagging feeds, common-mode feed errors, disagreement and rounding | Flash-loan manipulation of the vault-token price (040); common-mode feed error passes the agreement and TWAP checks (051) |
| Liquidation griefing and economics | 25 | 057 to 081 | Unliquidatable positions, issuer blocklists, gas exhaustion, dust, sandwiching, funding-cost billing and spoofed callbacks | Unliquidatable position through a reverting payout recipient (057); spoofed flash-loan or swap callback (074) |
| Keepers and operations | 5 | 082 to 086 | Keeper key theft, keeper outages and wipes, delay bypass for keeper grants, emergency pause used against liquidation | Bad debt during a keeper outage (083); emergency pause used to halt liquidation (086) |
| Caps, deficits and share math | 7 | 087 to 091, 095, 096 | Exposure-cap bypass, pool-share denominators, coverage spent outside Avana, share inflation, rounding loops | Exposure-cap bypass (087); value extraction through rounding loops (096) |
| Reentrancy | 3 | 092 to 094 | Cross-contract and read-only reentrancy, native ETH payouts | Cross-contract reentrancy during settlement (092); read-only reentrancy on the LPOracle (093) |
| Governance | 8 | 097 to 104 | Timelock and pause abuse, guardian misuse, Aave-side reconfiguration, malicious listings | Short-delay tightening that halts liquidation (100); exploit through a malicious market listing (104) |
| Off-chain, signatures and dependencies | 6 | 105 to 110 | Phishing through transaction preparation, spoofed targets, indexer poisoning, supply-chain swaps, signature replay | Approval phishing through compromised transaction preparation (105); web bundle or manifest supply-chain swap (108) |
| Settlement recovery, Aave reserve pauses and persistent disagreement | 3 | 111 to 113 | Liquidation at a disputed price, new debt against a paused reserve, the pending-settlement balance | Liquidation at a disputed price after the disagreement window (111); theft through the pending-settlement balance (113) |
| Open liquidation entry point, third-party repay and payout escrow | 6 | 114 to 119 | Tiny liquidations by any caller, route sandwiching, third-party repay front-running, escrow claims | Griefing through tiny liquidations by any caller (114); payout escrow claim by the wrong person (118) |
| CDP Spoke implementation and configuration | 2 | 120, 121 | Spoke upgrades or listings that reopen third-party seizure | CDP Spoke upgrade that reopens third-party seizure (120); listing on a Spoke without the required settings (121) |
| Adapter custody, immutable proxies, governance timing and multi-asset debt | 16 | 122 to 137 | Hostile Adapter upgrades, proxy code changes, debt-asset rallies, stale debt feeds, per-asset coverage, timelock timing | Hostile AaveAdapter upgrade (122); debt-asset price rally liquidates stable-LP accounts together (128) |
| Circuit breakers, address freeze, standby routes, rescue and new liquidation paths | 15 | 138 to 152 | Breaker griefing, compromised guardians, standby routes, top-up and deleverage sandwiches, USDT fee switch, admin-role takeover | Compromised guardian uses address freeze, breakers and the standby switch (139); admin-role grant takeover (152) |
| AMM-neutral core, Hubs and chains | 45 | 153 to 197 | Range and pricing errors per AMM protocol, cross-Hub lines and squatting, L2 sequencer outages, flash sources, Aave-side halts, payout order, transfer-fee debt assets | Narrow-range position credited at the market range's value (153); liquidation on stale prices after an L2 sequencer outage (171) |
| Result | Scenarios | Meaning |
|---|---|---|
| Mitigated | 146 | The named invariants and decisions block the attack (some rows state a narrower scope, for example for the reviewed Adapter). |
| Accepted risk | 39 | Residual risk with a named owner and a bound on the loss (for example a hostile upgrade bounded by the 5-day delay and cancellers, or an Aave DAO configuration change). |
| Launch condition | 10 | Mitigated once a named check passes before launch, such as a per-pool manipulation-cost study, cap stress tests or a debt-reserve rally test. |
| Prevented by the CDP Spoke code | 2 | Third-party liquidation and receive-shares borrowing are closed by the standard Spoke's own code and the required settings. |
External Dependencies
Every contract or service outside Avana's code that Avana relies on, on Ethereum and Base, with what Avana assumes and what happens if the assumption breaks. Each entry also names the rule that limits the damage.
| ID | Dependency | What Avana assumes | What happens if it fails |
|---|---|---|---|
EXT-001 | Aave V4 Hubs | Vault-token assets on exactly one CDP Spoke plus the fee receiver, zero draw caps on them, shares equal to assets; draw caps per (Hub, asset) within the credit line, raised above 0 only after coverage is funded | Share drift or a second Spoke breaks backing; a Hub halt stops repay, withdraw and liquidation of that Spoke until the DAO lifts it, while fee collection and deficit coverage continue |
EXT-002 | Aave V4 CDP Spokes (standard Spoke) | The listing sets receive-shares off, a liquidation fee of 0 or paid to Avana, no reinvestment controller and non-borrowable vault-token reserves, so only LPVaultSwap can complete a liquidation | A configuration change could let a third party take supply shares with no token transfer; the drift check stops new activity and the case is an accepted Aave DAO risk |
EXT-003 | AaveOracle and debt price sources | AaveOracle applies no staleness check, so freshness is Avana's job; Avana's oracles never revert and serve at least 1 | A reverting or zero price would freeze accounts; a stale debt price blocks borrowing for accounts holding that debt and delays liquidation repaying it |
EXT-004 | Lend Spoke and Coverage Spokes | Only listed Spokes eliminate deficits; each Coverage Spoke enforces its allowlist; reserve withdrawals need DAO approval after the withdrawal delay | Coverage spent on another Spoke or asset, deficits left uncovered, or a recalled line that stops new borrowing (repay continues) |
EXT-005 | Aave governance roles | Changes follow the required settings; a Guardian reserve pause is used only for exploits and lifted within the 48-hour incident window | A change outside Avana's timelock or a reserve pause with no expiry can stop liquidation of the affected accounts |
EXT-031 | Aave V4 on Base | The same pinned code with the required settings; GHO on Base is the CCIP burn and mint token | A Base deployment from other code breaks the Hub and Spoke assumptions on Base only; Base payloads arrive after the Ethereum vote |
EXT-030 | Aave V3 Pool flashLoan (the flash source and the flash liquidation helper) | Borrowed by the flash source for repay with collateral and by the flash liquidation helper for callers without the debt asset; premium rounded up, 5 bps at deployment, 0 for a FLASH_BORROWER; premium, idle liquidity and reserve flags read at each call | A paused reserve, a premium above the ceiling or short liquidity stops repay with collateral and helper-funded liquidation of that asset; a caller that holds the debt asset still calls liquidate directly, so liquidation never depends on the Pool |
EXT-012 | Aave V3 ACLManager FLASH_BORROWER role | Granted by AIP to the flash source and the public flash liquidation helper, and not revoked; an operator's own helper has no grant unless an AIP adds one | Without it the premium is non-zero; above maxFlashFeeBps a repay with collateral reverts before the loan and a helper call reverts before LPVaultSwap is called. A helper's premium comes out of its caller's payout, never Avana's fee or the borrower surplus |
EXT-011 | GHO FlashMinter (not used) | None | None for Avana |
EXT-006 | Uniswap v3 NonfungiblePositionManager | increaseLiquidity is permissionless; removal and collection need owner or approval; approvals clear on transfer; not upgradeable | A strict liquidity check would let donations block exits; an approval would let a third party drain positions; uncapped collection would take depositor fees |
EXT-007 | Uniswap v3 factory and listed pools | Pools are immutable; observation history covers the TWAP window; listed pools meet the manipulation-cost depth | Thin pools make the TWAP check cheap to trip (blocks new risk only); a broken pool makes fee collection and unwinds revert |
EXT-028 | Aerodrome Slipstream position manager, factory and pools | Gauge-staked positions are owned by the gauge and cannot be pledged; each market binds one factory and position-manager generation | A v3 ABI used on Slipstream misreads pool data; a wrong generation binds the wrong contracts; a TWAP buffer sized for 12 s blocks covers a sixth of the time on Base |
EXT-032 | Uniswap v2, Curve StableSwap-NG, Balancer and Uniswap v4 | Supported by the core and listed only after their readiness guards pass; reads check each pool's reentrancy lock | Read-only reentrancy or same-transaction manipulation inflates a quote; a v4 hook blocks or taxes unwinds |
EXT-008 | Chainlink primary feeds | A new round on each deviation, otherwise once per heartbeat (stablecoin heartbeats 82,800 to 86,400 s) | A stale feed moves the market to Cached and then Expired: borrowing stops, its seizure waits, and from Expired it counts at 1 in health factors |
EXT-009 | Chainlink alternate routes | The two routes share no intermediate feed; the agreement tolerance covers both deviation thresholds plus a margin | A shared feed creates a common-mode error; a faulty route causes a disagreement that pauses the market's seizure until the routes agree or a standby replaces one |
EXT-020 | Debt-asset feeds through the DebtOracle | Each leg's age limit is its own heartbeat plus margin; routes track the asset's market price | Both routes stale: borrowing of that debt stops and the debt counts at its stress price in health factors |
EXT-024 | DebtOracle feeds and standby routes | The standby passes the listing checks of the slot it replaces and is independent of it | A stale or shared standby does not restore the price; a compromised guardian's switch lasts until the Aave governance executor cancels it |
EXT-025 | Chainlink proxy phases | Aggregator upgrades keep past phases readable; a new phase starts its round IDs at 1 | Without the phase rule an outage that ended on an aggregator upgrade gives no gap evidence and the grace window never opens |
EXT-029 | L2 sequencer uptime feed (Base) | Updated from L1, so it reports an outage while Base blocks are not produced | Without the gate, borrows on pre-outage prices and liquidations at the first post-outage price are unsafe for users who could not reach the chain |
EXT-010 | GHO token | No transfer fee, hooks or blocklist; GHO debt valued at $1; GHO debt on Base sized to Base flash liquidity, the committed operators' GHO inventory and route depth | A behaviour change breaks delta accounting; a GHO premium or discount shifts liquidation economics; thin GHO on Base limits liquidation size |
EXT-013 | GHO Stability Modules (Ethereum) | GHO governance can freeze, seize or re-cap a GSM; buy-side liquidity can be negligible | A GSM backup leg reverts; with both routes failing the liquidation reverts until a route works again |
EXT-014 | Sky LitePSM and the DAI–USDS converter (Ethereum) | Fee and headroom within the slippage bound | A paused or exhausted PSM |
EXT-015 | DEX swap routes | A route never uses the market's own pool; depth meets the published threshold for a one-sided unwind; primary and backup share no pool | Sandwiching or thin depth lowers proceeds; a leg below its minimum reverts and LPVaultSwap tries the backup |
EXT-021 | Swap routes into each debt asset | Depth meets its threshold for the largest liquidation the caps allow; routes are not upgradeable | Proceeds below the recovery floor need the caller's top-up, and proceeds between the floor and the debt repaid lower only the caller's payout; both routes failing reverts the liquidation |
EXT-016 | Credit-line suppliers | Only idle liquidity can be withdrawn; a recall lowers draw caps to 0; suppliers take deficits beyond first-loss coverage | Recall or exhaustion stops new borrowing of that asset; repay, withdrawals and liquidation continue |
EXT-022 | Cross-Hub credit lines | The funding Hub owns the cap and its liquidity covers it | Caps set by the borrowing Hub, or a funding-Hub pause that does not reach foreign Spokes, would let them draw past the line |
EXT-017 | Pool tokens and debt assets | No fee-on-transfer, rebasing, hooks or false-returning transfer at listing; USDC and USDT issuer controls accepted with monitoring | An issuer pause stops transfers of the token; a blocklist of LPVaultSwap stops routed settlement of the affected markets until an upgrade; a blocklisted caller blocks only its own liquidations |
EXT-026 | Issuer probes paused() and basisPointsRate() | The view reflects the token's transfer behaviour in the same block | A probe that returns true, a non-zero rate or fails trips the issuer breaker and stops new risk in that token |
EXT-018 | OpenZeppelin Contracts | TimelockController holds its own admin role; cancel reaches only pending operations; UUPS upgrades only through upgradeToAndCall | An admin outside the timelock would allow a role grant without delay; an uninitialized implementation could be initialized by anyone |
EXT-023 | WETH token | No blocklist, fee or hooks; returns true on transfer | No token failure; a WETH rally raises the debt of stable-LP accounts and can make them liquidatable together |
EXT-019 | Block builders, private submission and sequencers | At least one independent submission path per committed operator per chain; any other address can liquidate directly or through the public helper | Censorship or delay of liquidations; sandwiching of swap legs; a Base sequencer outage stops ordinary inclusion |
EXT-027 | Safe guard and delay module | Reviewed guard and module code; signers on dedicated hardware wallets; the Aave governance executor as second proposer | A removed guard lets the Safe call contracts directly (no Avana contract accepts it); a faulty delay module lets a compromised quorum replace owners; a lost quorum stops proposals |
Notable Design Decisions
A selection from the 400 recorded design decisions. Each records its final resolution and the risk it controls; replaced decisions keep their rows and name their replacement.
| Decision | Resolution | Reason |
|---|---|---|
| AMM-neutral custody | One immutable LPVault per AMM protocol per chain implements a common interface; the core calls no AMM protocol contract. | A new AMM protocol adds a vault, a pricing library and an LPOracle implementation, with no change to the ledger, factory or Lock. |
| Instance scope | One set of per-chain contracts (one Adapter, one LPVaultSwap, one ledger) serves every Hub of the chain. | Per-Hub copies would run the same code under the same keys without a smaller blast radius, and one ledger keyed by Hub keeps Hub-wide caps from multiplying. |
| Account isolation | One PositionProxy per wallet, CDP Spoke and market; several markets per Spoke. | Several markets in one account let one stale oracle liquidate healthy collateral; one account per market gives full isolation with fewer governance actions. |
| Immutable, logic-free proxies | PositionProxies have one Adapter-only function and no upgrade; all account logic lives in the Adapter. | Aave V4 has no position transfer, so proxies cannot be migrated; a fix reaches every account through one timelocked Adapter upgrade. |
| Immutable custody | LPVaults, Collateralization, vault tokens, the factory, the Lock and the escrow are immutable; gates, prices and settlement logic are upgradeable. | No upgrade can change who receives a position or how backing is counted, while code that needs tuning stays behind one watched upgrade path. |
| Standard Spoke with three required settings | Every CDP Spoke is an unmodified Aave V4 Spoke; receive-shares off, liquidation fee 0 or paid to Avana, no reinvestment controller. | While these hold, the vault token's transfer rule is the only gate needed; a drift alarm cannot stop a seizure in the same block, so the settings are checked on every pledge and borrow. |
| Settlement in the debt asset | The caller funds the repayment in the debt asset, directly or through a flash liquidation helper, and LPVaultSwap pays out in it. | Base has no GHO FlashMinter and Aave V4 has no flash loan; this removes the buy and sell-back legs and their slippage. |
| Flash source never lends a Hub's liquidity | A flash source whose lender is any Hub registered on the chain is refused, at setup and at every loan; the flash liquidation helper refuses such a Pool the same way. | Comparing with one Hub missed sources whose Spoke draws from that Hub. |
| No settlement budget | The caller sizes the repayment for Aave's dust rule and bears any rounding loss in its own payout. | The budget needed funding, windows, floors and a breaker, each a liveness surface, to pay a few base units. |
| No in-kind settlement | Every liquidation settles in the debt asset or reverts; the escrow holds only refused payouts. | Route-depth listing rules, standby routes, the shortfall top-up and the Avana Umbrella already cover a total route failure. |
| No on-chain health floor | Borrowing needs Aave's health factor 1.00 and the caller's limit; the app recommends 1.10. | A floor above 1.00 limits borrowers without bounding Avana's loss, which caps, the bonus and the First-Loss Reserve bound. |
| No minimum debt | Any amount above 0 may be borrowed; Avana's keepers liquidate every account and Avana pays the gas. | Small debts arise anyway from partial repays and liquidations; a small liquidation is a bounded operating cost. |
| Record cap of 16 | At most 16 open records per account and market. | Aave's dust rule can force a whole-account seizure in one call; 16 records cost at most 5.15M gas, under half the per-transaction limit. |
| Breakers stop new activity only | Oracle and peg breaches and deficits block new risk; price drops, seizures and route failures are alerts. | A reverted call cannot persist a counter and counters can be gamed; actions that reduce risk keep working, so a breaker never turns an incident into bad debt. |
| Pool-share gate off by default | No default limit on Avana's share of a pool; a cap applies only where a listing sets one. | Removing liquidity has no price impact and proceeds can use any approved route; liquidation safety comes from route depth and draw caps. |
| Liquidation gated by the seized and repaid reserves | Liquidation needs fresh prices only for the market seized and the debt repaid. | An account-wide gate let one small failing position shield every other market of the account from liquidation. |
| Address freeze | Guardians can freeze an address at once (at most 20 per day); unfreezing needs the timelock at the normal delay. | It stops an exploiter's new exposure in minutes without pausing everyone, while exits and liquidation stay outside the freeze. |
| Reconcile on exit | Units missing from a proxy after an unsettled seizure are debited on the next exit and moved to the pending balance. | A faulty LPVaultSwap could otherwise leave positions stuck and vault tokens without known backing. |
| Self-administered timelock with a delay floor | The AvanaTimelock holds its own admin role; normal delay 5 days, never below 4; the short-delay list is a fixed allowlist. | Nobody can shorten a delay or grant a role without waiting in public, and borrowers can exit before any upgrade lands. |
| Debt assets beyond GHO | USDC, USDT and WETH become debt reserves only when funding, caps, price source and both swap routes pass. | No asset is borrowable unless Avana can liquidate it inside one transaction. |
| Cross-Hub credit lines off at launch | Fully specified, with the funding Hub owning the cap, and disabled per chain. | Simulation showed no launch benefit, and a register per funding Hub keeps foreign draws within that Hub's coverage. |
| No fee on borrow interest | Avana's on-chain revenue is 20% of the oracle gain on liquidations, capped by the realized gain; the app fee is charged outside the contracts. | A fee on interest would make the debt a borrower sees differ from Aave's; keeping the app fee off-chain keeps it out of the contract code and every account's health. |
| Spoke liquidation settings are guidance | Target health factor 1.10 and minimum bonus of at least 2% are Avana's recommendation; the Aave DAO decides. | The Spoke configuration belongs to the Aave DAO; Avana sizes from what it set and stops new activity if it drifts. |
| First-loss reserve size set in the funding ARFC | The coverage rule is fixed; the ratio and minimum are set with the Aave service providers. | The rule protects lenders at every level, and the level depends on the credit line the providers accept. |
| No idle-collateral mechanism | A debt-free account's charge stays in the market's regular cap budget. | The idle bucket added state and a permissionless mover for a griefing case that costs the attacker its own capital. |
| CoW Swap not used | Routes are fixed on-chain at listing. | Every liquidation must settle in the debt asset in the same transaction, and CoW orders settle later in solver batches. |
Verification Approach
Avana is verified in two stages. Spec-stage checks model the design itself: the formulas, the state machine across contracts and the economics. Implementation-stage checks prove the same rules on the Solidity. Every critical requirement has at least one verification method, every check links to the requirements it verifies, and every failed check becomes a finding in the register.
Spec-stage results (recorded 10 November 2026)
| Check | What it covers | Result |
|---|---|---|
Traceability (trace.py) | Links every requirement to the checks that verify it; a lock file records each requirement's accepted text, so an edit must be re-verified before it is accepted again | 3,454 requirements traced, 0 errors |
| Z3 | Every formula in exact integers at Solidity bit widths: units, oracle math and price states, Aave V4 health factor and liquidation sizing ported from the pinned Aave V4 commit, recovery floor, waterfall, coverage, timelock timing, and LP pricing per AMM protocol; every worked example recomputed | 45 scripts, 825 checks: 616 proved, 104 computed exactly, 105 counterexamples searched for on purpose; every result matches its recorded value |
| SymPy | Each formula equals the rule it implements, exactly and before rounding | 10 scripts, 240 checks: 239 consistent, 1 deliberate wrong reading |
| Hypothesis | Generated action sequences against an executable integer model of Avana, Aave V4 and Uniswap v3, with solvency per debt asset checked after every step | 82 tests, 82 pass |
| Quint | Cross-contract state machine with honest and hostile components, and a multi-Hub, multi-Spoke topology model | 70 deterministic scenarios pass (50 system, 20 topology); no violation of the 43 system and 15 topology invariants in the recorded simulator runs |
| Simulations | Economic stress: depegs, oracle outages, correlated drops, keeper outages, gas and dust, route stress, interest; a 1,000-user, 90-day simulation with six stress episodes | Seeded and reproducible; the 1,000-user run made 572,608 invariant checks with 0 violations, 98 liquidations and $0 bad debt |
| Internal formal verification | Custody, control (access, timelock, pause, gates, parameters, oracle, upgrades, breakers) and liquidation areas | Custody: every check verified; control: 180 checks, 168 verified, 6 under a bounded model, 6 Quint invariants with no violation; liquidation: 271 checks pass |
Bounded and random checks do not establish correctness beyond their modelled depth, and mathematical correctness is not economic correctness: pool risk factors, caps and the incident window rest on the simulations and on the Aave V4 risk service providers. These checks cover the specification and the contract interfaces; the implementation-stage checks below prove the same rules on the Solidity.
Implementation-stage verification
| Method | What runs |
|---|---|
| Foundry tests | 287 tests (TEST-001 to TEST-287): unit, access-control, fuzz, boundary, differential, invariant, fork, hostile-component, deployment-check, keeper, off-chain, gas and security-tooling tests. The invariant suite asserts every global invariant after each step of borrowers, outside LPs, committed operators, unregistered liquidators calling directly and through the public flash liquidation helper, a flash-loan attacker, a pool manipulator, a lender, the guardians and the timelock. |
| Hostile-component tests | Hostile Adapter, LPVaultSwap, RiskModule, MarketRegistry and ParameterStore implementations installed through the real timelock path at the 5-day delay, each shown to stay within its stated blast radius. |
| Formal properties | 86 implementation-stage properties (PROP-001 to PROP-097, with gaps): most in Certora CVL over all reachable states, the rest as Halmos symbolic Foundry tests, and SMTChecker proofs (CHC engine) of the absence of overflow, underflow, division by zero and failing asserts in the immutable contracts and the oracle, settlement and route code. |
| Fast security tier (every push and pull request) | forge fmt and forge lint, a warnings-denied build, solhint 6.2.5, Slither 0.11.6 with its upgradeability check, Aderyn 0.6.8 and the file-size checks; gates every merge. |
| Slow security tier (nightly and before every release) | Echidna 2.3.3 and Medusa 1.5.1 on every property harness, Halmos 0.3.3, hevm 0.58.0 on harness assertions and runtime bytecode, and Mythril 0.24.8 on the runtime code of every contract; gates every release tag and timelock-scheduled upgrade. |
Two tools named in earlier plans are not used: MythX shut down, so Mythril runs locally and no step sends code to an external service; Manticore is archived, so hevm and Halmos carry symbolic execution.
Traceability
trace.py builds the requirement, check and implementation matrix. It fails on a duplicate ID, a link to an undefined ID, or a requirement whose text changed since it was last accepted; in strict mode it also fails when a requirement has no check, and, once the code exists, when a requirement has no test, property or source link. Each row of the matrix has one status:
| Status | Meaning |
|---|---|
| Unverified | No check links to the requirement yet. |
| Modelled | Spec-stage checks only (Z3, SymPy, Quint, Hypothesis, simulations). |
| Planned (prover) | A Certora, Halmos or SMTChecker property names the requirement, and the prover has not passed it yet. |
| Verified | Spec-stage checks plus a Foundry test or a property the prover passed. |
| Changed — re-verify | The requirement's text changed since its checks were accepted; the checks must be rerun and the change accepted. |
Findings and their statuses are tracked on the Audits page.
