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

feat: Add initial redemption base rate #110

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

bingen
Copy link
Collaborator

@bingen bingen commented Apr 10, 2024

And remove previous bootsrap 2-week lock for redemptions.

Closes #109 .

@bingen bingen self-assigned this Apr 10, 2024
@@ -3552,7 +3552,7 @@ contract("BorrowerOperations", async (accounts) => {
const baseRateBefore = await troveManager.baseRate();

// Artificially make baseRate 5%
await troveManager.setBaseRate(dec(5, 16));
await troveManager.setBaseRate(dec(6, 16));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it wasn't immediately obvious why this had to be changed to 6%, but I guess it's because it has to be higher than baseRateBefore, which is now 5%. Should the comment be updated too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right!

@danielattilasimon
Copy link
Collaborator

danielattilasimon commented Apr 11, 2024

From what I can tell this sets the initial baseRate to 5% as intended ✅ but doesn't actually enable the redemption fee, which remains hardcoded at 0%. I guess this is intended for now?

Also, as this lets the baseRate decay from the start: are we going to revisit the decay rate, or leave it be? Within 4 days it'll naturally decay from 5% to 0.3125%, which is not much of a bootstrap period in my opinion. I know we agreed to let it decay, but I can't remember the reasoning. Wouldn't it be better if the rate stayed at 5% for some period of time, and only started decaying after that? Redemptions would still be allowed at a fee rate of 5%. We could skip the baseRate increase during this bootstrap period so that the price floor doesn't drop below 0.95 if there are redemptions during that time.

Copy link
Collaborator

@RickGriff RickGriff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - though in practice if we want redemption fees for Dubai we need to add those back in.

constructor() ERC721(NAME, SYMBOL) {
// Update the baseRate state variable
// To prevent redemptions unless Bold depegs below 0.95 and allow the system to take off
baseRate = INITIAL_REDEMPTION_RATE;
Copy link
Collaborator

@RickGriff RickGriff Apr 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it still decays with the same half-life, in ~4 days it will be down to 0.2%. I wonder if this decrease is too rapid? We may want at least 1-2 weeks for TVL to build up.

Also, we've commented out redemption fees (see _calcRedemptionRate) so in practice no redemption fee will be charged until we change that.

@bingen
Copy link
Collaborator Author

bingen commented Apr 11, 2024

Wouldn't it be better if the rate stayed at 5% for some period of time, and only started decaying after that?

Yes, that sounds reasonable.
The problem is that it would miss the first part of the rationale (custom code just for a short period, features kicking in after deployment). But I guess it’s not a big deal.

Edit: Worst case we could put a crazily high initial base rate, so that it gets to 5% after the time we want (we should do the math). In practice it would be similar to block redemptions, which was the previous behaviour.

And remove previous bootsrap 2-week lock for redemptions.
Remove unused constant.
Add commen to test.
@bingen bingen merged commit 4e391cb into main Apr 11, 2024
6 checks passed
@danielattilasimon danielattilasimon deleted the initial_redemption_rate branch April 12, 2024 06:15
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.

Remove bootstrap redemptions lock
3 participants