Synthetixio / staking

A dAPP for minting, burning, and earning on the Synthetix Protocol.
http://staking.synthetix.io/
MIT License
81 stars 75 forks source link

Replace snx data hook #1248

Closed 0xjocke closed 2 years ago

0xjocke commented 2 years ago

This PR start using the https://api.synthetix.io/staking-ratio api to get totalStakedSnx and global staking percentage.

I also spend some time trying to make the APR calculation easier to understand and added tests. Hoping I can confirm with someone else that this is the correct way to calculate APR.

Happy to walk through some of the code for reviewer if any clarification is needed

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
staking ✅ Ready (Inspect) Visit Preview Aug 24, 2022 at 5:22AM (UTC)
0xjocke commented 2 years ago

Glad to see some tests. Made it straightforward to understand the functionality

Yea I just want to confirm that the logic is actually correct. Gonna see if I can get some feedback from Kaleb about the calculation