Skip to content

build: v3.1.0#112

Open
Schlagonia wants to merge 17 commits into
masterfrom
constant_accual
Open

build: v3.1.0#112
Schlagonia wants to merge 17 commits into
masterfrom
constant_accual

Conversation

@Schlagonia
Copy link
Copy Markdown
Collaborator

@Schlagonia Schlagonia commented Apr 27, 2026

Overview

This bumps the Tokenized Strategy API to v3.1.0 and adds constant accrual accounting while keeping the existing report flow available for harvest-style accounting.

Constant Accrual

  • ERC4626 views and write paths now use the strategy current _totalAssets() estimate once the accounting latch opens.
  • Deposits, mints, withdrawals, redeems, and relevant management setters sync through _accrue() before changing state.
  • Gains become visible in PPS as they accrue. Losses burn locked-profit buffer shares where possible, then flow through to PPS.
  • Performance and protocol fees are minted on accrued profit using the post-accrual PPS.
  • report() keeps the same role: it still calls _harvestAndReport(), records harvestable or lumpy deltas, charges fees, and locks reported profit according to profitMaxUnlockTime.

Other Changes

  • Splits read-only valuation into _totalAssets() and mutable reporting into _harvestAndReport().
  • Adds strategyTotalAssets() as a public view so integrations and the tokenized strategy can read the strategy valuation directly.
  • Adds TokenizedStrategyLib so strategy code can read tokenized strategy storage and views without the old self-call pattern.
  • Makes BaseStrategy initialization overridable for custom management, keeper, and performance fee recipient setup.
  • Adds lastAccrual() and lastTotalAssets() views for accounting state.
  • Mints dead shares for unsolicited assets before first deposit to avoid first depositor capture.
  • Blocks transfers from the strategy itself so locked-profit buffer shares cannot be moved.
  • Expands tests for live accrual, fee syncs, loss handling, public total-assets reads, library views, custom init, and profit locking.

@Schlagonia
Copy link
Copy Markdown
Collaborator Author

Fixes #114.

Schlagonia and others added 6 commits May 19, 2026 12:32
* refactor: add tokenized strategy library

* refactor: import tokenized strategy from base

* fix: init order

* fix: fail test
1 PM config(s); pin 5 deps; pin 7 actions

🛡️ Automated

Co-authored-by: Schlag <89420541+Schlagonia@users.noreply.github.com>
@Schlagonia Schlagonia changed the title build: constant accrual accounting build: v3.1.0 May 19, 2026
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