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 a caller-supplied parameter named supply_token, this reserves the asset to be provided at execution time.

  2. 2·Take

    Also taking a caller-supplied parameter named aave_market, this reserves the market address the run will act against.

  3. 3·Get asset data

    Reading Aave reserve data for the supply_token in the aave_market, this surfaces its live rates and token addresses.

  4. 4·Take

    A third parameter named holder_wallet is taken from the caller, reserving the address whose position gets checked.

  5. 5·Get token balance

    Using the aToken address wired from the reserve in 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 true when the balance is zero.

  7. 7·Predicate

    A predicate opens on the comparison being true, so the following branch runs only when the aToken balance is zero.

  8. 8·Take

    Another caller parameter named supply_amount is taken, reserving how much of the asset to supply.

  9. 9·Supply

    On that branch, supply_amount of supply_token is supplied to aave_market, minting aTokens to the socket.

  10. 10·End block

    Closing the innermost open block, this ends the 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
  • Take Profit (WETH/USDC Loop)

    boolean
    aave
    evm
  • Loop WETH/USDC at Target HF

    aave
    evm
    boolean
  • Borrow + Term Repayment Schedule

    time
    database
    boolean
  • Trailing Stop Loss (WETH/USDC Loop)

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

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

    aave
    boolean
    evm
  • 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 · 2