You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[fix] Depositor yield history clamps negative yield to zero, hiding real losses #1856
Description: buildDepositorYieldHistory computes netYield = Math.max(0, currentValue - depositedValue), so any bucket where a depositor's current position is worth less than their cost basis (e.g. after emergency-withdrawal share loss or a pool value decline) is reported as netYield: 0 instead of the actual negative value, misrepresenting the depositor's real performance on the yield-history chart/API response.
Acceptance Criteria:
netYield reflects the true signed difference (currentValue - depositedValue), including negative values, in the returned YieldHistoryPoint[]
A test constructs a scenario where currentValue < depositedValue (e.g. a large withdrawal after a value drop) and asserts the returned netYield is negative, not 0
Notes:
yieldHistoryService.test.ts:109 already comments 'may be slightly negative due to share price' while asserting only >= -1, which passes trivially against the current always->=0 behavior and does not actually catch this.
Filed via automated codebase sweep (backend / fix).
Congratulations, @Jubilee-001! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @Jubilee-001: 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.
Moderator's reason: [Auto-assessed] PR #1969 is merged (mergedAt timestamp 2026-10-10T10:06:49Z), cleanly removing the Math.max(0) clamp on netYield and adding unit tests covering negative yield scenarios as requested by issue #1856. There are no maintainer objections across any channel.
😎 @Jubilee-001: You earned 150 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.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.
Activity
davidchike587-cmyk commentedon Sep 28, 2026
@davidchike587-cmyk has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @davidchike587-cmyk to this issue.
Jubilee-001 commentedon Sep 29, 2026
@Jubilee-001 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Jubilee-001 to this issue.
drips-wave commentedon Sep 29, 2026
Congratulations, @Jubilee-001! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @Jubilee-001: 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 🌊
drips-wave commentedon Oct 13, 2026
This issue has been marked as completed by a Drips Wave moderator for @Jubilee-001 as part of the Stellar Wave Program's 9th Wave 🥳
Moderator's reason: [Auto-assessed] PR #1969 is merged (mergedAt timestamp 2026-10-10T10:06:49Z), cleanly removing the Math.max(0) clamp on netYield and adding unit tests covering negative yield scenarios as requested by issue #1856. There are no maintainer objections across any channel.
😎 @Jubilee-001: You earned 150 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.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.