Take
Take

Plug · Acts onchain

Declares a named parameter whose value the caller supplies at execution time. The slot stays open at compile time and is reported as a parameter of the plug; downstream steps coil it like any other value. When another plug composes this one through Use, its Takes become that step's inputs. Reach for it to make a plug reusable: take an amount, a token, or a recipient rather than hardcoding it, and let each caller bind its own value.

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
  • Get Chainlink Token Value (USD)

    plug
    math
  • Get Chainlink Price (USD)

    plug
    chainlink
  • Transfer Token on a Schedule

    plug
    evm
    time
  • Dust Guard

    plug
    boolean
  • Expected Amount to Minimum Received

    plug
    math
    values
  • Revoke Spending Approval

    plug
    evm
  • Approve Spending

    plug
    evm
  • Unwrap WETH to ETH

    evm
    plug
  • Wrap ETH to WETH

    evm
    plug
  • Set SMA Weight

    plug
    database
  • Raw Weights to Percents

    plug
    evm
    boolean
  • Get Simple Moving Average

    plug
    time
    chainlink
  • Get Weight Target

    plug
    values
    math
  • Get Price Running Total

    plug
    values
    math
  • Rebalance Holdings to Target

    plug
    values
    evm
  • Get Token Target

    plug
    database
    evm
  • Get Total Holdings Value

    plug
    evm
    boolean
  • Set Rebalance Token

    plug
    database
  • Get Target Balance

    plug
    math
    evm
  • Get Holding Value

    plug
    evm
    math
  • 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: Check Refinancing Constraints

    plug
    morpho
    evm
  • Morpho: Check Market Liquidity Vs. Required Amount

    plug
    evm
  • Morpho: Check Health Factor Vs. Min Threshold

    plug
    evm
  • Morpho: Find Borrow Rate Delta

    plug
    morpho
    evm
  • Morpho: Check Borrow Rate Delta Vs. Min Threshold

    plug
    evm
    boolean
  • Check Required Amount

    plug
    math
    evm
  • Morpho: Get Market Liquidity

    plug
    morpho
    math
  • Check Minimum Threshold

    plug
    boolean
    evm
  • Morpho: Get Borrow APR

    plug
    values
    math
  • Find Value Delta

    plug
    boolean
    evm
  • Morpho: Get Health Factor

    plug
    boolean
    evm
  • Morpho: Collateral Value to Borrow Capacity

    plug
    math
    evm
  • Morpho: Collateral Amount to Collateral Value

    plug
    math
  • Morpho: Borrow Shares to Borrow Assets

    plug
    math
    evm
  • Aave: Wind or Unwind Position

    plug
    boolean
    aave
  • Value to Token Amount

    plug
    aave
    math
  • Target Debt to Debt Delta

    plug
    aave
    boolean
  • Wind

    plug
    aave
    evm
  • Unwind

    plug
    aave
    evm
  • Dust Guard

    plug
    boolean
    evm
  • Wind or Unwind to Maintain Target HF

    plug
    aave
    math
  • Supply if a Token Balance Is 0

    plug
    aave
    evm