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

[MEX-672] user estimated weekly rewards #1558

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

claudiulataretu
Copy link
Collaborator

Reasoning

  • estimated weekly boosted rewards will be used for energy calculator

Proposed Changes

  • added new field for BoostedRewardsModel: estimatedWeeklyRewards
  • added compute methods in farm and staking compute service to calculate estimated weekly rewards based on current week
  • added compute method in fees collector to calculate last week rewards in USD value

How to test

  • query should return estimated weekly rewards for user from a single staking contract
query StakingBoostedRewards {
    getStakingBoostedRewardsBatch(
        stakingAddresses: [<staking_address>]
    ) {
        estimatedWeeklyRewards(
            additionalUserEnergy: "0"
        )
    }
}
  • query should return estimated weekly rewards for user from a single farm contract
query FarmBoostedRewards {
    getFarmBoostedRewardsBatch(
        farmsAddresses: []
    ) {
        estimatedWeeklyRewards(
            additionalUserEnergy: "0"
        )
    }
}
  • query should return last weekly rewards in USD for user from a single farm contract
query UserFeesCollector {
    userFeesCollector {
        lastWeekRewardsUSD(
            additionalUserEnergy: "0"
        )
    }
}

EmanuelMiron
EmanuelMiron previously approved these changes Feb 10, 2025
mad2sm0key
mad2sm0key previously approved these changes Feb 10, 2025
EmanuelMiron
EmanuelMiron previously approved these changes Feb 10, 2025
@claudiulataretu claudiulataretu merged commit 61b8e2e into development Feb 11, 2025
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.

3 participants