feat(backend): implement user predictions, event stats, indexer health, and email notifications#912
Merged
Olowodarey merged 3 commits intoMay 29, 2026
Conversation
…h, and email notifications Add creator-events prediction and statistics APIs, indexer health monitoring with Prometheus export and alerting, and an optional async email notification service with opt-in preferences support. Closes Arena1X#731, Arena1X#722, Arena1X#727, Arena1X#749
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@testersweb0-bug 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! 🚀 |
Ensure getPendingMatches handles missing event lookups and oracle unit tests mock eventRepository.find so CI test job passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements four backend features for creator events, indexer monitoring, and optional email notifications:
GET /api/v1/creator-events/:id/predictions/:addressreturns all user predictions for an event with enriched match details, correctness scoring, and 30-second response caching.GET /api/v1/creator-events/:id/statsreturns comprehensive event statistics including per-match prediction distribution, completion rate, and winner status with 2-minute caching.Changes
Creator Events (#731, #727)
getUserPredictionsForEvent()andgetEventStats()toCreatorEventsServicegetEventStatistics()andgetPredictionDistribution()wrappers toContractServiceContractPredictioninterface with on-chain fields (predicted_at,is_correct, etc.)CacheModuleinCreatorEventsModuleUserPredictionsResponseDto,EventStatsResponseDtoIndexer Health (#722)
IndexerHealthServicewith metrics aggregation and alert evaluationIndexerHealthControllerat/indexer/health/*IndexerServicewith events-per-minute tracking, manual sync trigger, and last-sync timestamp/indexer/health/prometheusEmail Notifications (#749)
EmailServicewith in-memory async queue and per-minute rate limitinguser_preferencestableSENDGRID_API_KEYis configured; console fallback in devNew Endpoints
/api/v1/creator-events/:id/predictions/:address/api/v1/creator-events/:id/stats/api/v1/indexer/health/api/v1/indexer/health/dashboard/api/v1/indexer/health/prometheus/api/v1/indexer/health/syncEnvironment Variables (optional)
SENDGRID_API_KEYEMAIL_FROMnotifications@insightarena.app)EMAIL_RATE_LIMIT_PER_MINUTETest plan
pnpm buildpassesGET /api/v1/creator-events/:id/predictions/:addressagainst testnet contractGET /api/v1/creator-events/:id/statsreturns expected distributionGET /api/v1/indexer/healthshows accurate lag and alertsGET /api/v1/indexer/health/prometheusscrapable by PrometheusPOST /api/v1/indexer/health/synctriggers poll (admin JWT)SENDGRID_API_KEYconfiguredCloses