Here we calculate rewards for the beta tBTCv2 operators. The output rewards JSON file should be used to generate a Merkle distribution tree.
There are 5 requirements for an operator to receive rewards in a given rewards interval:
Random Beacon authorized
tBTC authorized
Total node(s) uptime 96% across all the instances after a peer joins the network. See examples
Pre-generated params avg of 500 across all the instances. See examples
Latest client build version. A 2-week update delay is allowed after the latest release.
E.g. 1
<operator_address>:
"instances":
"10.102.1.33:9701": {
"upTimePercent": 50,
"preParams": 400,
"version": "v2.0.0-m1-9-g4049dc015"
}
"10.102.2.20:9601": {
"upTimePercent": 46,
"preParams": 600,
"version": "v2.0.0-m1-9-g4049dc015"
}
}
"upTimePercent" - total: 96% meets a 96% req across all the instances
"preParams" - total avg. 500 meets a 500 avg across all the instances
E.g. 2
<operator_address>:
"instances":
"10.102.1.33:9701": {
"upTimePercent": 50,
"preParams": 399,
"version": "v2.0.0-m1-9-g4049dc015"
}
"10.102.2.20:9601": {
"upTimePercent": 45,
"preParams": 600,
"version": "v2.0.0-m1-9-g4049dc015"
}
}
"upTimePercent" - total: 95% does not meet a 96% req across all the instances
"preParams" - total avg. 499.5 does not meet a 500 avg across all the instances
rewards.ts will:
call beacon and wallet registry contracts for authorization data. It calculates "weighted" authorization based on increase and decreases events during the interval. E.g.
rewards interval Sep 1 - Sep 30
beacon and tBTC authorization of 100k happened on Sep 1
beacon and tBTC authorization increase event happened on Sep 10. It was increased to 150k
- query [Prometheus service](https://monitoring.test.threshold.network/prometheus/graph) for bootstrap peers' info
- aggregate and validate rewards requirements for each operator
- save rewards data for eligible operators
<details>
<summary>Example operator details to calculate final rewards</summary>
This PR is copied from the keep-core repository. The original PR and reviews were done here
Here we calculate rewards for the beta tBTCv2 operators. The output rewards JSON file should be used to generate a Merkle distribution tree.
There are 5 requirements for an operator to receive rewards in a given rewards interval:
E.g. 1
E.g. 2
rewards.ts
will:uptimeCoeficient: off-chain client's uptime beaconWeightedAuthorization = 100k 10/30 + 150k 20/30 tbtcWeightedAuthorization = 100k 10/30 + 150k 20/30 weightedAuthorization = uptimeCoeficient * min(beaconWeightedAuthorization, tbtcWeightedAuthorization)
"0x5cD847903Bb7F29de77Eecc135628cA5b104A355": { "applications": { "beaconAuthorization": "800000000000000000000000", "tbtcAuthorization": "800000000000000000000000" }, "instances": { "10.102.1.19:9601": { "upTimePercent": 74.52969075397857, "avgPreParams": 922, "version": "v2.0.0-m1-9-g4049dc015" }, "10.102.1.77:9601": { "upTimePercent": 24.81376522052997, "avgPreParams": 971, "version": "v2.0.0-m1-9-g4049dc015" } }, "requirements": { "isBeaconAuthorized": true, "isTbtcAuthorized": true, "isUptimeSatisfied": true, "isPreParamsSatisfied": true, "isVersionSatisfied": true } }
amount = uptimeCoeficient min(beaconWeightedAuthorization, tbtcWeightedAuthorization) APR/12
{ "0x0eC14BC7cCA82c942Cf276F6BbD0413216dDB2bE": { "beneficiary": "0x0eC14BC7cCA82c942Cf276F6BbD0413216dDB2bE", "amount": "9900000000000000000000" } },
./rewards.sh --rewards-start-date Y-m-d --rewards-end-date Y-m-d --etherscan-token ""