Get Weight Target
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes a weight target from a token's simple moving average scaled by WAD (1e18). It asks the caller for a token and a window defining the lookback period. It fires when invoked, composing the Get Simple Moving Average plug and then running a fixed-point multiply-divide rounded down. Computing this by hand or against a stale moving average produces a weight target that misstates the token's current position.

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