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

[SERVICES-2643] Fix staking rewards remaining days #1502

Merged

Conversation

mad2sm0key
Copy link
Contributor

Reasoning

  • Staking farms rewards remaining days computation is not APR bounded

Proposed Changes

  • Take extra rewards APR bounded per block into account when performing remaining days computation

How to test

query {
  filteredStakingFarms(filters: {}, pagination: { first: 200 }) {
    edges {
      node {
        address
        farmingToken {
          identifier
        }
        apr
        farmTokenSupply
        annualPercentageRewards
        perBlockRewards
        accumulatedRewards
        rewardCapacity
        rewardsRemainingDays
      }
    }
  }
}

@mad2sm0key mad2sm0key marked this pull request as ready for review October 7, 2024 12:34
@@ -325,10 +332,18 @@ export class StakingComputeService {
// 10 blocks per minute * 60 minutes per hour * 24 hours per day
const blocksInDay = 10 * 60 * 24;

const extraRewardsAPRBoundedPerBlock =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move this into Promise.all

@cfaur09
Copy link

cfaur09 commented Oct 7, 2024

Tested 🟢

@mad2sm0key mad2sm0key merged commit 908f583 into development Oct 7, 2024
1 check failed
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.

4 participants