# Changes and Improvements

## Distribution

### Max Distribution

In V2, we aim to provide a more stable APY across program duration. Early adopters still get better reward but later adopters now get a better reward right at the beginning. We achieve that by abandoning reward multiplication, so now users have a better base reward.

$$
D\_{max} = \frac{A
\_{max}}{P}
$$

## Reward

The rewards of users are the sum of all rewards in the past adjusted to the latest demand factor.

$$
R = DF\cdot \sum\limits\_{i=0}^t {D\_{max}\cdot\frac{S\_{i\_u}}{S\_i}}
$$

## Security Improvement

The Super Staking model heavily depends on token price which is provided by an oracle feed. In extreme cases when the oracle's price feed is hacked or manipulated, the staking program will also be affected. Even though we already limit the range of demand factor to 0.1 → 1, having the sudden surge in demand factor shows some weakness on security frontier. In V2, we will include 2 measues to tackle this problem.

### Variance Tolerance

In the current implementation, demand factor will be calculated using the latest price. To prevent a sudden change in price, we can introduce a delay and a variance tolerance for price change.

### Time-Weighted Average Price (TWAP)

Variance Tolerance is a simple but effective way to prevent a sudden surge in price, but the price change curve is still steep. And in extreme cases where hackers have control over the oracle feed, they can still bypass that mechanism. Fortunately, these 2 problems can be resolved by TWAP calculation.

* The curve will be averaged out and become less steep.
* Even when hackers can control the oracle feed, they will have a tougher time if they want to exploit SS. The price will need some time for the price to increase, and during that time, the team will have enough time to implement a prevention measure (such as changing the oracle).


---

# 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.dafiprotocol.io/super-staking/super-staking-v2/changes-and-improvements.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.
