Skip to content

feat(analytics): implement collection stats and floor price history#134

Open
aadviksinghdebug wants to merge 2 commits intoNFTopia-Foundation:mainfrom
aadviksinghdebug:feat/analytics-collection-stats
Open

feat(analytics): implement collection stats and floor price history#134
aadviksinghdebug wants to merge 2 commits intoNFTopia-Foundation:mainfrom
aadviksinghdebug:feat/analytics-collection-stats

Conversation

@aadviksinghdebug
Copy link
Copy Markdown

Summary

  • Implements CollectionStats entity to store daily aggregated collection data (volume, floor price, sales count)
  • Adds AnalyticsService with a midnight cron job that aggregates previous day's completed sales per collection by joining orders → nfts
  • Floor price computed from minimum active listing price per collection
  • Exposes GET /api/v1/collections/:id/stats?from=&to= returning both raw stats and chart-ready [timestamp, value] arrays
  • Registers ScheduleModule.forRoot() via AnalyticsModule, enabling all existing cron jobs (listing expiry, auction settlement)

Changes

  • src/modules/analytics/entities/collection-stats.entity.ts — new entity
  • src/modules/analytics/analytics.service.ts — aggregation logic + cron job
  • src/modules/analytics/analytics.controller.ts — stats endpoint
  • src/modules/analytics/analytics.module.ts — module wiring
  • src/app.module.ts — registers AnalyticsModule

Closes #83

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@aadviksinghdebug Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@aadviksinghdebug
Copy link
Copy Markdown
Author

@Cedarich please review my PR

1 similar comment
@aadviksinghdebug
Copy link
Copy Markdown
Author

@Cedarich please review my PR

@aadviksinghdebug
Copy link
Copy Markdown
Author

@Cedarich please review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📊 Feat: NFT Analytics & Aggregation Service

2 participants