End block
End block

Logic · Acts onchain

Closes the innermost open block, whether a conditional branch or a loop. Every if, if not, else if, else, for, until, and while needs a matching End; for loops, reaching End returns to the loop start for the next condition check. Reach for it to mark where a branch or loop body stops and unconditional execution resumes, so the steps after it run on every path.

Takes nothing — it reads the caller's own position.

Unstake From Lido, Claim It When It Clears, Restake It

plug
database
boolean
11actions
  1. 1·Take

    Declares unstake_amount as a caller-supplied parameter, the quantity of stETH to queue for withdrawal at execution time.

  2. 2·Read stored value

    Reads the stored unstake_request value from this plug's own storage, pulling whatever request identifier a prior run may have saved.

  3. 3·Predicate

    Comparing the stored unstake_request against 0 with an equality operator, control branches on whether no request is currently outstanding.

  4. 4·Request withdrawal

    When no request exists, the unstake_amount of stETH at 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 is queued for withdrawal through Lido, yielding a claimable request NFT.

  5. 5·Set stored value

    Writing the resulting request identifier back into plug storage under unstake_request, this persists the open claim for the next run to find.

  6. 6·Else branch

    Opening the else branch, this defines what runs when a request identifier was already stored.

  7. 7·Claim withdrawal

    On that branch, the stored unstake_request is claimed from Lido, and once the request has finalized the socket receives native ETH.

  8. 8·Set stored value

    Resetting the stored unstake_request to 0 clears the marker, so a future run starts a fresh withdrawal.

  9. 9·Get token balance

    Reading the ETH balance held by the socket at 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, this measures the native ETH now on hand.

  10. 10·Stake

    Staking that measured ETH balance with Lido returns stETH at 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84, restaking the claimed proceeds.

  11. 11·End block

    Closing the innermost open block, this ends the else branch.

Take
Read stored value of in
Request withdrawal of from Lido
Set stored value of in to
Else
Claim withdrawal from Lido
Set stored value of in to
Get balance of held by
Stake for
End block
  • Unstake From Lido, Claim It When It Clears, Restake It

    plug
    database
    boolean
  • Pendle Leveraged PT Auto Rollover

    plug
    pendle
    time
  • Raw Weights to Percents

    plug
    evm
    boolean
  • Get Simple Moving Average

    plug
    time
    chainlink
  • Rebalance Holdings to Target

    plug
    values
    evm
  • Get Total Holdings Value

    plug
    evm
    boolean
  • Swap at Floor

    plug
    evm
    values
  • Morpho: Auto Leverage Trigger

    plug
    morpho
    math
  • Swap

    plug
    values
    evm
  • Morpho: Refinance to Cheaper Borrow Market

    morpho
    plug
    boolean
  • Morpho Pendle Expiry Deleveraging

    pendle
    time
    boolean
  • Find Value Delta

    plug
    boolean
    evm
  • Aave: Wind or Unwind Position

    plug
    boolean
    aave
  • Target Debt to Debt Delta

    plug
    aave
    boolean
  • Wind

    plug
    aave
    evm
  • Unwind

    plug
    aave
    evm
  • Supply if a Token Balance Is 0

    plug
    aave
    evm
  • Wind or Unwind to Maintain Target HF

    plug
    aave
    math
  • Supply Idle Balance Weekly

    time
    evm
    boolean
  • Borrow + Weekly Repayments

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

    boolean
    aave
    evm
  • Borrow + Term Repayment Schedule

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

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

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

    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 WETH/USDC at Target HF

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

    aave
    boolean
    evm