Get Weight Target
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a weight target by reading the simple moving average for a token and scaling it against a WAD constant. It asks the caller for the token to measure and the window length used for the moving average. It fires whenever it is executed, taking the average over the supplied window as its basis. Computing this by hand or on a stale moving average risks returning a target that no longer reflects the token's recent price.

Actions · 4

  • Use
    Use where
    tokenis
    windowis
    Composes another plug inside this one.
  • Get constant
    Get constant
    Holds a well-known constant as a named value: max uint256, WAD, RAY, basis points, one, or zero.
  • Multiply then divide
    Calculate times divided by rounded
    Multiplies two values and divides by a third in one step, rounding up or down.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8