Set SMA Weight
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug sets the stored weight for one token slot by deriving it from a moving-average target and writing the result into the socket's weights map. It asks the caller for an index naming the token slot and an sma_window setting the moving-average window. It fires on execution, reading the tokens map at the index, composing the Get Weight Target plug, and recording the derived weight. Running this by hand or against a stale window records a weight that misprices the slot for later rebalancing.

Actions · 3

  • Read map value
    Read map value of in in
    Reads a value from a keyed map in the socket's persistent storage.
  • Use
    Use where
    tokenis
    windowis
    Composes another plug inside this one.
  • Set map value
    Set map value of in in to
    Writes a value into a keyed map in the socket's persistent storage.

Related plugs · 8