Stake flattening on Terra

Since the December 2021 upgrade of Lido on Terra, the distribution of delegation became way better. With bonds and unbonds being made by users, smart contracts re-delegated Luna so the situation changed a lot. The initial state, as shown in the post, was as follows:

And the current situation looks a bit better:

…but still not perfect.

The proposal is to speed up the process. We propose to make the Stake Flattening Procedure (SFP) consist of the 8 steps. Each step is re-delegation of some amount of Luna from one delegators’ subset to another.

As seen from the pictures above, for 1.5 months situation changed for 7M of Luna. It means that it’s impossible to fix a special amount of Luna to be redelegated on a proposal stage. Even while SFP will be ongoing, the situation could change a lot (it could be a lot of bonds/unbonds made for 8 weeks). The solution here is to recalculate the redelegation amount on each step but to limit the redelegations with the following requirements:

  1. The overall redelegation amount on each step should be less than 4M of Luna.

  2. The per-validator redelegation amount on each step should be less than 2M of Luna.

  3. The validator’s delegation amount after redelegation cannot be less than the average delegation among validators.

    For example, such redelegation is prohibited:

    Validator Before Redelegation After Redelegation
    A 2 1.2
    B 1 1.4
    C 1 1.4

An example of the procedure is shown in the following table:

The SFP will be stopped if any of the following events will happen:

  1. The difference between the maximum and minimum delegations amount is less than 1M of Luna, which means that distribution will be fixed in a natural way pretty fast and doesn’t require artificial intervention.
  2. There was an event that lead to de-listing one of the validators, which will require reconsidering the SFP.

The new model looks good :ok_hand:. This will help improve Terra on decentralization metrics (