Check temporal state
Check temporal state

Time · Reads onchain state

Checks whether a timestamp is in the past or the future relative to block time. The chosen direction is compared against the current block timestamp and a boolean returned. Reach for it to gate a step on a deadline or a maturity: require an expiry is still in the future before buying PT, or branch to a claim once a stored unlock time is in the past.

Exit Morpho at Epoch End

pendle
time
boolean
27actions
  1. 1·Get expiry

    Reads the expiry timestamp of the Pendle market PT-USDat-27AUG2026 at address 0x9afe7a057a09cf5da748d952078c9c99938b4329.

  2. 2·Check temporal state

    Tests whether that expiry timestamp sits in the past relative to block time.

  3. 3·Predicate

    Requires that the past check returns true, so the plug only proceeds once the market has expired.

  4. 4·Get total supplied and borrowed

    Fetches the total supplied and borrowed assets and shares for the Morpho market identified by 0x69ef...617b at 91.5% LLTV.

  5. 5·Get account data

    Pulls your own position data in that same market, denominated in USDC, giving your shares, collateral, debt, and health factor.

  6. 6·Compare two values

    Compares a value drawn from your account data against 0 using a greater-than operator, producing a boolean.

  7. 7·Predicate

    Requires that your supply position result equals the earlier true value, gating on you actually holding a position.

  8. 8·Get market parameters

    Reads the immutable market parameters of that same Morpho market.

  9. 9·Use

    Invokes the nested plug that converts Morpho borrow shares into borrow assets.

  10. 10·Set

    Stores the borrow assets figure from the market parameters read into the variable user_borrow_assets_amount.

  11. 11·Set

    Assigns the supplied assets amount from your account data into the variable user_supply_assets_amount.

  12. 12·Flash loan

    Takes a flash loan of user_borrow_assets_amount of the market's loan token from the Morpho singleton, to be repaid within this transaction.

  13. 13·Repay

    Repays user_borrow_assets_amount of that loan token as debt into the same market, clearing your borrow.

  14. 14·Withdraw Collateral

    Withdraws user_supply_assets_amount of collateral from that market back to the socket now that debt is repaid.

  15. 15·Get price

    Reads the oracle price of the collateral token in terms of the market's loan asset.

  16. 16·Calculate

    Divides the supplied assets amount by the oracle price to size the collateral needed to cover the flash loan repayment.

  17. 17·Set

    Saves that quotient into the variable collateral_needed_to_repay_flashloan.

  18. 18·Get address

    Holds the Solver address as a named value for later use.

  19. 19·Get token balance

    Reads the loan token balance held by 0x581BEf12967f06f2eBfcabb7504fA61f0326CD9A before routing.

  20. 20·Transfer tokens

    Sends collateral_needed_to_repay_flashloan of the collateral token to the Solver address.

  21. 21·Get solution

    Hands the transferred tokens to the solver for routing, then verifies the outcome.

  22. 22·Get token balance

    Reads the loan token balance held by that same address again after routing.

  23. 23·Calculate

    Subtracts the pre-routing balance from the post-routing balance to measure how much loan token the routing produced.

  24. 24·Compare two values

    Checks whether that gained amount is greater than or equal to the supplied assets amount.

  25. 25·Predicate

    Requires that comparison to be true, so the plug reverts unless routing returned at least the required loan token.

  26. 26·End block

    Closes the innermost open block.

  27. 27·End block

    Closes the remaining open block.

Get expiry of
Is in the
Get total supplied and borrowed in
Get account data in of
Is
Get market parameters of
Use where
borrow_sharesis
total_borrow_assetsis
total_borrow_sharesis
Set to
Set to
Flash loan
Repay to
Withdraw collateral from
Get price of in
Calculate
Set to
Get
Get balance of held by
Transfer to
Get solution
Get balance of held by
Calculate
Is
End block
End block
  • Exit Morpho at Epoch End

    pendle
    time
    boolean