File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ type Transcoder @entity {
8686 feeShareUpdateTimestamp : Int !
8787 "Total tokens delegated toward a transcoder (including their own)"
8888 totalStake : BigDecimal !
89+ "Pending bonded stake for the transcoder since last claiming rewards"
90+ pendingStake : BigDecimal !
8991 "Total fees generated by the transcoder in ETH (before distribution to delegators)"
9092 totalVolumeETH : BigDecimal !
9193 "Total fees generated by the transcoder in ETH (before distribution and in past 30 days)"
@@ -129,6 +131,8 @@ type Pool @entity {
129131 rewardTokens : BigDecimal
130132 "Transcoder's total stake during the earnings pool's round"
131133 totalStake : BigDecimal !
134+ "Pending bonded stake for the transcoder since last claiming rewards"
135+ pendingStake : BigDecimal !
132136 "Transcoder's reward cut during the earnings pool's round"
133137 rewardCut : BigInt !
134138 "Transcoder's fee share during the earnings pool's round"
Original file line number Diff line number Diff line change 1- import { store } from "@graphprotocol/graph-ts" ;
1+ import { Address , store } from "@graphprotocol/graph-ts" ;
22import {
33 convertToDecimal ,
44 createOrLoadDelegator ,
88 createOrLoadTranscoder ,
99 EMPTY_ADDRESS ,
1010 getBlockNum ,
11+ integerFromString ,
1112 makeEventId ,
1213 makePoolId ,
1314 makeUnbondingLockId ,
@@ -500,6 +501,16 @@ export function reward(event: Reward): void {
500501 pool ! . feeShare = transcoder . feeShare ;
501502 pool ! . rewardCut = transcoder . rewardCut ;
502503
504+ let bondingManager = BondingManager . bind ( event . address ) ;
505+ let pendingStake = convertToDecimal (
506+ bondingManager . pendingStake (
507+ Address . fromString ( transcoder . id ) ,
508+ integerFromString ( round . id )
509+ )
510+ ) ;
511+ transcoder . pendingStake = pendingStake ;
512+ pool . pendingStake = pendingStake ;
513+
503514 transcoder . save ( ) ;
504515 delegate . save ( ) ;
505516 pool ! . save ( ) ;
You can’t perform that action at this time.
0 commit comments