Closed
Conversation
Replace instant exit fee distribution with linear drip over configurable dripDuration (default 7 days, bounds 7-60 days). Exit fees accumulate in undistributedFees and drip into totalPooledRnbw via _syncPool(), called before every state-changing operation. View functions use _effectivePooledRnbw() to reflect pending drip without mutating state. Resolves whale self-absorption (M-01) and APY manipulation (L-02).
Add 12 drip-specific tests covering linear distribution, overlapping fees, view function accuracy, residual sweep, self-absorption prevention, and configurable duration. Update 6 existing tests for delayed fee settlement. Add RNBWStakingHarness for internal _syncPool access. Update invariant tests to include undistributedFees in accounting.
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.
Linear Fee Drip System (resolves M-01, L-02)
totalPooledRnbwinstantly. They accumulate inundistributedFeesand drip linearly into the pool overdripDuration(default 7 days), producing a smooth exchange rate curve_syncPool()settles accrued drip before every state-changing operation_effectivePooledRnbw()view helper ensures frontend shows accurate exchange rate including pending dripsetDripDuration()admin function with bounds checking, syncs and recalculates active drip mid-streamemergencyWithdrawand residual sweep account forundistributedFeesDripDurationTooLow,DripDurationTooHigherrors andsetDripDuration()declaration