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

CS-BOLD-021 Medium 5.5: Batches Can Be Used to Make Two Free Adjustments in a Row #462

Closed
bingen opened this issue Oct 8, 2024 · 0 comments · Fixed by #520
Closed

CS-BOLD-021 Medium 5.5: Batches Can Be Used to Make Two Free Adjustments in a Row #462

bingen opened this issue Oct 8, 2024 · 0 comments · Fixed by #520
Assignees

Comments

@bingen
Copy link
Collaborator

bingen commented Oct 8, 2024

Whenever a trove's interest rate is adjusted, it is checked when the trove's last adjustment took place. If it is less than INTEREST_RATE_ADJ_COOLDOWN ago, the upfrontfee for an early adjustment is charged.
However, the setBatchManagerAnnualInterestRate function only takes into account the last adjustment of the batch, not of the individual troves.
This means a user can do the following repeatedly:

  1. Wait until their batch's (and trove's) last adjustment was more than INTEREST_RATE_ADJ_COOLDOWN ago.
  2. Join another batch with a different interest rate, that was adjusted more than INTEREST_RATE_ADJ_COOLDOWN ago.
  3. Adjust the interest rate of the new batch.
  4. Wait until the batch adjustment was more than INTEREST_RATE_ADJ_COOLDOWN ago.
  5. Join the first batch again (set the desired interest rate after step 1.)
  6. Adjust the interest rate of the first batch.

In this way, the user is able to adjust their interest rate twice in a row (steps 2./3., as well as steps 5./6.)
without paying the upfrontfee. Additionally, they only need to wait for the INTEREST_RATE_ADJ_COOLDOWN to pass once per pair of adjustments. This is because the trove gets to take advantage of the cooldown on both batches passing simultaneously.

@bingen bingen self-assigned this Oct 8, 2024
@bingen bingen changed the title CS Medium 5.5: Batches Can Be Used to Make Two Free Adjustments in a Row CS-BOLD-021 Medium 5.5: Batches Can Be Used to Make Two Free Adjustments in a Row Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant