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

fix: only award redeem premium upto the secure threshold #589

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sander2
Copy link
Member

@sander2 sander2 commented May 4, 2022

2 significant changes:

  • Only award a premium for the amount of tokens required to bring the vault back to the secure threshold. Otherwise the vault could end up paying the premium for all of its tokens.
  • Rather than only considering issued_tokens to determine whether or not a vault is below the premium redeem threshold, now use the "to_be_backed" tokens, i.e. the tokens if all open issues and redeems execute successfully (= issued + to_be_issued - to_be_redeemed). This is required because otherwise additional redeems would again be able to de a premium redeem.

Since this significantly modifies audited code, I'd like to have 2 people approve this PR before we merge

@sander2 sander2 requested review from gregdhill and nud3l May 4, 2022 18:07
@sander2
Copy link
Member Author

sander2 commented May 5, 2022

I just realized that by doing the premium redeem, the collateral decreases. I didn't account for that in the premium cap calculation - should I? That's going to complicate the calculation

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.

1 participant