> For the complete documentation index, see [llms.txt](https://gitbook.mor.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.mor.org/smart-contracts/documentation/builders-protocol/v2-protocol/guides/reward-distribution.md).

# Reward distribution

The reward distribution mechanism in the Builders protocol ensures that MOR tokens are fairly allocated among builder pools and their participants based on their contributions, with internal logic designed for efficiency and scalability.

## Overview

MOR rewards are not distributed automatically based on a predefined curve or emission schedule. Instead, rewards are manually supplied by the Morpheus multisig to the `BuildersTreasury` contract. Once deposited and stake, claim or withdraw transaction executed after the deposit, the system calculates and distributes rewards proportionally across all builder pools based on each pool’s virtual stake. Within each pool, the rewards are further divided among users.

Such an approach ensures that only the tokens actually available are distributed. The more frequently the treasury is replenished, the fairer the distribution will be among the subnets.

## Reward accumulation

When MOR tokens are deposited into the `BuildersTreasury`, the contract holds these tokens until a builder (admin of a pool) manually triggers a reward claim for their pool via the claim function. The claim function can only be called after a specified `claimLockEnd` time and only by the admin of the respective pool.

## Reward calculation formula

Pool rewards are calculated lazily — that is, only when a staker interacts with the contract (e.g., stake, withdraw, or claim), rather than updating every user on each pool. The calculation is performed using the following logic:

```solidity
uint256 poolReward = pendingRewards + virtualStake * (totalRewardCoefficient - pooluserRewardCoefficient);
```

* `pendingRewards` - rewards that were calculated after the stake or withdrawal — that is, after the pool’s share was modified.
* `virtualStake`  - the pool’s current stake after applying multipliers.
* `totalRewardCoefficient` - the current accumulated MOR per unit of virtual stake across the all pools.
* `pooluserRewardCoefficient` - the coefficient stored at the time of the last interaction in the pool.

The `totalRewardCoefficient` is updated globally when new rewards are distributed. It is calculated as:

```solidity
uint256 totalRewardCoefficient += distributedRewards / totalVirtualStake;
```

* `distributedRewards` - is the amount of MOR tokens allocated to the pool during distribution.
* `totalVirtualStake` - is the sum of all users’ virtual stake (after applying lock/referral multipliers) at the time of distribution.

This model allows each user’s reward to be efficiently and fairly computed based on the delta in the coefficient since their last update.

## Virtual stake and multipliers

Each user’s deposit is enhanced with a multiplier derived from their lock period (configured per pool).&#x20;

The total virtual stake of a pool is the sum of all users’ virtual stakes and determines the share of rewards that pool receives.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://gitbook.mor.org/smart-contracts/documentation/builders-protocol/v2-protocol/guides/reward-distribution.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
