Skip to content

feat(backend): add GET /api/stats/revenue-history returning daily revenue totals for the past 30 days #447

Description

@Dev-AdeTutu

Summary

The GET /api/stats endpoint returns total cumulative revenue but no time-series breakdown. Add a /revenue-history sub-route that aggregates payment events by day so the admin dashboard can render a revenue trend chart.

Acceptance Criteria

  • GET /api/stats/revenue-history?days=30 returns { history: [{ date, revenue_xlm }] }
  • Days parameter capped at 90
  • Sourced from Soroban payment events filtered by contract ID
  • Cached for 60 seconds

Files to touch

  • backend/src/routes/stats.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions