Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

update return_per_1000 to return value in RAO #213

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

cuteolaf
Copy link
Contributor

@cuteolaf cuteolaf commented Dec 15, 2023

The RPC call delegateInfo.getDelegates provides information for delegates.

e.g.

{
  "delegate_ss58": "5G3jKS7BJPgrsirMu8cXGQiPRZYC5ceDx9xVyswhSEG8tGUs",
  "take": 11796,
  "nominators": [
    ["5ExqSxwZWrPMuur8RBUjbfLMaGFkq3dmLedUvNWwhExkCxxF", 5755727],
    ["5FsZgSiWPJmm7Aj2H2fYPwMSWkG3LvHoo93m8WQNCJN6VrYx", 71999]
  ],
  "owner_ss58": "5FsZgSiWPJmm7Aj2H2fYPwMSWkG3LvHoo93m8WQNCJN6VrYx",
  "registrations": [0, 11, 21],
  "validator_permits": [],
  "return_per_1000": 2,
  "total_daily_return": 18777
},
{
  "delegate_ss58": "5EcisWbQAnkLyHneKgSrHN75vj4t9AnXVM3YPqhSMkbpBLKE",
  "take": 11796,
  "nominators": [],
  "owner_ss58": "5EHMc8mKZTzdXgx8gq9RKJ1tmatbyJg7gaAEasxNUCWyfLSE",
  "registrations": [],
  "validator_permits": [],
  "return_per_1000": 0,
  "total_daily_return": 0
},

The problem is that return_per_1000 is 0 for most of the delegates.
It's because the actual value is in the range of (0, 1).
Those delegates with return_per_1000 > 1 are mostly weight copiers, who are not actually contributing to the network, but only trying to get rewarded.

To fix this problem, I'd like to suggest updating return_per_1000 to show the value in RAO(10^-9 TAO).

That being said, this formula can be updated.

CURRENT:
return_per_1000 = emissions_per_day * 0.82 / (total_stake / 1000);

PROPOSED:
return_per_1000 = emissions_per_day * 0.82 / (total_stake / 1000) * 10 ^ 9 -->
return_per_1000 = emissions_per_day * 0.82 / total_stake * 10 ^ 12

I've already tested this approach in our project and it works well. 馃榾

@cuteolaf cuteolaf changed the title update return_per_1000 to have integer value update return_per_1000 to return value in RAO Dec 15, 2023
@cuteolaf
Copy link
Contributor Author

@unconst unconst changed the base branch from main to development March 27, 2024 17:16
Copy link
Contributor

@sam0x17 sam0x17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuteolaf

This is a great idea, but I am also concerned about rug-pulling anyone who might already be using this RPC call and might not know about the change, since changing by this order of magnitude would be.. quite a change if your code isn't expecting it.

I would prefer we make a new RPC call, maybe return_per_1000_in_rao, and then add a deprecation notice to the old call with the intention that we will eventually remove it

does that sound reasonable? cc @unconst

I suppose we could forgo this step if we are truly certain no one is able to make use of this RPC call as is because the result is currently useless across the board, but you never know who is using what at the end of the day.

also there is now a merge conflict ;)

@cuteolaf
Copy link
Contributor Author

cuteolaf commented Apr 1, 2024

this has been merged into the main branch already.

@cuteolaf
Copy link
Contributor Author

cuteolaf commented Apr 2, 2024

my bad, it's not actually merged yet.
apologies for the confusion.

@sam0x17
Copy link
Contributor

sam0x17 commented Apr 3, 2024

@cuteolaf did you have any thoughts on my comment?

@sam0x17 sam0x17 removed their assignment Apr 8, 2024
@sam0x17 sam0x17 added the blue team defensive programming, CI, etc label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blue team defensive programming, CI, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants