Rewards Distribution
Distribute rewards to Operators and Stakers
Deposit Rewards into AVS Treasury
Deposit sufficient amount of tokens into the AVS Treasury before distributing rewards.
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 rewards are configured, replace
<chain>
with the appropriate L1/L2 chain name. Find the corresponding values for the Supported chains here.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.
Usage
At the end, the CLI will display the transaction hash.
Using contracts
Alternatively, you can directly deposit rewards into the L1/L2 AVS Treasury using contract methods.
Get Reward Token Address: Retrieve the Reward Token address, set during the AVS contracts deployment.
Approve Token Transfer (ERC20): In case the Rewards token is ERC20, approve the token transfer to the AVS Treasury contract.
Deposit Rewards: Execute
depositNative
ordepositERC20
on the AVS Treasury contract, with the desired amount.Once the transaction is confirmed, the deposit is complete.
AVS Rewards Distribution
There are two main reward distribution flows, and the choice depends on the rewards token and the chain.
EigenLayer Rewards V2: This method supports ERC20 tokens for rewards distribution on L1 and does not support ETH. 2
Batch Reward Distribution: This method supports both ERC20 tokens and ETH rewards and supports rewards on both L1 and L2.
Important Considerations:
You can only use one of these flows at a time, not both.
Othentic CLI allows you to pause or unpause 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 rewards deposit command before initiating the distribution process.
Operator Directed Rewards Submissions
This method includes integration with EigenLayer's Rewards coordinator to process and distribute rewards. Operators and Stakers can claim their rewards from EigenLayer UI.
This method can only be called by the AVS governance MultiSig address
I. Using the Othentic CLI
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 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 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
This command will output a series of ready-to-use commands for submitting the EigenLayer rewards requests `othentic-cli network rewards eigen-batch-request
`, with the calculated parameters for each batch.
Copy and paste each command into your terminal and run them individually to complete Step 2.
Example
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.
Options
--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.
Example
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
andduration
must be multiples ofONE_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.
Designated Claimers: Earners can set designated claimer addresses on the
RewardsCoordinator
contract. If not configured, the Earner address can claim their earnings.
II. Contract Flow: requestEigenBatchPayment
Method
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 exceedMAX_REWARDS_DURATION
.Ensures both
startTimestamp
andduration
are multiples ofCALCULATION_INTERVAL_SECONDS
.Confirms that
startTimestamp
is not too far in the past, checking againstMAX_RETROACTIVE_LENGTH
andGENESIS_REWARDS_TIMESTAMP
.Confirms that the rewards period is entirely in the past by comparing with the latest block timestamp (
startTimestamp + duration < block.timestamp
).
All the above values can be found here on chain basis.
If the reward token is an ERC20, the function withdraws the necessary tokens from the
avsTreasury
and approves therewardsCoordinator
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.
Batch Reward Distribution
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 requestBatchPayment 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 registering with the AVS, 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.
Process Flow:
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.L1 AVS Treasury: A message is sent to L1 to initiate the payment and then withdrawBatchRewards function is executed on the AVS governance contract.
Upon successful execution, the rewards are transferred to the operator and the payment status is updated to Redeemed.
Change Rewards Token
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.
Last updated