Morpho: Auto Leverage Trigger
0x581BEf12967f06f2eBfcabb7504fA61f0326CD9A

What this does

This plug adjusts a Morpho Blue position toward a target loan-to-value by flash-loaning the loan token, swapping into collateral, supplying it, and borrowing against it. It asks the caller for account, market, triggerLTV, targetLTV, maxSlippage, and numChunks. It fires only when the position carries nonzero debt and its collateral value sits below the scaled triggerLTV threshold. Running it by hand or on a stale oracle price risks sizing the borrow and collateral swap wrong and breaching the maxSlippage bound.

Actions · 24

  • Get market parameters
    Get market parameters of
    Reads a Morpho Blue market's immutable parameters.
  • Get account data
    Get data in of
    Reads an address's position in a Morpho Blue market: shares, collateral, debt, and health factor.
  • Get price
    Get price of in
    Reads a Morpho Blue market's oracle price of its collateral in its loan asset.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Compare two values
    Is
    Compares two values with a chosen operator and returns a boolean.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Compare two values
    Is
    Compares two values with a chosen operator and returns a boolean.
  • Compare two values
    Is
    Compares two values with a chosen operator and returns a boolean.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Flash loan
    Flash loan
    Borrows any token the Morpho Blue singleton holds, fee-free, repaid inside this transaction.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Use
    Use where
    accountis
    sellAmountis
    sellTokenis
    buyTokenis
    minReceiveis
    Composes another plug inside this one.
  • Supply Collateral
    Supply as collateral to
    Supplies an asset as collateral to a Morpho Blue market.
  • Borrow
    Borrow from
    Borrows the loan asset from a Morpho Blue market against your supplied collateral.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.

Related plugs · 8