forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug fix] - change how we filter out outlying staking APY (MystenLabs…
…#13995) ## Description This PR change how we filter out outlying staking APY. This fixes incorrect APY number in mainnet. The APY for each epoch are calculated using the following equation: `APY_e = (ER_e+1 / ER_e) ^ 365` The outlying APYs are filtered out, ensuring APY is within bound `0<APY<0.1` , a large unstaking event could cause a huge APY value. We then sum 30 past APYs and take the average. ## Test Plan unit test --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
1 parent
c688e6e
commit bf10fa5
Showing
2 changed files
with
81 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
crates/sui-json-rpc/src/unit_tests/data/validator_exchange_rate/rates.json
Large diffs are not rendered by default.
Oops, something went wrong.