


Acts onchain
Borrows any token the Morpho Blue singleton holds, fee-free, repaid inside this transaction. The action opens a block: the steps inside spend the borrowed funds, and before the block ends the socket must hold the principal, surfaced as the owed output, or the whole transaction reverts. Repayment approval is handled here. There is no premium and no market to choose, only the token. Reach for it to refinance debt across protocols with no capital, to unwind a leveraged position by repaying before withdrawing collateral, or to fund an arbitrage across venues.
Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.
Pendle Leveraged PT Auto Rollover



1·Take
The caller names an expiring Pendle market at slot 0.0, declaring the parameter that drives the whole rollover.
2·Get expiry
Reading the named market's expiry gives the maturity timestamp that gates the actions below.
3·Get current timestamp
Block time is fetched as Unix seconds for comparison against that maturity.
4·Predicate
Requiring the current timestamp be greater than or equal to the expiry confirms the named market has already matured.
5·Get tokens
SY, PT, and YT token addresses of the matured market are read for later token checks.
6·Expect witness
A bytes32 witness hole is opened; the solver will supply a Morpho market id, judged inside this block.
7·Get market parameters
Immutable parameters of that Morpho market are read: loan token, collateral token, oracle, and fixed fields.
8·Predicate
Requiring the market's collateral token equal the matured market's PT ties the id to the position being unwound.
9·Get account data
Your wallet's position in that market is read, giving shares, collateral, supplied assets, debt, and health.
10·Predicate
Testing the position's collateral figure greater than 0 confirms an open position exists.
11·End block
The witness block closes, having verified the source market and its position.
12·Expect witness
An address witness hole is opened; the solver supplies the destination Pendle market, judged inside this block.
13·Check market validity
The candidate destination market is checked against the Pendle v6 factory.
14·Predicate
Requiring that validity check equal true rejects any market the v6 factory did not deploy.
15·Get tokens
SY, PT, and YT token addresses of the destination market are read.
16·Predicate
Requiring the destination SY equal the source SY confirms both markets share the same underlying yield token.
17·Get expiry
The destination market's expiry is read.
18·Predicate
Requiring that expiry be greater than the source maturity ensures the rollover moves into a later-dated market.
19·End block
The address witness block closes, having verified the destination market.
20·Expect witness
A second bytes32 witness hole is opened; the solver supplies the destination Morpho market id, judged here.
21·Get market parameters
Immutable parameters of the destination Morpho market are read.
22·Predicate
Requiring its collateral token equal the destination PT ties the id to the new position.
23·Predicate
Requiring its loan token equal the source market's loan token keeps the borrowed asset consistent across the roll.
24·Check oracle provenance
The destination market's oracle is checked against the Morpho Chainlink oracle factory.
25·Predicate
Requiring that provenance check equal true rejects any oracle the factory did not deploy.
26·Get oracle feeds
The oracle's composition is read: its base and quote feeds and vaults.
27·Get oracle
Pendle's 900-second TWAP PT-to-asset oracle for the destination market is looked up.
28·Predicate
Requiring the verified Morpho oracle equal the Pendle TWAP oracle confirms the Morpho market prices PT off Pendle's feed.
29·End block
The destination witness block closes, all markets and oracles verified.
30·Flash loan
A fee-free Morpho flash loan is taken in the loan token for the wallet's borrow-assets amount, repaid within this transaction.
31·Repay
The borrowed loan token repays the debt to the source Morpho market from the socket's balance.
32·Withdraw Collateral
Collateral is withdrawn for the position's supplied-assets amount in the source PT back to the socket.
33·Redeem
The withdrawn source PT is redeemed in the matured market for SY.
34·Buy
That SY buys destination PT on the destination market, accepting any amount out.
35·Supply Collateral
The bought destination PT is supplied as collateral to the destination Morpho market.
36·Borrow
The loan token is borrowed from the destination market to settle the flash loan.
37·End block
The outer block closes, ending the transaction.
Borrow on Base · 7 plugs
Posts · 6
More on Morpho · 16

















On other protocols · 2