Skip to content

Commit

Permalink
fix: track total delegated tokens changes when rewards or fees are co…
Browse files Browse the repository at this point in the history
…llected
  • Loading branch information
pcarranzav committed Jan 29, 2024
1 parent 6f18ba6 commit 5f8f785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mappings/rewardsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function handleRewardsAssigned(event: RewardsAssigned): void {
graphNetwork.totalIndexingDelegatorRewards = graphNetwork.totalIndexingDelegatorRewards.plus(
delegatorIndexingRewards,
)
graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.plus(delegatorIndexingRewards)
graphNetwork.save()
}

Expand Down
1 change: 1 addition & 0 deletions src/mappings/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ export function handleRebateClaimed(event: RebateClaimed): void {
graphNetwork.totalUnclaimedQueryFeeRebates = graphNetwork.totalUnclaimedQueryFeeRebates.minus(
event.params.delegationFees.plus(event.params.tokens),
)
graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.plus(event.params.delegationFees)
graphNetwork.save()
}

Expand Down

0 comments on commit 5f8f785

Please sign in to comment.