Summary
The 24h trading volume for a creator is computed inline in the creator detail and trending endpoints independently, each with slightly different time window logic. A shared helper should centralise this calculation so the result is consistent across all surfaces.
Scope
- Add
compute24hVolume(creatorId: string, db: Database): Promise<bigint> helper
- Sum the
price field of all trade records for the creator within the last 24 hours
- Time window is rolling — based on current time minus 24 hours, not calendar day boundaries
- Add unit tests: trades all within window included, trades outside window excluded, no trades returns 0
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The 24h trading volume for a creator is computed inline in the creator detail and trending endpoints independently, each with slightly different time window logic. A shared helper should centralise this calculation so the result is consistent across all surfaces.
Scope
compute24hVolume(creatorId: string, db: Database): Promise<bigint>helperpricefield of all trade records for the creator within the last 24 hoursAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram