accountable: floor NAV depositors leg at zero, fixes negative fees - #8790
accountable: floor NAV depositors leg at zero, fixes negative fees#8790pawel-accountable wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughChangesPriced-vault yield calculation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized change floors the depositor share-price leg at zero so losses cannot produce negative fees while preserving normal-day calculations; no actionable merge-blocking risk remains after normal checks and review. Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The accountable.ts adapter exports: |
bheluga
left a comment
There was a problem hiding this comment.
@pawel-accountable thanks for the PR
Ideally we shouldn't be capping losses, or else it inflates cumulative fees.
Summary
dailyFees/dailyRevenuewere computed fromgross = (closeAssets - openAssets) + mintedAssets, with no floor. A NAV write-down (or any day the on-chain share value dips between the two read blocks) pushedgrossnegative, and the performance-fee split (fee = gross * performanceFee / DENOM) went negative with it, so a legitimate vault loss surfaced as negative revenue rather than being absorbed.bigMax(0n, closeAssets - openAssets)) before adding the minted-shares leg, sogrossis only ever the real crystallized/accrued value, never negative.Test plan
dailyFees/dailyRevenue/the depositors leg are never negative after the fix, non-write-down days are byte-for-byte unchanged, and the write-down+mint case now reports the full minted amount instead of a netted-down figure.tsc --project tsconfig.json --noEmit: clean.