feat: implement rewards v2.2 - Operator Set Rewards with Unique & Total Stake#500
Open
serichoi65 wants to merge 40 commits intomasterfrom
Open
feat: implement rewards v2.2 - Operator Set Rewards with Unique & Total Stake#500serichoi65 wants to merge 40 commits intomasterfrom
serichoi65 wants to merge 40 commits intomasterfrom
Conversation
f3e7e0a to
7738212
Compare
5826de8 to
cd3cfee
Compare
elhajin
reviewed
Feb 6, 2026
elhajin
left a comment
There was a problem hiding this comment.
what should be addressed :
- T16 — drop Steps 5-7 (deregistration queue + slash multiplier). The allocation snapshots already handle deallocation delay via
effective_blockand slashing via live magnitude/shares updates. The queue logic double-counts slashing and the>=join inflates operator weight. Simplifies the query from 8 CTEs to 5. Deregistered-operator rewards can be pt-2. - T18/T21 —
SUM(tokens_per_day_decimal)→MAX.tokens_per_day_decimalis duplicated per strategy; the GROUP BY doesn't includestrategy, so SUM inflatestotal_tokensby N×. - T20 — join through Table 15 instead of
operator_set_strategy_registration_snapshots. Current join pulls all strategies in the operator set (not just reward submission strategies) and drops multipliers. Should mirror T17's pattern. operatorShareSnapshots.go— removeallocation_adjustmentsCTE. Dead code (table it reads isn't populated yet), and theSUM(magnitude)across operator sets is semantically invalid.
details in inline comments
elhajin
reviewed
Feb 9, 2026
9929189 to
34ff4a3
Compare
elhajin
reviewed
Feb 10, 2026
allocate unique stake to operator set add more v2.2 tables fix function call clean v2.1 delete unused file implement total stake rewards
…distribution Implement support for UniqueStakeRewardsSubmissionCreated and TotalStakeRewardsSubmissionCreated events with pro-rata distribution across operators. Changes: - Add migration for unique_stake_reward_submissions and total_stake_reward_submissions tables - Create eigenState models for stake-based reward submission events - Add stake_operator_set_rewards denormalized table - Rename Tables 15-21 to 16-22 to accommodate new table - Add Table 15 (ActiveUniqueAndTotalStakeRewards) as source for unique/total stake calculations - Update Tables 16 and 19 to support both OD rewards (per-operator amounts) and stake rewards (pro-rata by operator weight)
- Table 17/20: evaluate refunds per operator-set/operator, not per-snapshot - operatorShareSnapshots: apply allocations to all backfill days, include cutoff snapshot
OD rewards are operator-directed with staker distribution handled by staker share snapshots. Removes duplicate processing and reward_source column.
…lia rewardsCoordinator and StrategyManager
…ng bugs Based on PR review feedback for rewards v2.2 implementation: Table 16 (Unique Stake Operator Rewards): - Remove Steps 5-7 (deregistration queue + slash_multiplier) - snapshots already reflect slashing via OperatorSharesDecreased events - Fix registration join: change >= to = (registration snapshots have one row per day) - Remove slashable_until filter (PT2 scope) Table 18/21 (AVS Refunds): - Change SUM(tokens_per_day_decimal) to MAX to prevent inflation by N strategies - tokens_per_day_decimal is duplicated per strategy Table 20 (Total Stake Staker Rewards): - Fix join pattern: use activeStakeRewardsTable instead of operator_set_strategy_registration_snapshots to get correct strategy set with multipliers - Add reward_type = 'total_stake' filter for explicitness operatorShareSnapshots.go: - Remove dead allocation_adjustments and combined_snapshots CTEs (operator_allocation_snapshots populated after this runs) operatorAllocationSnapshots.go: - Simplify ORDER BY to use block_number DESC, log_index DESC (block_time is derived from block_number) Tables 17/19/20: - Remove unnecessary CAST(shares AS NUMERIC(78,0)) - shares already numeric
927f38a to
0e4fd9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements Rewards v2.2 - Operator Set rewards with automatic stake-weighted distribution for both unique allocated stake and total delegated stake. This brings forward-looking reward capabilities (up to 2 years) to operator sets managed via AllocationManager.
Key tables added:
Type of change
How Has This Been Tested?
Test_RewardsV2_2passes.Checklist: