Skip to content

recover H1/H2 onto main (stacked-merge fix) - #14

Merged
jayeshy14 merged 1 commit into
mainfrom
fix/recover-h1-h2
Jul 18, 2026
Merged

jayeshy14 merged 1 commit into
mainfrom
fix/recover-h1-h2

Conversation

@jayeshy14

Copy link
Copy Markdown
Owner

PR #13 was merged into its base branch fix/h3-per-share-floor rather than main (the recurring stacked-PR footgun), so the H1/H2 high-water-mark fee + minimum-term-duration fix never reached main (highWaterPerShareWad was absent). This cherry-picks the single H1/H2 commit (578a767) cleanly onto current main. Suite 116 -> 120, green. See #13 for the full finding/fix description.

Audit H1/H2: the performance fee was charged on (nav - protectedAmount),
i.e. NAV above the 90% floor, so a flat term (nav 100 vs floor 90) or a
losing term (nav 95) still minted a 'performance' fee; and because every
new term re-strikes the floor at 0.9x current nav with no minimum term,
a keeper could loop settleTerm->startTerm to mint ~perfBps*(1-P) of NAV
per cycle indefinitely.

Fix: the performance fee is now charged only on the rise in navPerShare
above a per-share high-water mark, which then ratchets up. Flat/losing
terms and re-struck terms where navPerShare has not advanced pay zero,
and gains are never double-charged across terms. HWM is seeded at the
first startTerm's entry price. Also added a 7-day MIN_TERM_DURATION in
the controller as anti-churn defense-in-depth. Composes with the H3
per-share design (deposits never move navPerShare, so the basis is
clean). Regression tests: no fee on flat/losing terms, HWM holds across
terms, min-term blocks 1-second churn. 116 -> 120.
@jayeshy14
jayeshy14 merged commit 14b96ef into main Jul 18, 2026
3 checks passed
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.

1 participant