# Referral system

## Overview

The protocol referral system is a fully on-chain mechanism designed to incentivize community-driven growth. It enables existing users (**referrers**) to invite new stakers (**referees**) to stake into the protocol and rewards both parties accordingly. This guide outlines how the system works from a technical and user interaction standpoint.

The referral system allows a user (**referrer**) to share their address with others. When a new user (**referee**) stakes with that referral address, the referee receives a 1% bonus, and the referrer can receive up to 15% in MOR tokens depending on the total amount deposited by their referees.

The system is implemented directly in the `DepositPool` contract and uses storage mappings to track referral tiers, user deposits, and accumulated rewards. `ReferrerLib` uses for the internal calculations.

## Mechanics

### Referral Address Creation

* Any wallet address can be used as a referral address. Except for the zero address — the zero address indicates that the referee is not set.
* No separate registration is required — the referrer simply provides their address to others.

### Staking with a referral

When a new user (the referee) wants to participate in staking, they use the [`stake`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#stake) function of the [`DepositPool`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md) contract. As part of this call, they provide the wallet address of the person who referred them by passing it as the `referrer_` parameter.

The contract then stores this address as the user’s associated referrer and updates internal referral data accordingly. This includes tracking the total staked amount associated with that referrer, which can impact the referrer’s bonus tier.

As an immediate benefit, the referee (staker) receives a 1% bonus on their deposit, increasing their virtual stake and potential MOR rewards.

### Referrer rewards

The referrer earns MOR rewards based on the total deposits made by referees using their referral address. The rewards are tiered based on cumulative virtual stETH deposits. Tier updates are performed automatically in `_applyReferrerTier` function.

| Tier | Total virtual stETH deposited | Bonus from referees stakes |
| ---- | ----------------------------- | -------------------------- |
| 0    | ≥ 1 stETH and < 2.5 stETH     | 3%                         |
| 1    | ≥ 2.5 stETH and < 25 stETH    | 5%                         |
| 2    | ≥ 25 stETH and < 62.5 stETH   | 10%                        |
| 3    | ≥ 62.5 stETH                  | 15%                        |

To retrieve information about referral tiers and the current tier of a user (referrer), the `DepositPool` contract provides public view functions and structured storage that can be accessed on-chain or via a blockchain indexer.

Referral tiers for a given reward pool (bucket) are stored in the [`referrerTiers`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#referrertiers) mapping, which maps a `rewardPoolIndex` to an array of `ReferrerTier` structs. Each `ReferrerTier` contains two fields:&#x20;

* Required amount of stETH deposited by referees (amount) in wei.
* Corresponding multiplier that determines the MOR bonus the referrer receives, where `<multiplier> / 10^23 = <bonusPercent>`

To determine which tier a specific user (referrer) currently belongs to, we can use [`referrersData`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#referrersdata). This struct contains a field `virtualAmountStaked` which reflects the total staked amount attributed to that referrer from all referees. By comparing this value with the thresholds defined in `referrerTiers`, you can determine the user’s active tier and associated bonus multiplier.

For convenience, the function [`getReferrerMultiplier`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#getreferrermultiplier) can be used to get the current effective multiplier for a specific referrer, accounting for their tier status.

### Lock Compatibility

Referrer rewards are not blocked by the referee’s lock conditions. This means a referrer can claim their MOR bonus even if the referee’s MOR is still locked under a Power Factor curve.

### No Referral Provided

If a referee does not provide a referral address when staking, no referral bonuses are distributed.<br>

## Claim

### Referee claim process

Referees — users who staked tokens (e.g., stETH) and may have used a referral address — can claim their accumulated MOR rewards by calling the [`claim`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#claim) function.

### Referrer Claim Process

Referrers — users whose referral address was used during staking — accumulate MOR bonuses based on the total amount of deposits made by referees and the tier multiplier they qualify for.&#x20;

{% hint style="info" %}
For example, if all referees have a combined virtual stake of 10 stETH, then the referrer’s tier will be **Tier 1**, and the bonus will be 5%.

This means the referrer will receive a virtual stake equal to 5% of 10 stETH, which is 0.5 virtual stETH, and will be eligible to receive rewards based on that 0.5 virtual stETH amount.
{% endhint %}

```solidity
uint256 referrerVirtualAmount = totalStakedByRefereeVirtualAmount * bonus;
```

To claim their referral rewards, a referrer calls [`claimReferrerTier`](/smart-contracts/documentation/distribution-protocol/v7-protocol/contracts/depositpool.md#claimreferrertier).  This mechanism ensures that both types of participants — referees and referrers—can transparently and securely access their rewards, with all lock periods enforced and yield data synchronized across chains.


---

# 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://gitbook.mor.org/smart-contracts/documentation/distribution-protocol/v7-protocol/get-started/referral-system.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.
