graphprotocol / mission-control-indexer

Technical indexer documentation and infrastructure templates for the Mission Control testnet
21 stars 4 forks source link

DELEGATING Number Wrong #248

Open suntzu93 opened 3 years ago

suntzu93 commented 3 years ago

Video : https://streamable.com/rl9fa9

I delegated 2 transactions and 1000 for each.

https://rinkeby.etherscan.io/tx/0xbceb139031a5261c9865fd12f0dbb4ffb9909c85978f6248909f43e2064b211d

https://rinkeby.etherscan.io/tx/0xc6107a745cd9873fbc9c225a44b3ae965fc8005f824d1bf8bdff300a5962bea4

But the UI show 9k7.

Screen Shot 2020-12-11 at 11 21 31
nenadjaja commented 3 years ago

@davekaj The way I calculate that number is:

delegatedStake.shareAmount * currentIndexer.delegationExchangeRate

Is that accurate, or am I doing something wrong? :) Btw, when we tested on staging, it was accurate. Not sure why is it behaving differently on prod.

koen84 commented 3 years ago

It's different per indexer the resulting balance if i delegate the same amount.

koen84 commented 3 years ago

I delegated 2k to cryptovestor. This resulted in 2,7k delegated.

I undelegated 1K from cryptovestor. My total delegation lowed to 1.3k split accross 1K undelegating & 324.1 available to undelegate. I know there's a 1% fee, but that still doesn't add up.

koen84 commented 3 years ago

Something similar happened with my delegation to https://testnet.thegraph.com/profile/?id=0x2ef7cd7a130a4bbbd637312a3b4a8e5365296e69

Delegate 1K, result 990,1 (possibly the fee). Undelegate 500, lowered to 490.3, split between 500 undelegating and -7 (negative !!) available.

suntzu93 commented 3 years ago

and one UI BUG after undelegate :

Screen Shot 2020-12-11 at 14 31 56
nenadjaja commented 3 years ago

Yeah, Dave says it's something in the subgraph. He'll look at it in a few hours, and we'll figure it out. Thanks for reporting @koen84 @suntzu93 I think it has something to do with delegationExchangeRate which relates to your allocations. Since the bug never showed in our staging/testing environment, but there we have no allocations. 🤔

suntzu93 commented 3 years ago

Undelegate Number also wrong.

Screen Shot 2020-12-15 at 14 13 05