Separate minted and boosted shares on vault position - #824
Merged
Conversation
evgeny-stakewise
force-pushed
the
refactor/boosted-shares-field
branch
from
August 19, 2026 14:54
6e91b51 to
3df3598
Compare
cyc60
approved these changes
Aug 20, 2026
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
Pure refactor of the boosted-shares handling in
update_redeemable_positions— no behaviour change. The matching logic itself landed in #814; this makes it object-oriented and easier to read.The core issue was that
minted_sharescarried two semantically different values: it started as the raw minted amount from the subgraph, then_reduce_boosted_amountdestructively subtracted the boosted amount from it, so afterwards the same field meant "shares available for redemption". Everything downstream had to know which phase it was in.The two values are now separate fields:
VaultOsTokenPosition.minted_sharesstays the raw subgraph value.VaultOsTokenPosition.boosted_sharesholds the part backing a leverage strategy position.VaultOsTokenPosition.redeemable_sharesis a derived property:max(minted_shares - boosted_shares, 0).Follow-on changes:
_reduce_boosted_amount->_distribute_boosted_shares: assignsboosted_sharesinstead of mutatingminted_shares, and no longer returns the allocator list it was handed.dictinto anAllocator.residual_boosted_sharesfield, so it travels with the object it describes.Allocator.total_shares->total_redeemable_shares, and it andvaults_proportionsare now computed fromredeemable_shares.min_minted_shares->min_redeemable_shares,address_to_minted_shares->address_to_redeemable_shares.