yearn / yearn-devdocs

yearn documentation

Home Page:https://docs.yearn.fi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To add page for detailed APY calculation explanation

JKtranslator opened this issue · comments

How Yearn calculates its yVaults Returns

It is a standard on Defi Space to estimate returns through APY and APR, and Yearn also does so. However, different calculations depend on the yVault underlying asset. One for Curve.Finance LP Tokens and another way for non-curve assets. For a simpler version, check the TL;DR version or the infographic at the end of the page. The following sections will show how each one is calculated:

Non-curve assets

The estimated returns are displayed on Yearn.finance this way:

image

Where the definition of each one is:
Gross APR: Vault total APR before deducted fees
Net APY: Vault considered APY. If the network is ETH mainnet, this will show the Monthly APY, as the harvests are not that frequent. On the other hand, if the network is Fantom, then the Weekly API is chosen, as the harvests are more frequent.
Weekly APY: Calculated considering the yVault price share difference in the last seven days
Monthly APY: Calculated considering the yVault price share difference in the last 30 days
Inception APY: Calculated considering the yVault price share difference since inception

The actual code can be found on this repo

image

Where the file that contains the calculation for the most recent version of the yVaults is this one

Curve assets

The estimated returns are displayed on Yearn.finance this way:

image

Where the definition of each one is:
• Pool APY: APY is calculated considering the change in the “virtual price” of the curve.finance LP token in the last seven days.
• Bonus Rewards APR: Rewards are usually given by the token owner. IE frax curve pools also offer frax as a reward. The APY if the token were sold at the current price.
• Base CRV APR: The APR from the CRV emissions this curve pool gets.
• Boost: Multiplier from staked veCRV, ranging from 1x to 2.5x
• Convex APR: APR when the yVault strategy is depositing the curve.finance LP tokens into Convex Finance
• Gross APR: Vault total APR before deducted fees
• Net APY: Vault current APY, after deducting the fees

The actual code can be found on this repo

image

Where the file that contains the calculation for the most recent version of the yVaults is this one

Notes:

• When the active strategy of a yVault uses Convex Finance, and the streaming of the rewards is frozen at Convex, Yearn.finance Net APY will show 0% until the streaming is resumed.

image

More details about rewards streaming on Convex Finance

• When there is a spike of transactions in a pool, the “Pool APY” will reflect it for a week, as the fees will be added to the “virtual price” of this pool, and the calculation takes the last seven days into account.

Infographic

image

commented

Nice description! Would you mind sending a PR as a docs page so we include it in the documentation?