
Pendle · Reads onchain state
Reads the SY, PT, and YT token addresses of a Pendle market. The market's readTokens returns all three, tagged as tokens. Reach for it when the market is chosen at runtime and later steps need the concrete addresses to approve, transfer, or read balances of.
Pendle Leveraged PT Auto Rollover



1·Take
The caller names an expiring Pendle market at slot 0.0, declaring the market this rollover acts on at execution time.
2·Get expiry
Pendle returns that named market's expiry timestamp, the maturity value the checks ahead compare against.
3·Get current timestamp
Block time is read as Unix seconds for the maturity comparison.
4·Predicate
Requiring the current timestamp be greater than or equal to the expiry, the plug advances only once the named market has matured.
5·Get tokens
Reading the named market's tokens gives its SY, PT, and YT addresses.
6·Expect witness
A bytes32 witness hole opens for the source Morpho market id the solver will supply, judged inside this block before use.
7·Get market parameters
Immutable parameters of that source Morpho market are read: loan token, collateral token, oracle, and fixed fields.
8·Predicate
Testing the source market's collateral token equal to the named market's PT ties the position to the matured PT.
9·Get account data
Your wallet's position in that source market is read, giving shares, collateral, debt, and health.
10·Predicate
Confirming your debt figure is greater than 0 establishes an open borrow exists to unwind.
11·End block
This closes the source-market witness block once its judgments hold.
12·Expect witness
An address witness hole opens for the destination Pendle market the solver will supply, judged inside this block.
13·Check market validity
Pendle's V6 factory is asked whether it deployed the candidate destination market.
14·Predicate
Requiring that factory answer equal true rejects any market the V6 factory did not deploy.
15·Get tokens
Reading the destination market's tokens gives its SY, PT, and YT addresses.
16·Predicate
Matching the destination market's SY against the source market's SY confirms both markets share the same SY asset.
17·Get expiry
Pendle returns the destination market's expiry timestamp.
18·Predicate
Requiring that destination expiry be greater than the source expiry ensures the roll targets a later maturity.
19·End block
This closes the destination-market witness block.
20·Expect witness
A bytes32 witness hole opens for the destination Morpho market id the solver will supply, judged inside this block.
21·Get market parameters
Immutable parameters of that destination Morpho market are read.
22·Predicate
Matching the destination Morpho collateral token against the destination market's PT confirms the new market takes the new PT as collateral.
23·Predicate
Matching the destination Morpho loan token against the source market's loan token keeps the borrow asset the same across the roll.
24·Check oracle provenance
The destination market's oracle is checked against the Morpho Chainlink oracle factory for provenance.
25·Predicate
Requiring that provenance answer equal true rejects any oracle that factory did not deploy.
26·Get oracle feeds
The destination oracle's composition is read: its two base feeds, two quote feeds, and base and quote vaults.
27·Get oracle
Pendle's oracle factory is queried for the 900 second TWAP PT-to-asset oracle of the destination market.
28·Predicate
Requiring the provenance-true result equal that Pendle oracle ties the destination oracle to the expected PT TWAP feed.
29·End block
This closes the destination Morpho witness block.
30·Flash loan
A fee-free Morpho flash loan is taken in the destination loan token for the borrow-assets amount, repaid within this transaction.
31·Repay
That borrowed amount is repaid as loan-token debt to the source Morpho market from the socket's balance.
32·Withdraw Collateral
Your collateral is withdrawn from the source market back to the socket in the source market's collateral token.
33·Redeem
The withdrawn PT is redeemed in the named source market for SY.
34·Buy
Redeemed SY buys PT on the destination market with no minimum out enforced.
35·Supply Collateral
The bought PT is supplied as collateral to the destination Morpho market.
36·Borrow
Loan asset equal to the Pendle oracle amount is borrowed from the destination market against the new collateral.
37·End block
The remaining open block is closed, ending the transaction.
On other protocols · 5