# Redemptions

To maintain nUSD’s peg, redemptions allow any user to redeem 1 nUSD for $1 of cBTC.

If the price of nUSD falls below $1, arbitrageurs can buy nUSD on the open market to redeem the underlying collateral from Nectra for a profit.

## Ordering and Risk

When redemptions occur, buckets are redeemed in order of the buckets with the lowest interest rate to the highest interest rate. Collateral is redeemed at 1:1, thereby paying off the associated debt. If a bucket no longer has any remaining collateral, the next lowest bucket will be redeemed against.

Within a bucket, redemptions are applied proportionally across all outstanding positions. The distribution of redemptions ensures that they are distributed fairly among borrowers offering the same interest rate.

## Profitability

The potential profit from redemption arbitrage can be calculated as follows:

$$
\text{Profit} = \text{RedemptionAmount} \times (1 - \text{nUSDPrice} - \text{RedemptionFee})
$$

Where:

* ***Profit*** represents the potential earnings from a single redemption arbitrage transaction.
* ***RedemptionAmount*** is the amount of nUSD being used for the redemption.
* ***1*** is the target peg price of nUSD.
* ***nUSDPrice*** is the current market price of nUSD (which would be below $1 to make arbitrage profitable).
* ***RedemptionFee*** is the fee charged by the Nectra protocol for performing a redemption.

This calculation shows that a profit can be made when the cost of acquiring nUSD (at the market price) plus the redemption fee is less than the value of the cBTC received ($1 per nUSD redeemed).

The larger the trade size and the greater the difference between $1 and the sum of the nUSD price and redemption fee, the higher the potential profit.

## Redemption Fee

To manage the pace of redemptions, a dynamic redemption fee is applied on top of a 0.5% base fee and is paid to the Savings Account module. This fee scales upwards with increasing redemption volume, acting as a temporary deterrent, and then gradually decreases over 6 hours to help the system return to equilibrium.

The redemption fee comprises 3 components: the base fee ($f\_{min}$) of 0.5%, a linearly decaying buffer based on time, and the proportion between the current redemption amount and the nUSD total supply. The linearly decaying factor at time $t\_i$ is calculated as:

$$
\beta\_{(t\_i)} = \beta\_{(t\_{i-1})}\times(1 - \frac{\Delta t}{P})
$$

Where:

* ***B***<sub>***(ti)***</sub> represents the current value for the linearly decaying buffer.
* ***B***<sub>***(ti-1)***</sub> represents the previous value for the linearly decaying buffer.
* ***Delta t*** represents the time since the buffers' last update time, measured in seconds.
* ***P*** represents the configured period that resets the buffer to 0

By combining all 3 components, the redemption fee rate can be calculated for time $t\_i$ using:

$$
f(t\_i) = f\_{min} + \frac{K \times \[(\beta\_{(t\_i)} + T) \times \ln(\frac{T}{T - a}) - a]}{a}
$$

Where:

* ***f***<sub>***min***</sub> is being used to represent the base redemption fee rate of 0.5%.
* ***K*** represents a constant spike scaler, currently set to 1.
* ***a*** is used to represent the amount of nUSD being redeemed.
* ***T*** represents the total supply of nUSD.

After ***B***<sub>***ti***</sub> is used to calculate the redemption fee, the buffer is increased by the redemption amount, and the buffer's last update time is set to the current time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nectra.xyz/redemptions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
