liquity / bold

Liquity v2 monorepo containing the contracts, subgraph and frontend.
https://www.liquity.org/liquity-v2
45 stars 13 forks source link

CS-BOLD-018 Informational 7.15: Small Redemptions Do Not Increase Base Rate #491

Open bingen opened 1 month ago

bingen commented 1 month ago

The function CollateralRegistry._getUpdatedBaseRateFromRedemption calculates the base rate from the share of bold tokens that are redeemed.

// get the fraction of total supply that was redeemed
uint256 redeemedBoldFraction = _redeemAmount * DECIMAL_PRECISION / _totalBoldSupply;

As the redeemedBoldFraction is rounded down, splitting a redemption into multiple smaller ones can reduce the fee paid. The most extreme case are redemptions with redeemAmount < totalBoldSupply / 1e18, which will have their fraction rounded to zero, meaning they will not increase the base rate at all. However, multiple redemptions will incur higher gas costs.

bingen commented 1 month ago

For “the most extreme case”, assuming a total supply of 10B (1e10 * 1e18), the redeem amount would be 1e10 wei, i.e. 1e-8 BOLD. It doesn’t make sense to redeem such amount, as the amount paid in gas would be much higher.