What this does
This plug computes a simple moving average of a token's Chainlink USD price over a caller-set window of days and stores each day's price in socket storage. It asks the caller for a token address and a window count of periods. It runs on execution, reading the current timestamp, snapping to the day start, and looping once per day up to the window. Computing the average by hand or from a stale stored price risks a divisor mismatch or an out-of-date result.
Actions · 15















Related plugs · 8