Get asset data
Get asset data

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

plug
aave
evm
10actions
  1. 1·Take

    The caller supplies a named parameter called supply_token, which will identify the asset being worked with.

  2. 2·Take

    A second parameter, aave_market, is declared here for the caller to fill in with the market address.

  3. 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. 4·Take

    Another caller parameter, holder_wallet, is declared to name the address whose balance matters.

  5. 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. 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. 7·Predicate

    Control flow requires that the comparison result equals true, so the following actions run only when the earlier equality held.

  8. 8·Take

    Inside the branch, the caller supplies supply_amount, the quantity to be deposited.

  9. 9·Supply

    When the condition holds, this supplies supply_amount of the supply_token to the aave_market, minting aTokens to the socket.

  10. 10·End block

    The conditional branch is closed here.

Take
Take
Get asset data of in
Take
Get balance of held by
Is
Take
Supply to
End block
  • Supply if a Token Balance Is 0

    plug
    aave
    evm
  • Strategy: Loop WETH/USDC at Target HF + Stop Loss

    boolean
    aave
    evm
  • Borrow + Weekly Repayments

    time
    aave
    evm
  • Borrow Rate Exit Guard (WETH/USDC Loop)

    boolean
    aave
    evm
  • Loop WETH/USDC at Target HF

    aave
    evm
    boolean
  • Swarm: Loop WETH/USDC at Target HF

    boolean
    aave
    evm
  • Loop at Target HF + Trailing Stop Loss

    database
    boolean
    aave
  • Borrow + Term Repayment Schedule

    time
    database
    boolean
  • Loop at Target HF + Borrow Rate Exit Guard

    database
    boolean
    aave
  • Stop Loss (WETH/USDC Loop)

    boolean
    aave
    evm
  • Take Profit (WETH/USDC Loop)

    boolean
    aave
    evm
  • Trailing Stop Loss (WETH/USDC Loop)

    boolean
    aave
    evm
  • Loop at Target HF + Borrow Rate Entry & Exit Guard

    aave
    boolean
    evm

On other protocols · 2