Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the new version of UI/UX for displaying APY for farming validators #2539

Open
askulikov opened this issue Mar 22, 2022 · 3 comments · May be fixed by #2538
Open

Create the new version of UI/UX for displaying APY for farming validators #2539

askulikov opened this issue Mar 22, 2022 · 3 comments · May be fixed by #2538
Labels
🛠 UX / UI Requires discovery and/or deliverables from Product Design

Comments

@askulikov
Copy link
Contributor

askulikov commented Mar 22, 2022

@stefanopepe @esaminu @agileurbanite

@agileurbanite
Copy link
Contributor

Ack we will propose a UX in the next few days and reply in this issue.

@stefanopepe stefanopepe linked a pull request Mar 23, 2022 that will close this issue
2 tasks
@stefanopepe stefanopepe added the 🛠 UX / UI Requires discovery and/or deliverables from Product Design label Mar 23, 2022
@stefanopepe
Copy link
Contributor

@corwinharrell, the APY is an "annual percentage yield" used to measure the interest rate.

Calling it APY can be tricky, as pools (see Aurora) might take $near, keep fees at 100%, and give back only Aurora tokens, which would yield 0% APY in $near tokens and a certain amount of $aurora tokens (or any other similar fungible token).

Example 1:

  • Aurora Pool takes 100% staking fees, offering 1,000,000 $aurora tokens over 12 months. They received already 190,000 $near staked, out of a grand total of 400,000,000 $near currently staked in the network
  • the user Alice stakes 10,000 $near, corresponding to 5% of the total of 200,000 $near staked in the pool
  • Alice's $near APY will be 0%, since Aurora Pool keeps 100% of the protocol rewards
  • $aurora Annual Yield will be 5% of 1,000,000 or 50,000 $aurora tokens >> this is because Alice holds 5% of all funds staked into the Aurora Pool
  • as of today, 1 $aurora is 0.59825470 $near, so the Annual Yield equivalent is (50,000 * 0.598)=29,900 $near
  • Alice's cumulative APY would be 0% $near from protocol rewards + (29,900/10,000)=299% from the $aurora fungible token rewards

Example 2:

  • Paras Pool takes 50% staking fees, offering 20,000,000 $paras tokens over 12 months. They received already 990,000 $near staked out of the 400,000,000 $near currently staked in the network
  • the user Bob stakes 10,000 $near, corresponding to 1% of the total of 1,000,000 $near staked
  • Bob's $near APY will be half of the protocol rewards, or (0.5 * 0.1125)=5.625%, since Paras Pool takes 50% or 0.5 in fees
  • $paras Annual Yield will be 1% of 20,000,000 or 200,000 $paras tokens
  • as of today, 1 $paras is 0.019 $near, or an Annual Yield equivalent of 3,800 $near
  • Bob's cumulative APY would be 5.625% $near from protocol rewards + (3,800/10,000)= 38% from the fungible tokens

Example 3:

  • Bison Trails Pool takes 10% staking fees, not offering fungible tokens. They received already 19,990,000 $near staked out of the 400,000,000 $near currently staked in the network
  • the user Charlie stakes 10,000 $near, corresponding to 0.05% of the total staked in the pool
  • Charlie's $near APY will be 90% of the protocol rewards since Bison Trails keep 10% in fees, or ((1-0.1)*0.1125)=10.125%
  • no fungible tokens are distributed by Bison Trails, so there are no additional Annual Yield to calculate
  • Charlie's cumulative APY would be 10.125% from protocol rewards, and nothing else

Notes:

  1. We simplified to a constant of 11.125% APY for the staking on the protocol, coming from the standard rewards of 4.5% over 1 billion tokens of supply, applied to 400 million $near staked
  2. We simplified the fungible tokens annual yields, since some pools may have a release schedule that is shorter than 12 months, so the APY (annual, 12 months) is lower
  3. The current calculation here is using USD as the unit of account instead of $near, which is faster to implement but requires to know the fungible token values in USD
  4. this calculation won't take into account the $near, $aurora and $paras exchange fluctuations: the 299% APY might change dramatically if the $near tokens and/or the $aurora token USD value increase or decrease in the double digit.

Will need an ack by @ilblackdragon to make sure we are all on the same page in terms of UI

@askulikov askulikov linked a pull request Mar 24, 2022 that will close this issue
2 tasks
@askulikov
Copy link
Contributor Author

@stefanopepe , about the calculation in terms of prices. It might be wrong, but as I understand if we are using just math - there won't be any difference between the results. Anyway, we have to somewhere take data about prices. As we decided to use ref.finance - it is much easier to take prices of whitelisted tokens instead of selecting the pools and $near/$token ratio. Am I wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 UX / UI Requires discovery and/or deliverables from Product Design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants