
Morpho · Acts onchain
Lends the loan asset to a Morpho Blue market to earn the supply rate. The socket approves Morpho and supplies the exact asset amount; the call returns the assets and shares supplied. The supply earns the market's borrow rate net of fee, scaled by utilization. Reach for it to earn yield on idle loan asset, or as the last step of a strategy that has swapped into it earlier in the transaction.
Morpho: Refinance to Cheaper Borrow Market



1·Get market parameters
Immutable parameters of Morpho Blue market 0x3a85...ee49 at 86% LLTV are read, pulling in its loan token, collateral token, oracle, and fixed fields as the source of this refinance.
2·Get market parameters
Parameters of the second market 0x09dc...631c at 86% LLTV are read the same way, standing in as the destination the position moves into.
3·Take
A witness hole opens for minimum_apr_delta, the rate gap the refinance must clear, supplied by the caller at execution time.
4·Take
Next minimum_health_factor is taken, the floor the moved position's health must hold after the move.
5·Take
Rounding out the inputs, liquidity_multiplier is taken to scale the destination market's required liquidity.
6·Use
Composing the Morpho Check Refinancing Constraints plug runs the rate, health, and liquidity tests over the two named markets and returns its pass flag and figures.
7·Predicate
Requiring the constraints plug's output in slot 5.0 equal 1 gates everything ahead, so the flow proceeds only when all refinancing checks pass.
8·Flash loan
A fee-free Morpho flash loan is taken in the debt amount from slot 5.1 and the loan token from slot 0.0.0, repaid within this transaction.
9·Repay
That borrowed amount is repaid as loan-token debt to the source market from the socket's balance.
10·Withdraw
Your collateral, the supply figure in slot 5.3, is withdrawn from the source market back to the socket in its collateral token.
11·Supply
The withdrawn amount is supplied to the destination market as collateral in the destination's collateral token.
12·Borrow
Loan asset equal to the debt figure is borrowed from the destination market against the newly supplied collateral, funding flash-loan repayment.
13·End block
The conditional branch opened at the constraints check is closed.
14·End block
The remaining open block is closed, ending the transaction.
On other protocols · 4