Morpho: Get Health Factor
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a Morpho position's health factor by multiplying collateral_value by lltv and dividing by debt, rounding down. It asks the caller for collateral_value, lltv, and debt at execution time. It requires debt to be above zero before computing, since a zero debt would leave the division unresolved. Computing this by hand or reading it off a stale collateral, lltv, or debt figure yields a health factor that misstates how close the 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