> ## Documentation Index
> Fetch the complete documentation index at: https://docs.initia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# VIP Architecture

At genesis, the protocol sets aside a portion of the total INIT token supply as
rewards for the VIP program, distributing them over several years. Let's call
this portion of the supply $R$. These rewards are given out at regular
intervals, or **stage** $t$, throughout the distribution period.

The system first distributes total rewards to each rollup, then subsequently to
the rollup's users and operators.

<Note>
  Before a rollup can qualify for VIP rewards, it must first achieve a minimum
  INIT TVL and then be whitelisted by the Initia L1 governance through an
  on-chain proposal. See the [VIP
  Eligibility](/home/core-concepts/vip/eligibility) page for more details.
</Note>

<Note>
  For details on the specific VIP parameters such as stage and cycle duration,
  see the [VIP Parameters](/resources/developer/initia-l1#vip-parameters)
  section.
</Note>

## Rewards Distribution

At each rewards distribution stage $t$, the total VIP rewards for that stage
$R_t$ are distributed amongst each rollup ecosystem. The distribution is split
into multiple steps:

1. Splitting the total rewards allocated for that stage, $R_t$, between all
   whitelisted rollups.
2. Distributing the rewards to each rollup's users.
3. Distributing the rewards to each rollup's operators.

### Rewards Split Between Rollups

At each stage $t$, the total VIP rewards for that stage $R_t$ are distributed
amongst each rollup ecosystem. The total rewards are then split into two pools:
the **Balance Pool $R_B$** and the **Weight Pool $R_W$**.

<Frame caption="VIP Rewards Distribution">
  <img src="https://mintcdn.com/initialabs/XbiP969DLxcW6ToY/images/vip/vip_rewards_distribution.png?fit=max&auto=format&n=XbiP969DLxcW6ToY&q=85&s=fdeef6745dd057f1291d4ae84777bc8d" alt="VIP Rewards Distribution" width="2560" height="2244" data-path="images/vip/vip_rewards_distribution.png" />
</Frame>

These two pools aim to incentivize and reward different aspects of rollup
operations. The ratio between $R_B$ and $R_W$, called `poolSplitRatio`, is set
by the Initia L1 governance and can be changed through on-chain proposals. The
sum follows the equation:

$$
R_t = R_B + R_W
$$

The rewards for each rollup $m$ are then calculated as follows:

$$
R_{m,t} = R_{B,m,t} + R_{W,m,t}
$$

Where:

* $R_{B,m,t}$ represents the portion of rewards from the Balance Pool $R_B$
  allocated to rollup $m$ at stage $t$.
* $R_{W,m,t}$ represents the portion of rewards from the Weight Pool $R_W$
  allocated to rollup $m$ at stage $t$.

#### Balance Pool

The Balance Pool aims to encourage rollups to find new and interesting uses for
the INIT token by distributing rewards based on the proportion of INIT supply on
the rollup. Specifically, at each stage $t$, the rewards are allocated according
to the amount of INIT locked on each rollup's OPinit bridge address $m$ relative
to the total amount locked across all rollups.

$$
R_{B,m,t} = R_{B,t} \frac{I_{m,t}}{\sum_{i=1}^{N,t} I_{i,t}}
$$

Where:

* $R_{B,t}$ is the total rewards from the Balance Pool for the stage.
* $I_{m,t}$ is the amount of INIT tokens locked by rollup $m$ during the stage.
* $N_{t}$ is the total number of rollups in the stage.

#### Weight Pool

The Weight Pool ($R_W$) rewards rollups based on their weight value, which is
determined by a gauge weight voting process similar to protocols such as
Curve's.

$$
R_{W,m,t} = R_{W,t} \frac{W_{m,t}}{\sum_{i=1}^{N,t} W_{i,t}}
$$

Where:

* $R_{W,t}$ is the total rewards from the Weight Pool for the stage.
* $W_{m,t}$ is the weight of rollup $m$ during the stage.
* $N_{t}$ is the total number of rollups in the stage.

### Distribution to Rollup Users

Once the rewards each rollup receives for a given stage are known, these rewards
are then further distributed to the users of the rollup. The rollup team defines
each user's VIP reward amount through a scoring methodology. The scoring method
could be based on factors such as:

* Number of transactions a user makes on the rollup.
* Value of assets a user borrows.
* Trading volume or liquidity provided by the user.

<Frame caption="VIP Rewards Distribution to Rollup Users">
  <img src="https://mintcdn.com/initialabs/XbiP969DLxcW6ToY/images/vip/vip_distribution_users.png?fit=max&auto=format&n=XbiP969DLxcW6ToY&q=85&s=62653eebecd7dd353d684353af873691" alt="VIP User Rewards Distribution" width="2560" height="874" data-path="images/vip/vip_distribution_users.png" />
</Frame>

At the end of each stage, the rewards for each user are calculated and stored.
Once the rewards for each rollup are known, the rewards are then directly
distributed to the users of the rollup.

If a user $u$ on rollup $m$ has a score of $S_{u,m,t}$, their rewards are:

$$
R_{u,m,t} = R_{m,t} \frac{S_{u,m,t}}{\sum_{i=1}^{N_{u,m,t}} S_{i,m,t}}
$$

Where:

* $R_{m,t}$ is the total rewards from the VIP program for the stage.
* $S_{u,m,t}$ is the score of the user on rollup $m$ during stage $t$.
* $N_{u,m,t}$ is the total number of users on rollup $m$ during stage $t$.

### Distribution to Rollup Operators

To ensure that rollup operators are also incentivized to keep their rollups
active and useful, they can set an `operatorCommissionRate`, $c$. This rate
allows them to take a portion of the rewards for their rollup.

<Frame caption="VIP Operator Rewards Distribution">
  <img
    src="https://mintcdn.com/initialabs/XbiP969DLxcW6ToY/images/vip/vip_distribution_operators.png?fit=max&auto=format&n=XbiP969DLxcW6ToY&q=85&s=e7699b6d4357e092fef6043970e3fe9c"
    alt="VIP Operator Rewards
Distribution"
    width="2560"
    height="944"
    data-path="images/vip/vip_distribution_operators.png"
  />
</Frame>

The rewards for an operator $o$ of rollup $m$ during a stage are:

$$
R_{o,m,t} = R_{m,t} c_{m}
$$

The commission rate is set when the rollup is first approved for VIP rewards and
can be changed later, but only by a fixed amount each stage to prevent abuse.

Taking into account the operator commissions, the total rewards distributed to a
user on a rollup is then:

$$
R_{u,m,t} = (1-c_{m}) R_{m,t} \frac{S_{u,m,t}}{\sum_{i=1}^{N_{u,m,t}} S_{i,m,t}}
$$

## Rewards Vesting

Rewards from the VIP program are given in the form of escrowed INIT tokens
(esINIT). These tokens are initially non-transferable and can be vested in
multiple ways depending on whether the receiver is the user or rollup operator.

### User Vesting

These tokens are initially non-transferable and can be vested in two ways:

1. **Maintain a VIP Score:** Keep a certain score over a number of
   `vestingPeriod`, with each period lasting `stageDuration`.
2. **Convert into LP Lock-Staked Position:** Convert the escrowed tokens into a
   whitelisted INIT:TOKEN staking position.

<Frame caption="VIP Rollup User Vesting">
  <img src="https://mintcdn.com/initialabs/XbiP969DLxcW6ToY/images/vip/vip_rewards_vesting_users.png?fit=max&auto=format&n=XbiP969DLxcW6ToY&q=85&s=241c26564034cc5914ac94791bc2682f" alt="VIP User Vesting" width="2560" height="1726" data-path="images/vip/vip_rewards_vesting_users.png" />
</Frame>

#### Maintaining a VIP Score

**Vesting Process**

VIP esINIT rewards are converted into regular INIT tokens over multiple
`vestingPeriod`, denoted as $p$, with each period lasting one stage. For
instance, if the vesting period is 26 stages, the user will receive
$\frac{1}{26}$ of their esINIT at each stage.

**Achieving the Required Score**

To fully convert their rewards into INIT tokens, users must maintain a certain
score over the vesting periods, $p$, as determined by Initia L1 governance. The
minimum required score is set by a `threshold` factor $f$, also determined by
the L1 governance. The score calculation is as follows:

$$
S_{\text{target},m,t} = S_{u,m,t} \cdot f
$$

Where:

* $S_{u,m,t}$ is the user's score on rollup $m$ during stage $t$.
* $S_{\text{target},m,t}$ is the target score for rollup $m$ during stage $t$.

**Calculating the Target Score**

The target score $S_{\text{target},m,t}$ is the user's score for stage $t$
multiplied by the factor $f$. For example, if a user $u$ has a score of 100 at
stage $t$, their target score to fully vest their esINIT after $p$ stages is
$100 \cdot f$.

**Failing to Meet Target Score**

If a user fails to meet the target score at a certain stage $t$, they will only
vest and receive a portion of their esINIT, calculated by the formula:

$$
c_{\text{user}} = \frac{S_{u,m,t}}{S_{\text{target},m,t}}
$$

For instance, if $f$ is 0.5, a user with a score of 100 must maintain a score of
at least $S_{\text{target},m,t} = 100 \cdot 0.5 = 50$ for the next $p$ stages to
fully vest their esINIT. If after $p$ stages, their score $S_{u,m,t}$ is only
30, their $c_{\text{user}}$ will be $\frac{30}{50} = 0.6$, and they will only be
able to vest 60% of their esINIT.

**Example Scenario**

Parameters

* **Vesting Period ((p))**: 50 stages
* **Minimum Score Factor ((f))**: 0.5

Stage 1 ((t = 1))

* **User Score**: 100
* **esINIT Received for Stage 1**: 100
* **Vesting Rate**: $\frac{100 \text{ esINIT}}{50 \text{ stages}} = 2 \text{
  INIT per stage}$

Stage 2 ((t = 2))

* **Minimum Score Needed from Stage 1**: $100 \times 0.5 = 50$
* **User Score**: 60
* **Vesting from Stage 1**: Since $60 \geq 50$, the user vests the full 2 INIT
* **Vesting Rate for Stage 2**: $\frac{60 \text{ esINIT}}{50 \text{ stages}} =
  1.2 \text{ INIT per stage}$
* **esINIT Received for Stage 2**: 60

Stage 3 ((t = 3))

* **Minimum Score Needed from Stage 1**: $100 \times 0.5 = 50$
* **Minimum Score Needed from Stage 2**: $60 \times 0.5 = 30$
* **User Score**: 40
* **Vesting from Stage 1**: Since $40 < 50$, the user vests $\frac{40}{50}
  \times 2 = 1.6 \text{ INIT}$
* **Vesting from Stage 2**: Since $40 \geq 30$, the user vests the full 1.2
  INIT
* **Total Vesting for Stage 3**: $1.6 \text{ INIT (from Stage 1)} + 1.2 \text{
  INIT (from Stage 2)} = 2.8 \text{ INIT}$

Summary Table

| Stage | User Score | esINIT Received | Vesting Rate (per stage) | Min Score Needed           | Actual Vesting       |
| ----- | ---------- | --------------- | ------------------------ | -------------------------- | -------------------- |
| 1     | 100        | 100             | 2 INIT                   | -                          | -                    |
| 2     | 60         | 60              | 1.2 INIT                 | 50 (Stage 1)               | 2 INIT               |
| 3     | 40         | -               | -                        | 50 (Stage 1), 30 (Stage 2) | 1.6 + 1.2 = 2.8 INIT |

Explanation

1. **Stage 1**: The user scores 100 and receives 100 esINIT, which will be
   unlocked at a rate of 2 INIT per stage over 50 stages.

2. **Stage 2**: The user needs to score at least 50 to unlock the full 2 INIT
   from Stage 1. They score 60, so they unlock the full 2 INIT and receive 60
   esINIT for Stage 2, which will be unlocked at a rate of 1.2 INIT per stage.

3. **Stage 3**: The user needs to score at least 50 to unlock the full 2 INIT
   from Stage 1 and at least 30 to unlock the full 1.2 INIT from Stage 2. They
   score 40, so they unlock 1.6 INIT from Stage 1 and the full 1.2 INIT from
   Stage 2, totaling 2.8 INIT.

#### Converting to LP Lock-Staked Position

Maintaining the score over several periods can be challenging for some users.
Therefore, VIP allows you to convert your esINIT into a locked, stake-locked
INIT:TOKEN LP position on the InitiaDEX for pairs whitelisted on Enshrined
Liquidity. You provide the TOKEN side of the pair.

When creating a lock-staked position, users can choose the duration for locking
their LP position. The length of this lock will determine their voting power on
VIP gauge votes. However, when lock-staking through VIP, a minimum lock duration
of 26 weeks is enforced.

### Operator Vesting

<Frame caption="VIP Rollup Operator Vesting">
  <img src="https://mintcdn.com/initialabs/XbiP969DLxcW6ToY/images/vip/vip_rewards_vesting_operators.png?fit=max&auto=format&n=XbiP969DLxcW6ToY&q=85&s=2770dd1dae0d722c7367e91d21fca098" alt="VIP Operator Vesting" width="2560" height="1260" data-path="images/vip/vip_rewards_vesting_operators.png" />
</Frame>

Similarly, rollup operators' esINIT rewards are also vested, but the process is
slightly different. Operator esINIT rewards are released linearly over a number
of `operatorVestingStages`. For example, if the operator vesting period consists
of 10 stages, the operator will receive $\frac{1}{10}$ of their esINIT at each
stage.
