# Distribute

Othentic CLI enables distributing rewards to the AVS Operators.

#### Read More

* [Rewards Distribution](https://docs.othentic.xyz/main/learn/core-concepts/rewards#rewards-distribution)
* [CLI Command Reference - distribute rewards](https://docs.othentic.xyz/main/reference/othentic-cli/network/rewards#perform-actions-related-to-the-avss-treasury-rewards)

You can choose one of these options:

1. [Eigen Rewards V2](#id-1.-eigen-rewards-v2)
2. [Batch Rewards](#batch-reward-distribution)
3. [Fixed Rewards](#id-3.-fixed-rewards)

## 1. Eigen Rewards V2

### Prerequisites

* [Othentic CLI installed](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli)
* Access to AVS governance multisig owner&#x20;
* [Rewards Funds Deposited](https://docs.othentic.xyz/main/user-guide/network-management/rewards/deposit)

{% stepper %}
{% step %}
**Unpause Eigen Payments Flow**

By default, Eigen Payments rewards distribution is paused. Unpause `Eigen Payments`  by running the following command:

```bash
otcli network unpause-flow
```

{% hint style="success" %}
Pass `--browser-sign`  flag to connect your wallet and sign using a web browser UI.
{% endhint %}

When prompted&#x20;

* enter the private key of AVS governance multisig &#x20;
* select **> Eigen Payments**.&#x20;
* enter Attestation center contract address

If you have already unpaused, Skip this step.
{% endstep %}

{% step %}
**Calculate Required Amount to Deposit and Rewards Batch Parameters**

This step calculates time range for EigenLayer Rewards Request Submission. It automatically determines the optimal `startTimestamp`, `duration`, `fromOperatorId`, and `toOperatorId` for each reward batch.&#x20;

It also calculates the **total amount of tokens the AVS needs to deposit** to fund the rewards. It considers factors like retroactive reward limits, reward duration, and the total number of operators.

```bash
otcli network rewards calc-eigen-rewards-params
```

{% hint style="success" %}
Pass `--browser-sign`  flag to connect your wallet and sign using a web browser UI.
{% endhint %}

* When prompted enter the private key of the AVS Governance Multisig.
* If the AVS was deployed prior to this update, the cli will prompt for the AVS deployment block number.

**Review Output**

The command will output:

1. A series of **pre-filled commands**  for submitting the EigenLayer rewards requests  using `othentic-cli network rewards eigen-batch-request`, each with batch-specific parameters.
2. A **summary of reward economics**, including:
   * **Operation cost**
   * **Current treasury balance**
   * **Total amount required to deposit** for distribution across all batches (in both raw units and notional token value)

This helps the AVS determine the exact amount of tokens it needs to **deposit** for executing the reward distribution.

#### **Example**

```bash
otcli network rewards calc-eigen-rewards-params

? Enter your private key: *****************************

use for batch number 1: othentic-cli network rewards eigen-batch-request \
  --startTimestamp 1729728000 --duration 6048000 \
  --fromOperatorId 1 --toOperatorId 3

use for batch number 2: othentic-cli network rewards eigen-batch-request \
  --startTimestamp 1735776000 --duration 6048000 \
  --fromOperatorId 1 --toOperatorId 3

use for batch number 3: othentic-cli network rewards eigen-batch-request \
  --startTimestamp 1741824000 --duration 1814400 \
  --fromOperatorId 1 --toOperatorId 3

Operation cost: 200000000000000000000  
Current treasury balance: 900000000000000000000  
Total rewards to deposit for AVS operation: 199100000000000000000 (notional amount: 199.1)

```

> 💬 Copy and paste each `eigen-batch-request` command into your terminal and run them one by one to complete this step.
> {% endstep %}

{% step %}
**EigenLayer** **Batch Request**

This command submits the actual request for EigenLayer rewards. It is is designed to handle large numbers of operators by breaking down the request into manageable batches. Before running the command please ensure

* This command should be called on a **Weekly** basis.

```
otcli network rewards eigen-batch-request [options]
```

{% hint style="success" %}
Pass `--browser-sign`  flag to connect your wallet and sign using a web browser UI.
{% endhint %}

#### Example

Submit an EigenLayer rewards request for operators 1 to 10, starting from timestamp 1672531200 for a duration of 604800 seconds (one week):

```bash
otcli network rewards eigen-batch-request \
--startTimestamp 1672531200 --duration 604800 \
--fromOperatorId 1 --toOperatorId 10
```

{% endstep %}
{% endstepper %}

**Important Considerations for AVSs:**

* **Optimal Calling Times:** EigenLayer requires calling rewards functions with rounded parameters where both `startTimestamp` and `duration` must be multiples of `ONE_WEEK`time. The duration can be 1, 2, or up to max 10 weeks. Since rewards accumulate continuously and not per epoch, it's advised to check optimal calling times, which are slightly after the end of the each epoch.<br>

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FTrEyG5lSxvCnMoD3VjdF%2Fimage.png?alt=media&#x26;token=adc79f2b-3eb7-42ae-a45f-76230b08b2ba" alt="" width="563"><figcaption></figcaption></figure>

* **Designated Claimers:** Earners can set designated [claimer addresses ](https://docs.eigenlayer.xyz/eigenlayer/rewards-claiming/rewards-claiming-overview#rewards-contract-configurations)on the `RewardsCoordinator` contract. If not configured, the Earner address can claim their earnings.

***

## **2. Batch Reward Distribution** <a href="#batch-reward-distribution" id="batch-reward-distribution"></a>

### Prerequisites

* Othentic CLI installed ([Install instructions](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli))
* Access to AVS governance multisig owner&#x20;
* [Rewards Funds Deposited](https://docs.othentic.xyz/main/user-guide/network-management/rewards/deposit)

{% stepper %}
{% step %}
**Unpause Batch Payments Flow**

By default, Batch Payments request flow is paused. Unpause `BATCH_PAYMENT_REQUEST_FLOW` by running the following command:

```
otcli network unpause-flow
```

When prompted&#x20;

* enter the private key of AVS governance multisig&#x20;
* select **> Batch Payments**.&#x20;

If already unpaused, skip this step.
{% endstep %}

{% step %}
**Request Batch Payment**

Execute [requestBatchPayment](https://docs.othentic.xyz/main/reference/contracts/attestation-center#requestbatchpayment) method on the Attestation Center contract. This method can only be called by the AVS governance MultiSig or `PAYMENT_REQUESTS` role.
{% endstep %}
{% endstepper %}

***

## 3. Fixed Rewards&#x20;

{% stepper %}
{% step %}
[**Request fixed rewards payment**](https://docs.othentic.xyz/main/learn/core-concepts/rewards#ii.-contract-flow-requesteigenbatchpayment-method-2)

Execute [createEigenRewardsSubmission](https://docs.othentic.xyz/main/reference/contracts/avs-governance#createeigenrewardssubmission) method on the AVS Governance contract. This method can only be called by the AVS governance MultiSig address.
{% endstep %}
{% endstepper %}
