darwinia-network / collator-staking-ui

Collator Staking UI
https://collator-staking.darwinia.network
Apache License 2.0
0 stars 1 forks source link

Fix collator power #73

Closed JayJay1024 closed 7 months ago

JayJay1024 commented 7 months ago

We first calculate the staked on the collator, and then calculate its power through the staked. The original way is to calculate the power of all nominators of the collator and then add up these powers.

The value of Exposure(darwiniaStaking.exposureCacheX) has been weighted by commission.

github-actions[bot] commented 7 months ago

--- Commit: 2cf74ba Preview: https://staking-8bgwa1bdu-itering.vercel.app

--- Commit: 69fad80 Preview: https://staking-ampgzu0ek-itering.vercel.app

SasoLithops commented 7 months ago

@JayJay1024 Hello Jay! Can you please give examples for community to understand better. I am sorry but I still don't understand how and why this shows on staking dApp. I am sure I am not alone πŸ˜‰

JayJay1024 commented 7 months ago

@JayJay1024 Hello Jay! Can you please give examples for community to understand better. I am sorry but I still don't understand how and why this shows on staking dApp. I am sure I am not alone πŸ˜‰

Sorry for late reply.

In the previous version, the collator power in the active pool was obtained from the exposure api, and the data in the exposure has been weighted by the commission, and it is weighted again when the UI is displayed, so as discussed in the community, the commission is weighted twice.

The collator power in the waiting pool was previously accumulated from the power of the collator's nominators, which would cause some errors. Now, the total staked of the collator is first calculated, and then the staked is used to calculate the power.

SasoLithops commented 7 months ago

Tottaly understand, it was weekend 😎

I did some calculation images with colours(images attached).

Am I right power of John 135 and power of Ivan 280 would now show in active pool.

And power of Rambo 90 and power of Yoda 100 would show in waiting pool.

IMG_20231206_172628.jpg

IMG_20231206_172743.jpg

IMG_20231206_172858.jpg

JayJay1024 commented 7 months ago

Tottaly understand, it was weekend 😎

I did some calculation images with colours(images attached).

Am I right power of John 135 and power of Ivan 280 would now show in active pool.

And power of Rambo 90 and power of Yoda 100 would show in waiting pool.

Yes, you are right. Here is a DIP for reference: https://github.com/darwinia-network/DIPs/blob/main/DIPs/dip-1.md

SasoLithops commented 7 months ago

Great. Thank you. Yes I took my calculations from that article, just wanted to use more colours and real names as one community member thought it was hard to understand. I think it is very well explained, but I also love math😍😊