Skip to content

Add moving average calculation for fee trend analysis in fees/trend.ts #781

Description

@Kingsman-99

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

  • computeMovingAverage(samples: number[], windowSize: number): number[] is exported
  • The function returns a Simple Moving Average series of the same length, with the first windowSize - 1 entries padded as NaN
  • windowSize must be at least 1; values less than 1 throw a RangeError
  • Unit tests pass

Context

  • Target file: src/fees/trend.ts
  • The function must be pure (no side effects, no state mutation)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions