# Reward System for LPs

<figure><img src="/files/6N2n3V4C2xeW65AZiCtJ" alt=""><figcaption></figcaption></figure>

LP Fee Distribution Explained

Avitus Labs uses a **harmonic mean** formula to distribute rewards among liquidity providers (LPs). This ensures that LPs who contribute more liquidity and stay longer in the pool during the epoch receive a larger share of the rewards. Here’s how it works:

***

#### **How It Works**

1. **Weight of Portfolio**:
   * Each LP’s reward depends on their **weight**, which is determined by:
     * **Time spent in the pool (tᵢ)**: How long the LP’s liquidity remains in the pool during the epoch.
     * **Net liquidity provided (vᵢ)**: The value of liquidity contributed in USDC.
   * LPs who provide more liquidity or stay in the pool longer receive higher weights.
2. **Reward Distribution**:
   * The platform calculates the proportion of the total rewards an LP earns based on their weight relative to the total weight of all LPs in the pool.

***

#### Key Rules for LP Fee Distribution

1. **Epoch Duration**:
   * Rewards are distributed weekly, with each epoch lasting exactly 1 week, from **Sunday to Sunday**.
2. **Reward Calculation Timing**:
   * Rewards are calculated **35 minutes (2,100 seconds)** before the epoch ends. This ensures accurate distribution based on liquidity present during the majority of the epoch.
3. **Withdrawals During Epochs**:
   * If an LP withdraws liquidity **before the reward calculation period (last 35 minutes of the epoch)**, their reward is reduced as only the remaining liquidity is considered for calculations.
   * Withdrawals during the reward calculation period do not impact the current epoch's rewards but will reflect in the next epoch's calculations.
4. **New or Additional Liquidity**:
   * Any liquidity added to the pool by new or existing LPs **during the reward calculation period (last 35 minutes)** will **not** be considered for the ongoing epoch. It will instead count toward the next epoch's rewards.
5. **Claiming Rewards**:
   * Rewards become claimable at the end of each epoch, providing LPs with their earned share based on the above rules.

***

#### **Example**

**Scenario:**

* The total reward pool for the epoch is $10,000.
* Two LPs (A and B) participate with different liquidity amounts and time durations:

| **LP** | **Time Spent in Pool (seconds)** | **Liquidity Provided (USDC)** |
| ------ | -------------------------------- | ----------------------------- |
| LP A   | 604,800 seconds (entire epoch)   | $50,000                       |
| LP B   | 302,400 seconds (half epoch)     | $100,000                      |

**Step-by-Step Calculation:**

1. **Determine Weight for Each LP**:
   * **LP A**:
     * Stayed for the full epoch (604,800 seconds) with $50,000 liquidity.
     * This gives LP A a significant weight because of their long-term commitment.
   * **LP B**:
     * Stayed for half the epoch (302,400 seconds) but provided $100,000 liquidity.
     * LP B gets a higher weight because they provided more liquidity, even for a shorter time.
2. **Proportion of Total Rewards**:
   * The system calculates each LP’s weight relative to the total weight of all LPs combined.
   * For simplicity, let’s assume LP A’s weight is **40%** and LP B’s weight is **60%**.
3. **Distribute Rewards**:
   * **LP A** earns 40% of $10,000, which equals **$4,000**.
   * **LP B** earns 60% of $10,000, which equals **$6,000**.

***

#### **Key Takeaways from the Example**

1. LPs who stay in the pool longer (like LP A) can still earn significant rewards even if they contribute less liquidity.
2. LPs who provide higher liquidity (like LP B) are rewarded proportionally for their contribution, even if their time in the pool is shorter.

This system balances the reward distribution, ensuring fairness for both short-term and long-term liquidity providers.


---

# 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://avitus.gitbook.io/avitus-docs/reward-system-for-lps.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.
