Description
fees/trend.ts collects fee samples over time but only exposes raw data and no derived statistics. A moving average would smooth noise and give callers a reliable signal for fee forecasting.
Acceptance Criteria
Context
- Target file:
src/fees/trend.ts
- The function must be pure (no side effects, no state mutation)
Description
fees/trend.tscollects fee samples over time but only exposes raw data and no derived statistics. A moving average would smooth noise and give callers a reliable signal for fee forecasting.Acceptance Criteria
computeMovingAverage(samples: number[], windowSize: number): number[]is exportedwindowSize - 1entries padded asNaNwindowSizemust be at least 1; values less than 1 throw aRangeErrorContext
src/fees/trend.ts