graphprotocol / graph-network-subgraph

The subgraph, the smart contracts, the tests, and documents for the Graph Explorer Decentralized Application
MIT License
70 stars 45 forks source link

Effective reward cut calculation is broken when indexer have locked tokens. #231

Closed zekchan closed 7 months ago

zekchan commented 1 year ago

Both Indexer.queryFeeEffectiveCut and Indexer.indexingRewardEffectiveCut display incorrect effective cut values when the indexer possesses locked tokens. This issue originates from the ownStakeRatio calculation, which does not take lockedTokens into account. I propose a fix in PR https://github.com/graphprotocol/graph-network-subgraph/pull/230, it is cherry-pick from graphscan's fork