Repository navigation
feat(farming-pool): expose boost totals and multiplier change ledger - #592
Merged
ritaifeoluwa merged 1 commit intoOct 20, 2026
Conversation
Add read-only getters over state the contract already maintains: - get_total_boost_allocation(): sum of all users' boost allocations (SmartDropLabs#570) - get_boost_user_count(): number of users with a non-zero boost (SmartDropLabs#571) - get_average_boost_allocation(): mean boost per boosted user, rounded down (SmartDropLabs#572) - get_multiplier_change_ledger(): ledger of the last set_global_multiplier call, or 0 if never changed (SmartDropLabs#573) No storage layout or existing behaviour changes.
|
@devwura 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! 🚀 |
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four read-only getters over boost and multiplier state the farming pool already maintains. No storage layout or existing behaviour changes.
get_total_boost_allocation(): sum of all users' boost allocations ([enhancement] farming-pool: add feature 17 improvement #570)get_boost_user_count(): number of users with a non-zero boost ([enhancement] farming-pool: add feature 18 improvement #571)get_average_boost_allocation(): mean boost per boosted user, rounded down,0when none ([enhancement] farming-pool: add feature 19 improvement #572)get_multiplier_change_ledger(): ledger of the lastset_global_multipliercall,0if never changed ([enhancement] farming-pool: add feature 20 improvement #573)Each getter has a test in
soroban/contracts/farming-pool/src/test.rs.Notes
UniqueUserCountis deliberately not exposed. It is only ever incremented, never decremented (decrement_unique_user_counthas no callers), and a user's record is removed on full exit and counted again on re-stake. So it does not represent current unique users, and this is worth a separate look.cargo fmt --check, clippy with-D warnings, andcargo test.Closes #570
Closes #571
Closes #572
Closes #573