
Aave · Reads onchain state
Reads an Aave reserve's live rates and token addresses, with supply and borrow APYs. The pool's reserve data comes back whole: the current supply and variable borrow rates in ray, the last update timestamp, the aToken and variable debt token addresses, and isolation-mode debt. The per-second rates are compounded over a year on-chain into supplyApy and borrowApy at 18 decimals, so the yield figure is exactly what the pool accrues at this block. Reach for it when a strategy chooses between markets by yield, gates a supply on a minimum APY, or needs the aToken or debt token address to read a balance in the next step.
Supply if a Token Balance Is 0



1·Take
The caller supplies a named parameter called supply_token, which will identify the asset being worked with.
2·Take
A second parameter, aave_market, is declared here for the caller to fill in with the market address.
3·Get asset data
Using the supply_token and the aave_market, this reads the Aave reserve's live rates and token addresses, exposing details like the aToken address among its outputs.
4·Take
Another caller parameter, holder_wallet, is declared to name the address whose balance matters.
5·Get token balance
This reads the balance of the token found at slot 2.1.8, one of the addresses returned by the asset data lookup, held by the holder_wallet.
6·Compare two values
The measured balance is compared for equality against 0, returning a boolean that says whether the holder holds none of that token.
7·Predicate
Control flow requires that the comparison result equals true, so the following actions run only when the earlier equality held.
8·Take
Inside the branch, the caller supplies supply_amount, the quantity to be deposited.
9·Supply
When the condition holds, this supplies supply_amount of the supply_token to the aave_market, minting aTokens to the socket.
10·End block
The conditional branch is closed here.
On other protocols · 2