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
Calculateof
Calculates a proportion of a value using percent, basis points, WAD, or RAY units.
Setto
Assigns a value to a named variable that later steps reference.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.
Bubble
Surfaces a value as an output of this plug.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.