
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
Declaring supply_token as a named parameter, this step takes the asset the caller wants to supply at execution time.
2·Take
Taking aave_market as a named parameter, this captures the market address the caller supplies at run time.
3·Get asset data
Reading Aave reserve data for supply_token in the market wired from slot 1.0, this surfaces its live rates and token addresses, including the aToken address.
4·Take
Declaring holder_wallet as a named parameter, this captures the address whose balance the run will check.
5·Get token balance
Using the aToken address wired from slot 2.1.8, the balance held by holder_wallet is read.
6·Compare two values
Comparing that measured aToken balance against 0 with an equality operator, this returns a boolean about the position being empty.
7·Predicate
A predicate opens on the comparison in slot 5.0 being true, so the following branch runs only when no aTokens are held.
8·Take
Taking supply_amount as a named parameter, this captures the quantity the caller wants supplied.
9·Supply
On that branch, supply_amount of supply_token is supplied to the market, minting aTokens to the wallet.
10·End block
Closing the innermost open block, this ends the conditional branch opened above.
On other protocols · 3