This plug refinances a Morpho Blue borrow position from market 0x3a85...ee49 into market 0x09dc...631c, both at 86% LLTV, via a fee-free flash loan that repays the old debt, withdraws collateral, resupplies it, and reborrows in the new market. It asks the caller for minimum_apr_delta, minimum_health_factor, and liquidity_multiplier. It fires only when the composed Check Refinancing Constraints plug confirms the rate gap, health floor, and scaled liquidity all pass. Running this by hand across two markets or on a stale rate risks an under-collateralized or non-improving move.
Actions · 11
Getmarketparametersof
Reads a Morpho Blue market's immutable parameters.
Getmarketparametersof
Reads a Morpho Blue market's immutable parameters.
Usewhere
current_marketis
target_marketis
minimum_apr_deltais
minimum_health_factoris
liquidity_multiplieris
Composes another plug inside this one.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Flashloan
Borrows any token the Morpho Blue singleton holds, fee-free, repaid inside this transaction.
Repayto
Repays loan-asset debt to a Morpho Blue market from the socket's balance.
Withdrawfrom
Withdraws lent loan asset and accrued interest from a Morpho Blue market.
Supplyto
Lends the loan asset to a Morpho Blue market to earn the supply rate.
Borrowfrom
Borrows the loan asset from a Morpho Blue market against your supplied collateral.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.