feat: restrict active-loan withdrawals to cumulative lender allocations - #85
Open
microHoffman wants to merge 3 commits into
Open
feat: restrict active-loan withdrawals to cumulative lender allocations#85microHoffman wants to merge 3 commits into
microHoffman wants to merge 3 commits into
Conversation
microHoffman
changed the base branch from
v1.5-updates
to
v1.5-deployment-changes
February 9, 2026 13:26
Restore the base Aave lifecycle: supply while pooling, withdraw all at loan creation, and hold unused capital and repayments as cash during the loan. Allocate newly received cash once per share and debit each owner's remaining allowance on withdrawal or redemption. Move unclaimed allowances with share transfers so burning or moving shares cannot refresh a spent allocation. Guard allocation changes against token callbacks and locked loan settlement. Add real-token regressions and fuzz coverage, and update fork scenarios for the cumulative limits and Aave-independent repayment/collateral exits.
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.
An active-loan lender can withdraw only cash allocated to their shares. The original per-call proportional cap could be bypassed: with 100 shares and 20 cash, a 25-share lender could withdraw 5, then immediately withdraw another ~3.158. The vault now records and consumes each owner's allocation, so the second withdrawal is unavailable until more cash is received or an unclaimed allocation is transferred to them.
Aave behavior matches
v1.5-deployment-changes: deposits are supplied during pooling, all Aave assets are withdrawn at loan creation, and unused capital and repayments remain vault cash during the loan. The extra running/ending Aave supply and withdrawal logic and the unrelated stable-product fixture change have been removed from the PR diff.Validation:
--threads 1 --compute-units-per-second 30. Includes Aave unavailable after funding, interest accrual, proportional withdrawal/redemption, and full repayment/default lifecycles.