Get Target Balance
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a target balance from a weighted proportion of a total value divided by a supplied price. It asks the caller for three parameters: weight, total_value, and price. It fires whenever a caller runs it with those three values supplied at execution time. Computing this by hand or against a stale price yields a target balance that no longer matches the intended proportion of the total value.

Actions · 5

  • Calculate proportional value
    Calculate of
    Calculates a proportion of a value using percent, basis points, WAD, or RAY units.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • 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