Skip to content

feat: epoch detail claimed/unclaimed, closed webhook, comparison & projection - #903

Merged
Jayy4rl merged 2 commits into
StellarYield:mainfrom
Yilkash:feat/epoch-detail-818-819-820-821
Jul 27, 2026
Merged

feat: epoch detail claimed/unclaimed, closed webhook, comparison & projection#903
Jayy4rl merged 2 commits into
StellarYield:mainfrom
Yilkash:feat/epoch-detail-818-819-820-821

Conversation

@Yilkash

@Yilkash Yilkash commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements all 4 assigned epoch-related issues:

#818 — Add claimed/unclaimed totals to epoch detail

  • now returns and fields
  • = sum of and events
  • = (never negative)
  • Acceptance criteria:

#819 — Fire epoch.closed webhook when all yield is claimed

  • Adds column to table (migration 030)
  • After each yield claim, the indexer checks if
  • If so, sets (idempotent — fires at most once per epoch)
  • Emits webhook with
  • Re-processing the same event does not re-fire the webhook

#820 — Add epoch comparison endpoint

  • Returns both epochs side-by-side with: yieldAmount, totalShares, yieldPerShare, distributedAt, participationRate
  • Includes delta: { yieldAmount, yieldPerShare } (b minus a)
  • Returns 404 if either epoch does not exist

#821 — Add next epoch projection endpoint

  • Returns { estimatedYieldAmount, estimatedDistributionDate, basedOnEpochs }
  • Uses rolling average of last 3 epochs' yield amounts and time intervals
  • Returns null for all fields if fewer than 2 epochs exist

Testing

  • All 414/415 tests pass (1 pre-existing failure in indexer.test.ts trace span logging)
  • All yield, webhook, and notification tests pass
  • TypeScript compiles cleanly with tsc --noEmit

Migration

  • New migration: 030_epoch_closed_at.sql — adds closed_at TIMESTAMPTZ to epochs table

Closes #818
Closes #819
Closes #820
Closes #821

…& projection endpoints

- StellarYield#818: Add totalClaimed/totalUnclaimed to epoch detail endpoint
- StellarYield#819: Fire epoch.closed webhook when all yield is claimed (idempotent via closed_at)
- StellarYield#820: Add epoch comparison endpoint (GET /epochs/compare?a=&b=)
- StellarYield#821: Add next epoch projection endpoint (rolling avg of last 3 epochs)

Closes StellarYield#818
Closes StellarYield#819
Closes StellarYield#820
Closes StellarYield#821
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Yilkash 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

@Jayy4rl
Jayy4rl merged commit a1b01b6 into StellarYield:main Jul 27, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants