Rewards Distribution
Distribute rewards to Operators and Stakers
Last updated
Distribute rewards to Operators and Stakers
Last updated
Othentic CLI enables depositing rewards into the AVS treasury. It supports both ERC-20 tokens and native ETH, ensuring an automated approval check before initiating the deposit process.
Based on the chain where , replace <chain>
with the appropriate L1/L2 chain name. Find the corresponding values for the Supported chains .
Replace <amount>
with the desired reward value in Wei you wish to deposit.
When prompted, enter the private key of the AVS governance multi-sig address.
This will initiate the transaction to transfer the specified rewards into the AVS Treasury.
For Eigen Rewards v2, the
calc-eigen-rewards-params
command (as shown in ) outputs the total reward amount required for your AVS across all reward batches. Use this value to determine how much you need to deposit before proceeding with reward distribution.
At the end, the CLI will display the transaction hash.
Alternatively, you can directly deposit rewards into the L1/L2 AVS Treasury using contract methods.
Approve Token Transfer (ERC20): In case the Rewards token is ERC20, approve the token transfer to the AVS Treasury contract.
Deposit Rewards: Execute depositNative
or depositERC20
on the AVS Treasury contract, with the desired amount.
Once the transaction is confirmed, the deposit is complete.
There are two main reward distribution flows, and the choice depends on the rewards token and the chain.
You can only use one of these flows at a time, not both.
This method can only be called by the AVS governance MultiSig address
To distribute rewards effectively using the Othentic CLI, follow these two key steps:
Unpause Eigen Payments Flow
By default, Eigen Payments rewards distribution is paused. Unpause EIGEN_PAYMENT_REQUEST_FLOW
by running the following command:
When prompted enter the private key of AVS governance multisig and select > Eigen Payments. If you have already unpaused, Skip this 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.
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.
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:
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.
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.
💬 Copy and paste each
eigen-batch-request
command into your terminal and run them one by one to complete this 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
If rewards are available on L1.
The rewards are in ERC20 tokens (ETH is not supported).
EigenLayer rewards flow EIGEN_PAYMENT_REQUEST_FLOW
is not paused in the Attestation Center smart contract. If paused, unpause it before proceeding.
This command should be called on a Weekly basis.
--startTimestamp <startTimestamp>
(required): The rewards start timestamp (in seconds) of the epoch. Must be a multiple of one week (604800 seconds).
--duration <duration>
(required): The duration (in seconds) of the rewards to claim. Must be a multiple of one week (604800 seconds).
--fromOperatorId <fromOperatorId>
(required): The operator ID to start the rewards request batch from.
--toOperatorId <toOperatorId>
(required): The operator ID to end the rewards request batch at.
Submit an EigenLayer rewards request for operators 1 to 10, starting from timestamp 1672531200 for a duration of 604800 seconds (one week):
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.
requestEigenBatchPayment
MethodThe `requestEigenBatchPayment` method on the Attestation Center contract enables the rewards v2 distribution to operators. This method can only be called by the AVS governance MultiSig address.
Token Validation: If the reward token is ETH, it returns NativeCoinNotSupportedForEigenRewards
and exits without processing.
Ensures the duration
does not exceed MAX_REWARDS_DURATION
.
Ensures both startTimestamp
and duration
are multiples of CALCULATION_INTERVAL_SECONDS
.
Confirms that startTimestamp
is not too far in the past, checking against MAX_RETROACTIVE_LENGTH
and GENESIS_REWARDS_TIMESTAMP
.
Confirms that the rewards period is entirely in the past by comparing with the latest block timestamp (startTimestamp + duration < block.timestamp
).
If the reward token is an ERC20, the function withdraws the necessary tokens from the avsTreasury
and approves the rewardsCoordinator
to spend the withdrawn tokens.
The specified range of operators is validated to ensure it falls within the allowed limits.
Maximum Rewards Limit: This check ensures that the total rewards being distributed in this batch do not exceed the predefined MAX_REWARDS_AMOUNT
.
For each eligible operator:
The payment status of each eligible operator is updated to COMMITTED.
A message is sent to L1 to initiate the payment and createOperatorDirectedAVSRewardsSubmission
function is executed on the AVS governance contract.
Unpause Batch Payments Flow
By default, Batch Payments request flow is paused. Unpause BATCH_PAYMENT_REQUEST_FLOW
by running the following command:
When prompted enter the private key of AVS governance multisig and select > Batch Payments. If already unpaused, skip this step.
Request Batch Payment
The specified range of Operators is validated to ensure it falls within the allowed limits.
For each eligible Operator:
The Operator's payment status is set to Committed.
Based on the AVS Treasury in use:
L2 AVS Treasury: The withdrawRewards
function is executed to process the payment directly on L2.
Upon successful execution, the rewards are transferred to the operator and the payment status is updated to Redeemed.
To change the rewards token in the AVS Treasury (CLI support coming soon), follow these steps:
Execute the queueTokenReplacement
method.
Wait for the 1-week cooldown period.
Finalize the replacement by calling the completeTokenReplacementWith
method.
Get Reward Token Address: Retrieve the Reward Token address, set during the AVS .
: This method supports ERC20 tokens for rewards distribution on L1 and does not support ETH. 2
: This method supports both ERC20 tokens and ETH rewards and supports rewards on both L1 and L2.
Othentic CLI allows you to rewards payment flows. To process payments , the relevant payment flows must be unpaused. By default these flows are paused.
Ensure that sufficient reward tokens are deposited into the L1/L2 AVS treasury using the command before initiating the distribution process.
This method includes integration with EigenLayer's to process and distribute rewards. Operators and Stakers can from EigenLayer UI.
Designated Claimers: Earners can set designated on the RewardsCoordinator
contract. If not configured, the Earner address can claim their earnings.
:
All the above values can be found on chain basis.
The method on the Attestation Center contract enables the rewards distribution to multiple Operators simultaneously. This method can only be called by the AVS governance MultiSig address.
When , Operators have the option to set Rewards address. If not specified, the Rewards address will default to the Operator's address. It is recommended to use a dedicated smart contract as the rewards address to ensure secure and reliable distribution of rewards to Stakers.
L1 AVS Treasury: A message is sent to L1 to initiate the payment and then function is executed on the AVS governance contract.