Introduction
This page cover Introduction, Architecture, and High-Level System Flows
Avon is an onchain lending protocol that combines isolated ERC-4626 strategies with a unified onchain orderbook that aggregates liquidity and matches borrowers with the best available credit.
Borrowers receive real-time routing across all strategies. Lenders maintain isolated risk, predictable accounting, and transparent pricing.
Avon is designed around five principles:
Isolation by default — each strategy is its own lending market.
Real-time rates — strategies publish their liquidity as quotes.
Deterministic execution — a single onchain orderbook handles all matching.
No allocators — no hidden rebalancing or opaque liquidity movement.
Bounded gas — matching is capped and tree operations remain O(log n).
This documentation explains how to integrate with Avon’s contracts to borrow, repay, supply liquidity, manage collateral, read data, and perform liquidations.
Architecture Overview
Avon consists of three core components:
1. Orderbook Factory
The deployment registry for all orderbooks.
Responsibilities:
Deploy one orderbook per
(loan asset, collateral asset)Whitelist IRMs (interest rate models)
Whitelist strategy factories and managers
Configure protocol fee recipients
Handle emergency controls (pause, remove strategies)
Only one orderbook exists per asset-pair.
2. Orderbook (Matching Engine)
The orderbook aggregates liquidity from strategies and executes market borrow orders.
It maintains:
Lender Tree — liquidity quotes (ticks) from strategies
Borrower Tree — borrower limit orders (not enabled in this version)
Matching is deterministic:
Select best rate
If tied → select best LTV
If tied → select earliest timestamp
Borrow execution is aggregated across up to 30 quotes in one transaction.
The orderbook never holds tokens or debt.
3. Strategies (ERC-4626 Isolated Lending Markets)
Strategies implement:
ERC-4626 deposits & withdrawals
Collateral management
Borrowing & repayment
Interest accrual
Liquidation logic (soft + hard ranges)
Curve slicing → tick-based quoting into the orderbook
Each strategy defines:
Loan asset
Collateral asset
LTV / LLTV
Liquidation parameters
Oracle dependency
Interest rate model
Strategies are fully isolated. Debt, collateral, or risk in one strategy cannot affect another.
High-Level System Flows
Lending Flow
User deposits into a strategy
Strategy mints ERC-4626 shares
Strategy slices its curve into ticks
Strategy submits ticks to the orderbook
Orderbook updates the lender tree
Borrow Flow
Borrower provides collateral
Borrower calls
matchMarketBorrowOrderOrderbook selects best quotes from all strategies
Collateral moves into strategies
Strategies open isolated debt positions
Borrower receives loan tokens
Repayment Flow
Borrower approves strategy
Calls
repay()on each strategy where they have debtStrategy reduces debt
Collateral unlocks proportionally
Liquidation Flow
Strategy computes health
If
health < LLTV→ liquidatableLiquidator repays part of debt
Strategy transfers collateral with bonus
This completes the architectural overview. Next page covers actual integration with contracts.
Last updated