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

    Declaring supply_token as a named parameter, this step takes the asset the caller wants to supply at execution time.

  2. 2·Take

    Taking aave_market as a named parameter, this captures the market address the caller supplies at run time.

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

    Declaring holder_wallet as a named parameter, this captures the address whose balance the run will check.

  5. 5·Get token balance

    Using the aToken address wired from slot 2.1.8, the balance held by holder_wallet is read.

  6. 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. 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. 8·Take

    Taking supply_amount as a named parameter, this captures the quantity the caller wants supplied.

  9. 9·Supply

    On that branch, supply_amount of supply_token is supplied to the market, minting aTokens to the wallet.

  10. 10·End block

    Closing the innermost open block, this ends the conditional branch opened above.

Take
Take
Get asset data of in
Take
Get balance of held by
Is
Take
Supply to
End block
  • Strategy: Loop WETH/USDC at Target HF + Stop Loss

    boolean
    aave
    evm
  • Supply if a Token Balance Is 0

    plug
    aave
    evm
  • Borrow + Weekly Repayments

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

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

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

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

    aave
    boolean
    evm
  • Loop WETH/USDC at Target HF

    aave
    evm
    boolean
  • Borrow + Term Repayment Schedule

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

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

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

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

    boolean
    aave
    evm

On other protocols · 3