[fix] Preserve fractional averages in historical analytics
Labels: bug, backend, high-priority, points: 150 File/location: backend/src/services/analytics.service.ts:244
Description: SQL AVG(total_locked_amount) returns numeric values with fractional scale; converting values such as 1.5 (or 100.000...) with BigInt throws and turns the historical endpoint into an error.
Acceptance Criteria:
- [ ] Serialize PostgreSQL NUMERIC averages without passing fractional strings to BigInt; document the chosen output precision.
- [ ] Exercise integer-looking NUMERIC strings and a 1.5 average through both hourly and daily historical responses.
Notes: Executed getHistoricalAnalytics with a PostgreSQL-style average of 1.5000000000000000; it threw a BigInt conversion error.
Audited commit: 649b6976a100fd964ce191428eef1faeb50aaa39. Closest prior issues reviewed: #1480. This report concerns the specific failure or uncovered test paths described above, rather than repeating the original feature request.
@AminMG044 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
Hello, I went through the issue carefully and identified the relevant functionality involved. I have a clear plan for resolving it and would appreciate the opportunity to contribute.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @AminMG044 to this issue.
@Tee-Gee57 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
Hi @maintainers, I'd love to take this on. I've starred in the repository and I can cleanly fix this. Kindly assign this to me, thank you!
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Tee-Gee57 to this issue.
@0takuc0mrade has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
Hi maintainer, I can work on this
ℹ️ Repo Maintainers: To accept this application, review their application or assign @0takuc0mrade to this issue.
Congratulations, @0takuc0mrade! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.
🧑💻 @0takuc0mrade: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @0takuc0mrade as part of the Stellar Wave Program's 10th Wave 🥳
😎 @0takuc0mrade: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.