threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Fix Dec 8th 23 and Jan 1st 24 distributions #122

Closed manumonti closed 8 months ago

manumonti commented 9 months ago

As explained in #120 , Dec 8th 23 and Jan 1st 24 distributions had a miscalculation on the tBTC part of stakes with legacy Nu.

Also, this PR addresses the errors mentioned in #123.

This PR will close #120 and #123.

Note that the new calculations were made using the same commit used for Dec 8th calculations but doing some fixes. The fixes are the following:

Commit: ee2bf322

Changes:

These lines

https://github.com/threshold-network/merkle-distribution/blob/ee2bf322dd594051d54f8b5c7f24d65b0b37dfbd/src/scripts/pre-rewards/subgraph.js#L810-L813

were changed for these ones:

// nuInT rewards calculation
const nuInTDuration = restakeTimestamp - deactivationTimestamp
let nuInTReward = nuInTStaked

Also, this commit was cherry-picked: bfc95b5813ccc2f0c786fa7598601142ae261aa9

manumonti commented 8 months ago

Checks done for Dec 8th tBTC fix:

tBTC-fix2-Dec8th.txt

manumonti commented 8 months ago

Checks done for Jan 1st tBTC fix:

tBTC-fix2-Jan1st.txt