# Redemption Rate Bounds

**URL:** <https://community.reflexer.finance/t/redemption-rate-bounds/301>\
**Category:** General Discussion\
**Created:** [May 31, 2022, 2:44pm UTC](https://community.reflexer.finance/t/redemption-rate-bounds/301 "2022-05-31T14:44:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![btbt](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@btbt](https://community.reflexer.finance/u/btbt)\
**Post date:** [May 31, 2022, 2:44pm UTC](https://community.reflexer.finance/t/redemption-rate-bounds/301/1 "2022-05-31T14:44:35Z")

</div>

The redemption rate is currently bounded in the RAI protocol. These bounds set the per-second minimum and maximum values that the redemption rate can have.

### Current Mainnet Values

The mainnet redemption rate bounds can be found in the [Oracle Relayer](https://etherscan.io/address/0x4ed9C0dCa0479bC64d8f4EB3007126D5791f7851), as the `redemptionRateLowerBound` and `redemptionRateUpperBound`.

| Parameter | Value |
| --- | --- |
| `redemptionRateLowerBound` | 999999934241503702775225172 |
| `redemptionRateUpperBound` | 1000000065758500621404894451 |

### Conversion to Annual Rates

The above values are `RAY`s in the system, which means they represent numbers with 27 decimal places.

To convert to annual rates, they must first be converted to per-second ones. Annual rates can be calculated by exponentiating per-second rates to the number of seconds in a year.

annual lower bound = (redemptionRateLowerBound/1e27)^(86400\*365)

### Redemption Rate Bounds as Annual Rates

| Parameter | Annual Value |
| --- | --- |
| `redemptionRateLowerBound` | (999999934241503702775225172/1e27)^(86400\*365) ~= 0.1257 |
| `redemptionRateUpperrBound` | (1000000065758500621404894451/1e27)^(86400\*365) ~= 7.9547 |

These convert to approximately -88% APY and 695% APY.

### Under What Conditions Will the Bounds Be Hit?

The system uses the RAI/USD market price TWAP to determine the latest redemption rate.

Using the mainnet controller settings, we can determine what RAI/USD TWAP values will cause the lower and upper redemption rate bounds to be hit.

#### Mainnet Controller Parameters

| Parameter | Value | Description |
| --- | --- | --- |
| Kp | 7.5e-8 | Proportionate Constant |
| Ki | 2.4E-14 | Integral Constant |
| alpha | 0.9999997112 | Integral leak decay |

# Scenario #1 P-only Deviation

To calculate what market price deviation would cause the proportionate part of the redemption rate to hit the lower bound, we can use the proportionate part of the PI calculation.

1 - Kp\*(redemptionPrice - marketPrice) = redemptionRateLowerBound

Solve for lower bound using mainnet Kp:

1 - 7.5e-8\*(redemptionPrice - marketPrice) = 0.999999934241503702775225172

1-0.999999934241503702775225172 = 7.5e-8\*(redemptionPrice - marketPrice)

(1-0.999999934241503702775225172)/(7.5e-8) = redemptionPrice - marketPrice ~= 0.877

Similarly, for the redemptionRateUpperBound:

(1-1.000000065758500621404894451)/7.5e-8 = redemptionPrice - marketPrice ~= -0.877

If the market TWAP of RAI/USD achieves a ± 0.88 deviation, the redemption rate will hit it’s upper/lower bound.

# Scenario #2 Sustained Deviations

Using mainnet Kp, Ki and alpha parameters, we have calculated what types of **sustained** deviations will cause the redemption rate to hit upper or lower bounds.

| Deviation, $ | Length of deviation |
| --- | --- |
| ± 0.5 | 45 days |
| ± 0.6 | 22 days |
| ± 0.7 | 11 days |
| ± 0.8 | 4 days |
