Morpho: Check Refinancing Constraints
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug reads a source and destination Morpho Blue market and reports whether moving the position between them satisfies the refinancing constraints. It asks the caller for current_market, target_market, minimum_apr_delta, minimum_health_factor, and liquidity_multiplier. The pass flag comes true only when the rate gap clears minimum_apr_delta, the moved position's health holds minimum_health_factor, and destination liquidity meets the amount scaled by liquidity_multiplier. Evaluating these checks by hand or against a stale oracle price risks approving a refinance that fails one of the three constraints at execution.

Actions · 18

  • 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 total supplied and borrowed
    Get total supplied and borrowed in
    Reads a Morpho Blue market's totals: assets and shares supplied and borrowed.
  • Get market parameters
    Get market parameters of
    Reads a Morpho Blue market's immutable parameters.
  • Get price
    Get price of in
    Reads a Morpho Blue market's oracle price of its collateral in its loan asset.
  • Use
    Use where
    borrow_sharesis
    total_borrow_assetsis
    total_borrow_sharesis
    Composes another plug inside this one.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Use
    Use where
    current_marketis
    target_marketis
    minimum_apr_deltais
    Composes another plug inside this one.
  • Use
    Use where
    collateralis
    priceis
    lltvis
    debtis
    minimum_health_factoris
    Composes another plug inside this one.
  • Use
    Use where
    marketis
    debtis
    multiplier_definitionis
    Composes another plug inside this one.
  • 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.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8