update `return_per_1000` to return value in RAO
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. 😀
@Rubberbandits @S0AndS0 @unconst @camfairchild @shibshib
this has been merged into the main branch already.
my bad, it's not actually merged yet. apologies for the confusion.
@cuteolaf did you have any thoughts on my comment?