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-514] fix compute user APR if no total staked amount #1477

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

claudiulataretu
Copy link
Collaborator

@claudiulataretu claudiulataretu commented Sep 16, 2024

Reasoning

  • if user doesn't have any total staked amount registered, the query would return an error for non-nullable field
  • if user doesn't have any total farm amount registered, the query would return an error for non-nullable field

Proposed Changes

  • check for user total staked amount when computing boosted APR for staking
  • check for user total farm amount when computing boosted APR for farms

How to test

query StakingBoostedRewards {
    getStakingBoostedRewardsBatch(
        stakingAddresses: [
            <staking_address>
        ]
    ) {
        curentBoostedAPR
        maximumBoostedAPR
    }
}
  • query should return 0 for both fields if no total staked amount for user

gabrielmatei
gabrielmatei previously approved these changes Sep 16, 2024
mad2sm0key
mad2sm0key previously approved these changes Sep 16, 2024
@claudiulataretu claudiulataretu merged commit 3bc63f2 into development Sep 16, 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