graphprotocol / mission-control-indexer

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

"In Protocol" sum wrong #149

Closed fattox closed 4 years ago

fattox commented 4 years ago

I run 2 nodes and decided to try different tactics with each for phase 2:

  1. Pure staking/indexing rewards.
  2. Keep a bit in curation and play the market there a bit.

After unsignalling everything on node 1 (Staking Facilities), it still shows i have 5mil "in protocol", even though all i have is 100k staked.

On node 2, it again shows 5mil "in protocol". But this also seems incorrect. This figure doesn't seem applicable to anything in particular, not even how much 'potential' GRT i could have from unsignalling etc, which currently would be about 7.8mil+.

image

trader-payne commented 4 years ago

That wrong value comes from curation only being incremented, apparently.

image

I withdrew almost all my signal and it still sees that I have 3.1M signaled

This is probably the reason why #26 (see last message) also happens. @nenadjaja you might wanna have a look, this is present basically since day zero and still not fixed, but I'm not sure if you're aware of it cus no one else seems to have posted an issue about it again since that day ๐Ÿ˜‚

nenadjaja commented 4 years ago

Thanks for bringing it to my attention @trader-payne , I am looking into it now. So you just unsignaled? Which subgraphs if you remember?

trader-payne commented 4 years ago

I can't remember all of them ๐Ÿ˜ž Only a few.. Uniswap V2, Compound, Synthetix Rates, Balancer, Honey Xdai, Sushiswap (and a few more but I can't remember them) And yes, unsignaled around the time of posting my reply in this thread

nenadjaja commented 4 years ago

Thanks. I just remembered what the issue is - this is a very complex calculation that we can't accurately do in GRT, but we could do it in "Signal value" (which is why I added a column called "Curation value" on your Profile/Curating tab - which is basically the source of truth but it's not in GRT). The challenge has to do with people signaling/unsignaling many times, and the bonding curve economics related to it. Long story short - I am going to try a fix to show "GRT" values for total signal. If that doesn't work - I think we should just show "Signal value" or "Curation value" (what ever we decide to call it, but it won't be in GRT). hope this makes sense :)

fattox commented 4 years ago

I thought the problem might be something like that. I actually remade this 'issue' twice, because after the first time i wondered if i was misunderstanding something. ๐Ÿ˜‚

It seems it'd be especially hard to be accurate with a lot of activity going on in the subgraphs. I just think the current implementation doesn't really serve much purpose, but showing it in another way as you described would be great.

nenadjaja commented 4 years ago

How about this - I show "Signal value" on the card with 4 decimals, and when you hover over you see the precise number.

Screen Shot 2020-10-17 at 8 49 32 PM Screen Shot 2020-10-17 at 8 51 44 PM
fattox commented 4 years ago

Seems a lot better! ๐Ÿ‘

trader-payne commented 4 years ago

Does the signal value always represent the same amount of GRT if converted?

nenadjaja commented 4 years ago

That's a question for @davekaj :) I am not 100% sure and don't want to give a potentially wrong answer.

fattox commented 4 years ago

I don't think it would, because the curve depends on the subgraph and signal weight, right? It's its "own" value, measured in Signal.

Converting to GRT would be the hard part (gotta calculate how much in each subgraph you're curating and how much you'd get?) so it's prob better to see Signal (like you do with GRT) than nothing at all. If i'm missing something @trader-payne lemme know.

trader-payne commented 4 years ago

Yeah, I think you're right @fattox

nenadjaja commented 4 years ago

Note: I am going to push this up tomorrow. If i forget, someone please remind me :) Don't feel like pushing anything up on Saturday night ;)

the-artifabrian commented 4 years ago

@nenadjaja @trader-payne @fattox To further confirm the above, I was signaling 200k GRT on Aavegotchi Aragon with ~10 curation value. I unsignalled half, so thatโ€™s 5 of my signal which was worth 90k GRT at that time. The number under the Signaled column hasnโ€™t changed for me, which is confusing. Only the Curation Value has halved.

I actually took a dive into the GraphQL schema that youโ€™re using for the curators query on the frontend, and I noticed that you can only query for signalledTokens and unsignalledTokens, which I suppose it refers to the total number of signaled/unsignaled tokens + profits, not the current value.

If there no way to query for the current amount of tokens signaled by a user on a specific subgraph, I suppose seeing only the total signal/curation value would be fine, though we can see that under Participants -> Curators too.

Screen Shot 2020-10-18 at 12 40 21 PM

the-artifabrian commented 4 years ago

Update: So I withdrew all my signal from Aavegotchi Aragon and the entire row with my stats disappeared, which is to be expected. But then I deposited another 1000k GRT and I am now showing up with 201k GRT signaled.

Am I correct to assume that Signaled is the all-time amount of GRT I've signaled on that specific subgraph? And then the Curation Value is the real-time signal I'm getting?

Screen Shot 2020-10-18 at 1 33 02 PM

trader-payne commented 4 years ago

@nenadjaja looks like I owe you guys a couple million ๐Ÿ˜…

image

fattox commented 4 years ago

I was wondering what happened here too. My bags! ๐Ÿ˜‚

image

nenadjaja commented 4 years ago

Hey guys @trader-payne @fattox now that we launched the token sale, I can pick back up on this work (and hopefully get some sleep eventually.. :)

Will look into those minus values. Can you pls share your Ethereum addresses?

@alexo382 "Signaled" in GRT is all time signal (even if you unsignal, it will still show the original signal). "Curation value" is the real time signaling. I am now thinking of removing the "signaled" in GRT or explaining it very precisely so there is no confusion.

fattox commented 4 years ago

I have 2 nodes, here's the address for each:

nenadjaja commented 4 years ago

Thanks @fattox - I figured out what the issue is. Will have to do the calculation differently :)

nenadjaja commented 4 years ago

Hey guys - this is fixed and updated on prod :) @fattox @trader-payne @alexo382 We are calculating the GRT from your signal depending where is it at the bonding curve, whenever you access your profile. So it should be the accurate value. One caveat - for Staking - even though you "Unstaked" a certain amount, it's technically still in the protocol (And counted in that number "In protocol") until the Thawing period is over, and you can actually Withdraw it. Let me know if there are any objections or can I close this issue?

trader-payne commented 4 years ago

Looks solid @nenadjaja

image

But I see the total signaled in curation tab is still reporting weird data, although it's a different issue

image

nenadjaja commented 4 years ago

Yep that's a different issue (I do have a solution for that one too). I'll fix it soon, and I think there is a diff Github issue for that