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

[VEN -2250] Reduce reserves with available cash #414

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

coreyar
Copy link
Collaborator

@coreyar coreyar commented Dec 18, 2023

Description

When accruing interest we reduce reserves. If there isn't enough available cash the accrual would error which causes problems like preventing fresh account balances from being calculated.

This change reduces the reserves with available cash if it is less then the accrued revenue.

@coreyar coreyar force-pushed the VEN-2250-reduce-reserves-with-available-cash branch from 95997e4 to 0a245be Compare December 18, 2023 18:49
@coreyar coreyar force-pushed the VEN-2250-reduce-reserves-with-available-cash branch 2 times, most recently from 3db8306 to d57c5dc Compare December 18, 2023 20:25
@coreyar coreyar force-pushed the VEN-2250-reduce-reserves-with-available-cash branch 2 times, most recently from 7dc8fc1 to 4b4363a Compare December 18, 2023 20:51
@coreyar coreyar force-pushed the VEN-2250-reduce-reserves-with-available-cash branch 4 times, most recently from 6bf1da4 to 1526bdf Compare December 19, 2023 16:42
@chechu chechu added don't merge Need to merge after passing test audit This content is being audited labels Dec 19, 2023
If there is not enough cash to reduce reserves when accruing interest the call will break which
prevents calculating fresh balances.

Rather then error if reserves can't be reduced fully, we can reduce them with available cash
@coreyar coreyar force-pushed the VEN-2250-reduce-reserves-with-available-cash branch from 1526bdf to 53e37eb Compare December 19, 2023 17:06
Copy link

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.Admin 88% 41%
contracts.Comptroller 100% 90%
contracts.Comptroller.Diamond 95% 59%
contracts.Comptroller.Diamond.facets 77% 66%
contracts.Comptroller.Diamond.interfaces 100% 100%
contracts.DelegateBorrowers 100% 84%
contracts.Governance 0% 0%
contracts.InterestRateModels 47% 67%
contracts.Lens 44% 37%
contracts.Liquidator 98% 83%
contracts.Oracle 100% 100%
contracts.PegStability 88% 84%
contracts.Swap 89% 57%
contracts.Swap.interfaces 100% 100%
contracts.Swap.lib 81% 53%
contracts.Tokens 100% 100%
contracts.Tokens.Prime 96% 72%
contracts.Tokens.Prime.Interfaces 100% 100%
contracts.Tokens.Prime.libs 90% 76%
contracts.Tokens.VAI 71% 46%
contracts.Tokens.VRT 20% 9%
contracts.Tokens.VTokens 60% 42%
contracts.Tokens.XVS 19% 8%
contracts.Utils 49% 29%
contracts.VAIVault 50% 45%
contracts.VRTVault 49% 36%
contracts.XVSVault 64% 50%
contracts.lib 75% 25%
Summary 68% (3039 / 4462) 48% (1133 / 2344)

@chechu chechu added this to the 024 milestone Feb 7, 2024
@chechu chechu removed the don't merge Need to merge after passing test label Mar 6, 2024
@coreyar coreyar merged commit f8051fa into develop Mar 6, 2024
4 checks passed
@chechu chechu mentioned this pull request Mar 19, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit This content is being audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants