Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for yieldFeeBalance in twabSupplyLimit #93

Merged

Conversation

trmid
Copy link
Member

@trmid trmid commented Mar 20, 2024

The TWAB supply limit is expected to never be reached in a prize vault, but if a deployer makes a mistake or if the underlying asset has a highly fluctuating total supply, it's possible that it can be. In this case, the accrued yield fee balance must be protected so that the yield fee funds can't be locked in by depositors.

These changes ensure that the yield fee balance is always accounted for in the TWAB total supply limit and ensures that no new mints, deposits or liquidations can occur if they will exceed this limit.

Copy link

LCOV of commit a0045fa during coverage #504

Summary coverage rate:
  lines......: 99.5% (211 of 212 lines)
  functions..: 100.0% (56 of 56 functions)
  branches...: no data found

Files changed coverage rate:
                              |Lines       |Functions  |Branches    
  Filename                    |Rate     Num|Rate    Num|Rate     Num
  ==================================================================
  src/PrizeVault.sol          |99.5%    182| 100%    45|    -      0

src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
@trmid trmid requested a review from asselstine March 22, 2024 15:03
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Outdated Show resolved Hide resolved
src/PrizeVault.sol Show resolved Hide resolved
Copy link

LCOV of commit 478a5d9 during coverage #513

Summary coverage rate:
  lines......: 99.5% (215 of 216 lines)
  functions..: 100.0% (55 of 55 functions)
  branches...: no data found

Files changed coverage rate:
                              |Lines       |Functions  |Branches    
  Filename                    |Rate     Num|Rate    Num|Rate     Num
  ==================================================================
  src/PrizeVault.sol          |99.5%    186| 100%    44|    -      0

@trmid trmid merged commit c23db70 into main Mar 22, 2024
2 checks passed
@trmid trmid deleted the gen-1231-m-91m-244-twab-supply-limit-should-account-for-unrealized branch March 22, 2024 21:08
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.

None yet

2 participants