Skip to content

Separate minted and boosted shares on vault position - #824

Merged
evgeny-stakewise merged 3 commits into
v5-releasefrom
refactor/boosted-shares-field
Aug 20, 2026
Merged

Separate minted and boosted shares on vault position#824
evgeny-stakewise merged 3 commits into
v5-releasefrom
refactor/boosted-shares-field

Conversation

@evgeny-stakewise

@evgeny-stakewise evgeny-stakewise commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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_shares carried two semantically different values: it started as the raw minted amount from the subgraph, then _reduce_boosted_amount destructively 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_shares stays the raw subgraph value.
  • VaultOsTokenPosition.boosted_shares holds the part backing a leverage strategy position.
  • VaultOsTokenPosition.redeemable_shares is a derived property: max(minted_shares - boosted_shares, 0).

Follow-on changes:

  • _reduce_boosted_amount -> _distribute_boosted_shares: assigns boosted_shares instead of mutating minted_shares, and no longer returns the allocator list it was handed.
  • The per-user residual (boosted shares with no same-vault mint to match against) moved from a returned dict into an Allocator.residual_boosted_shares field, so it travels with the object it describes.
  • Allocator.total_shares -> total_redeemable_shares, and it and vaults_proportions are now computed from redeemable_shares.
  • Variables renamed to match: min_minted_shares -> min_redeemable_shares, address_to_minted_shares -> address_to_redeemable_shares.

@evgeny-stakewise
evgeny-stakewise force-pushed the refactor/boosted-shares-field branch from 6e91b51 to 3df3598 Compare August 19, 2026 14:54
@evgeny-stakewise evgeny-stakewise changed the title Track boosted osToken shares without mutating minted shares Separate minted and boosted shares on vault position Aug 19, 2026
@evgeny-stakewise
evgeny-stakewise merged commit 701f594 into v5-release Aug 20, 2026
7 checks passed
@evgeny-stakewise
evgeny-stakewise deleted the refactor/boosted-shares-field branch August 20, 2026 08:15
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.

2 participants