subtensor icon indicating copy to clipboard operation
subtensor copied to clipboard

update `return_per_1000` to return value in RAO

Open cuteolaf opened this issue 2 years ago • 4 comments

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 avatar Dec 15 '23 02:12 cuteolaf

@Rubberbandits @S0AndS0 @unconst @camfairchild @shibshib

cuteolaf avatar Dec 15 '23 02:12 cuteolaf

this has been merged into the main branch already.

cuteolaf avatar Apr 01 '24 12:04 cuteolaf

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

cuteolaf avatar Apr 02 '24 01:04 cuteolaf

@cuteolaf did you have any thoughts on my comment?

sam0x17 avatar Apr 03 '24 18:04 sam0x17