Get Target Balance
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a target token balance by taking a weighted portion of a total value and dividing it by a price. It asks the caller for weight as a percent, a total_value, and a price at execution time. It runs whenever it is invoked, producing target_balance as its output. Computing the weighted value and dividing by a stale price yields a target balance that no longer matches the value it was meant to represent.

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