Morpho: Get Health Factor
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a Morpho position's health factor as collateral value scaled by loan-to-value divided by outstanding debt, rounded down. It asks the caller for collateral_value, lltv, and debt at execution time. It proceeds only when debt is greater than zero, reverting when no debt is present. Running this by hand or against stale collateral, lltv, or debt figures yields a health factor that misstates how close a position sits to liquidation.

Actions · 6

  • 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.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Multiply then divide
    Calculate times divided by rounded
    Multiplies two values and divides by a third in one step, rounding up or down.
  • 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.

Related plugs · 8