Degen Code

Degen Code

Aave — Part II

Pool Contract

Nov 25, 2025
∙ Paid

The set of Aave contracts deployed for a given chain is known as a “market”. Each chain typically has a main market for users, though other markets may be deployed on that chain with different features.

The largest market is on Ethereum mainnet (chain ID 1), accessible via the Aave front-end by going to the Markets tab and choosing “Core” from the drop-down menu.

Many assets are enabled for this market, including the familiar Wrapped ETH, Tether USD, and USD Coin tokens.

We will use this market for the remainder of our study. Be sure you connect to an appropriate RPC and use Etherscan (or equivalent) as your block explorer.

It’s nice to see some data through the front-end, but our primary focus is on the contracts.

Concepts

Aave has several domain-specific terms and concepts. Not all of these concepts are relevant to us, but some merit a brief overview.

Liquidity Pool

Uniswap has the concept of individual liquidity pools holding a pair of assets. Each pool has a distinct contract address that holds the balance of each assets.

Aave refers to an instance of a market (and all of its related contracts) as a liquidity pool. Assets are not held by a single contract, rather they are managed by several distinct ones.

Reserve

A reserve is a generic name for a token held by an Aave liquidity pool. Individual reserve assets are approved and enabled by the protocol for use. The characteristics of each asset vary, so reserves have several parameters to control how they can be used by the protocol:

  • Loan-to-Value (LTV) — a percentage specifying the maximum size of the debt that can be created against the reserve

  • Liquidation Threshold — a percentage specifying the LTV where a position is considered undercollateralized and eligible for liquidation

  • Borrowing Enabled — true/false

  • Caps — upper limits on both the supplied and borrowed amounts

  • Interest Rate Model — parameters to set the shape of the interest rate curve

aToken

An aToken is an ERC-20 that represents a claim on some Aave reserve asset. When a liquidity provider supplies an asset, an amount of some aToken is minted to them. To withdraw that asset, the corresponding aToken is burned and the asset is returned.

The aToken contract is standalone and holds its underlying asset. The asset can be withdrawn only by the Pool contract calling burn on behalf of a user.

vToken

A vToken is an ERC-20 that represents a variable rate debt position. It is non-transferable and used to track debts for by a particular user.

Interest Rate

The interest rate is a percentage of the loan amount that must be repaid by borrowers to close their debt position. There are two interest rates: one for borrowing; one for supplying. The rate for borrowing is higher than the rate for supplying, and the difference is kept as a fee to the protocol.

Each interest rate curve is upward sloping with respect to usage ratio, the fraction of all open debt positions against the collateral. The interest rate has two slopes. The higher of the two is used after the LTV for the market crosses an optimal point.

The net effect of this dual-slope strategy is that loan creation is encouraged by low borrowing rates when LTV is low, and discouraged by high borrowing rates when LTV is high.

Since interest rates are continuously variable, the total interest paid to a liquidity provider is calculated instantaneously at withdrawal time.

Liquidity providers are paid their accumulated interest through a scaling mechanism whereby their share of the reserve asset is multiplied by a ratio corresponding to the current liquidity index which is dynamically adjusted.

Utilization Rate

Each asset has a target utilization rate set by protocol governance. The protocol-wide LTV for a particular asset is rolled into this value. The transition between the two slopes on the interest rate curve occurs at this target optimal utilization rate.

This value is shown on the front-end, and can also be read from the asset’s holding contract.

Interest rate curve for Wrapped ETH

Efficiency Mode (E-Mode)

For correlated assets like stablecoins or ETH derivates, Aave provides a special mode for borrowing that allows for higher LTVs.

Isolation Mode

The protocol is at maximum risk when a volatile asset backs a loan for another volatile asset.

Nevertheless, some new assets may be desirable, so Aave allows them to be used as collateral against less volatile assets only. A typical use case is allowing a new volatile asset to be supplied as collateral for loans of stablecoins.

Console Exploration

Throughout the series, console code will be provided. The underlying tool is Ape Framework, most often connected to an Ethereum mainnet RPC.

User's avatar

Continue reading this post for free, courtesy of BowTiedDevil.

Or purchase a paid subscription.
© 2026 BowTiedDevil · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture