Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andrew7234/staking rewards api #921

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Andrew7234
Copy link
Collaborator

Adds an endpoint to fetch the staking rewards for a given account in a given calendar year.

Todo:
[] performance testing, especially on a large db with a full year's worth of data

Alternatives considered:

  • injecting synthetic events for each staking reward (delegator x delegatee x epoch). I didn't like this because it bloats the events table. At the start of 2025 there were ~62300 unique delegations, which over the course of a year would lead to 62300 * 365 * 24 = ~545 million synthetic events per year, not including prior history or new delegations that are created. Open to revisiting this approach or exploring alternatives based on the results of the performance tests though.

@Andrew7234 Andrew7234 force-pushed the andrew7234/staking-rewards-api branch from ac050e1 to ff4eb63 Compare March 3, 2025 17:47
@Andrew7234 Andrew7234 force-pushed the andrew7234/staking-rewards-api branch from ff4eb63 to 9aac5ca Compare March 3, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant