I don't see my deposit, where is it?

Update your default deposit settings

Finding the right Smart Contract

Interacting with the Contract

For Vault Depositors

For YFI Holders

The Lockers

Deposits and Withdrawals

Zaps

Swaps

How do yPT (Pendle Tokens) work?

What is Yearn X?

How do Harvests Work?

# Frequently Asked Questions and Troubleshooting

## I don't see my deposit, where is it?

If you deposited into a Yearn Vault and then click the "withdraw" tab and don't see your tokens, don't worry, they are probably staked!

The default "deposit" action in yVaults with a gauge or other extra rewards is to deposit your tokens in the yVault and stake the yVault token for extra rewards. To see your yVault tokens, look at the "veYFI BOOST" section (it may be named something else like "staking BOOST") below the withdraw section. You should be able to unstake your vault tokens there and then withdraw.

![Withdraw modal](https://docs.yearn.fi/assets/images/unstake-da383e3f74f59ee920a4dd503bb911fb.png)

### Update your default deposit settings

If you want to change the default deposit behavior to only deposit and not also stake the vault tokens, you can change that setting by clicking on the gear icon to the right of the tabs and unchecking "stake automatically" at the bottom of the menu that opens up.

![deposit setting](https://docs.yearn.fi/assets/images/deposit-setting-31cc32974cf95b154a1a9f8de780d759.png)

## My dYFI rewards are lower than expected, Why?

veYFI rewards are variable depending on how much veYFI your wallet holds. If you don't have veYFI, you will only get 10% of the maximum reward amount shown. In the image below, note the range of rewards APY. Without any veYFI, a deposit will earn a 1.16% boost, paid in dYFI.

![apy-range](https://docs.yearn.fi/assets/images/boostAPY-28b2855be43f7dea59db70f1a6a5f712.png)

If you don't have veYFI, you can deposit and stake your tokens using liquid lockers. By doing this you use the liquid locker's veYFI to boost your deposit.

Read more about the current governance staking system on the stYFI page (https://docs.yearn.fi/contributing/governance/styfi). Legacy veYFI/dYFI docs are still available under veYFI (Deprecated) (https://docs.yearn.fi/contributing/governance/veYFI-intro).

And remember, you have to consider transaction costs when using Yearn. If using Ethereum mainnet, prices for transactions vary from a few dollars to tens or hundreds of dollars, depending on chain congestion (Yearn has no control over this). If you are depositing lower amounts (<$500-1000), you may want to consider using Yearn on an L2 so fees don't negate your interest earned.

## I have withdrawn from a Factory Vault and now I have a Curve LP token. What do I do with it?

Curve factory vaults accept Curve LP tokens that represent the 2 assets being traded in a Curve pool. When you withdraw, you will most likely get this back. In order to withdraw the underlying assets from that token, you need to go to the Curve website and withdraw. You can find a link to the pool page for a specific factory vault by looking in the "Info" section on the vault page. There will be a Curve deposit URI field that will link you to the correct page to withdraw.

![curve-page-link](https://docs.yearn.fi/assets/images/curve-page-link-8ca498b36fd7b3b647f20879b7035160.png)

## A Website interaction isn't working. What do I do?

If an interaction on the website isn't working or your transaction doesn't go through on the Yearn UI (stuck with a spinning loading circle), there are a few things you can do:

- Perform a hard refresh on the web page: `ctrl+shift+R` on Windows, `cmd+shift+R` on Mac.

- Try using a different browser or wallet provider.

- If on mobile, try using the desktop version, and vice versa

- Change your wallet RPC for the network you are transacting on. This is the data endpoint that your wallet talks to pull blockchain data.

- Here is a website with lists of different chain RPCs: https://chainlist.org/

- If you connect your wallet to the chainlist site, you can add new RPCs directly from there.

- If none of the above work, you can interact with Yearn smart contracts via a block explorer. See the next entry for more information on how to do that.

## How do I use a block explorer to interact with Yearn contracts?

warning

Using a block explorer is advanced and if you have not used one before, we only recommend it to withdraw from a vault that you cannot access from the yearn.fi website, or in an emergency. Yearn, and its website, are in active development, so issues with the website should be fixed quickly upon reporting them. For many issues it is better to wait for a website fix.

If you need help, come by the discord and open a support ticket (https://discord.gg/yearn).

All of the smart contracts that you will interact with from Yearn's website live on Ethereum or one of its layer-2 networks. We have worked to make the experience of interacting with the contracts as easy as possible via the website, but sometimes something goes wrong and the website may not work. If that happens, you can interact with the underlying contracts directly with a block explorer like Etherscan (https://etherscan.io/).

Each network has its block explorer, and many have more than one. The most popular is Etherscan and most networks have a version of it for their users to use.Network NameEtherscan URLEthereum Mainnethttps://etherscan.io/Polygonhttps://polygonscan.comOptimismhttps://optimistic.etherscan.ioBasehttps://basescan.orgArbitrumhttps://arbiscan.io/Sonichttps://sonicscan.org/GnosisChainhttps://gnosisscan.io/

All of these sites should look and feel and work the same way.

### Finding the right Smart Contract

You can find the address of the smart contract that you want to interact with on the Yearn website. It is a 42-digit alphanumeric string. If you navigate to a vault page, the address is listed directly below the name. Click on the address to copy it to the clipboard.

![find address](https://docs.yearn.fi/assets/images/findSCAddress-926ec198c332d9a9f14531d5ac654b2d.png)

warning

You should confirm that your vault tokens are not staked. On the yearn website, make sure that they show up when trying to withdraw. If not they could be staked in a rewards contract. You can also withdraw from staking contracts on etherscan, but that is outside the scope of this article. So if this applies to you, come to the discord and open a ticket (https://discord.gg/yearn) and someone will be able to walk you through the process.

Once you have it copied, go to etherscan.io (or its equivalent for other chains) and paste it into the search bar. Then hit enter and it will bring up a page with information about the contract.

### Interacting with the Contract

![paste address](https://docs.yearn.fi/assets/images/pasteAddress-4da2078827316c43e03dd8d9ed584faf.png)

On the landing page, you can see recent transactions that have interacted with the contract.

To interact with the contract, you will need to click on the `Contract` button.

![contract button](https://docs.yearn.fi/assets/images/contractButton-0f18c0bb71f45ef9a6bcc15ff43bd00e.png)

Once you click on the `Contract` button you will see 3 new tabs: `Code`, `Read Contract (as Proxy)`, and `Write Contract (as Proxy)`.

- The `Code` tab will show you the source code for the smart contract

- The `Read` tab allows you to query values on the contract like the contract name, user balances, etc.

- The `Write` tab allows you to perform transactions using the contract, like depositing and withdrawing.

![contract options](https://docs.yearn.fi/assets/images/contractOptions-3878993e9e17ceefa05469638631e693.png)

To confirm you are looking at the correct contract, click the `Read` tab and find the `name` function in the list and click on it. It should show the vault name (i.e. yvUSDC-1 yVault)

![contract name](https://docs.yearn.fi/assets/images/contractName-1cf8536d1bc6c826dd2651f69e9a97f0.png)

### Withdrawing from a vault using Etherscan

-

Click on the `Read Contract as Proxy` button.

-

Click on the 🔴`Connect to Web3` button and connect the wallet you used to deposit.

![connect to web3](https://docs.yearn.fi/assets/images/connectToWeb3-6da512c42c266ea37a46bf7a24691484.png)

-

There are different steps depending on what version vault you are using, so lets check the version.

- Find the apiVersion field and click on it.

- If the number starts with 0 (i.e. 0.4.6) then it is a V2 vault.

- If the number starts with 3 (i.e. 3.0.4) then it is a V3 vault.

![apiVersion](https://docs.yearn.fi/assets/images/apiVersion-17d4d4e548d10f24e518d530fe912361.png)

Once you know the vault type, go on to the next step.

If a V2 Vault:

- Click on `Write Contract as Proxy`

- Find the first `withdraw` function. This one should only have a button that says "Write" with no additional fields.

- Click `Write` and submit the transaction in your wallet.

![withdraw](https://docs.yearn.fi/assets/images/withdrawV2-1a820fc65fd5ab6f1264ffc5c1032b12.png)

Once the transaction is approved you will be fully withdrawn from the Vault.

If a V3 Vault:

- Withdrawing from V3 vaults requires 3 arguments to withdraw: The amount, the owner, and the recipient.

- Both the owner and the recipient will be your wallet address.

- To get the amount, you need get your total balance by clicking on `balanceOf` and then entering your wallet address in the address field. Click query and you should get a long number that is your balance. Copy this balance to use in later steps.

![balanceOf](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABU4AAADKCAYAAAB63NqRAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACUwSURBVHhe7d17kFblnSfwX3NH4iUhXqhoYehMK5hlzGWrEqs2KhnIWIJgZLLEWDPqWsFJjDpRMJqsY9wsiSAmGpOCFFE34xi2BqMIFhESvKTK1NaaxHIiaEcIrE7hJRgvURpomn2fc87b/fahuwHtl+6Gz8d6q895znnPec55yT/f/J7nadhdEQAAAAAAtBtU/AUAAAAAoCA4BQAAAAAoEZwCAAAAAJQITgEAAAAASgSnAAAAAAAlglMAAAAAgBLBKQAAAABAScPuimK7btoqt2hp2R47drZGa+uuSDc8ALcFAAAAAAawhoaGGFT5DB48KIYNHRIjRgzP9g+Eugenb29ribdbdsRhI4bFkMGDs9AUAAAAAGBfpJh0d+W/1l1t0dKyI0aOGBaHjRyRH6yjuganr7/5Vgwe1BDDhg0NBaYAAAAAwLvR0DAotu/YHm1tu+PIw0cVrfVRt+A0haZDhwyOwYMHFy0AAAAAAO/erra22Lmzta7haV0Wh0rD81OlaRqaDwAAAADQmwYPGhSDBjVkOW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O51r7/5VqTLHz7qsBg8uC4ZLQAAAABwiEjD81OlaQpNjzx8VNFaH3UNTpO3t7XEW9u2x4jhQ2PY0KExdMjgGDRIiAoAAAAA7F1bW1u2en5aCCrNaZqG59ez0rSq7sFp0la5RUvL9srDtUZr5SHTPgAAAADA3qQ5TIcMGZytnp8WgqrXnKZlByQ4BQAAAAAYOCL+P8UxXzKBzJ31AAAAAElFTkSuQmCC)

- Click on `Write Contract as Proxy`

- find the first `redeem` function. It will have 3 fields for arguments. Enter the copied `balanceOf` value into the `shares` field, and your wallet address into both the `receiver` and `owner` fields.

- Click `Write` and submit the transaction in your wallet.

![withdraw](https://docs.yearn.fi/assets/images/withdrawV2-1a820fc65fd5ab6f1264ffc5c1032b12.png)

Once the transaction is approved you will be fully withdrawn from the Vault.

## What are Liquid Lockers and how do they work?

Liquid Lockers are products built on top of Yearn's governance and incentive contracts. They have two main benefits, one for vault depositors and another for YFI holders.

### For Vault Depositors

Historically, Yearn has used veYFI-based incentives to encourage deposits in some of its most important pools. For the current governance staking system (stYFI) and the migration path from legacy veYFI, start with the stYFI page (https://docs.yearn.fi/contributing/governance/styfi). The legacy veYFI documentation remains available under veYFI (Deprecated) (https://docs.yearn.fi/contributing/governance/veYFI-intro).

Because locking YFI for veYFI is complicated, if you don't want to deal with the intricacies of locks, the Liquid Lockers let you use the locked tokens of other governance participants for a fee. As a depositor, you can earn 10x more rewards by doing this, and all you have to do is stake in the liquid locker contract. See below for links to the different liquid lockers. There are also autocompounding liquid locker vault contracts that you can deposit into. Find those on the main https://yearn.fi website.

### For YFI Holders

If you want to participate in the liquid lockers system as a YFI holder, you can use their contracts that permissionlessly max-lock governance tokens (YFI to veYFI in this case) in exchange for a receipt token at a rate of 1:1. The benefit of doing this is to provide the end user with a fully transferrable token that can still receive a share of governance benefits like yield or voting power. But beware, Liquid locker tokens are not redeemable for the underlying locked tokens. Instead, they can be traded on decentralized exchanges. This means they may not always maintain price parity with their underlying assets.

Check out the current pegs of different liquid lockers here (https://www.defiwars.xyz/wars/yearn)

### The Lockers

At the time of writing, there are 3 liquid lockers for YFI:

- 1up (https://1up.tokyo/stake)

- Cove (https://app.cove.finance/yfi/stake-yfi)

- StakeDAO (https://www.stakedao.org/lockers/yfi)

## Help me understand Deposits, Withdrawals, Zaps, and Swapping between Vaults

### Deposits and Withdrawals

The standard way to enter and exit vaults is to deposit the underlying tokens directly into the contracts. That means if the vault is a single asset vault like the USDC-1 vault, you would deposit USDC. For a liquidity pool vault like a Curve factory vault, you would deposit the Liquidity pool token. For example, if you want to deposit into the Curve stETH Factory Vault, you would deposit the Curve LP token, which is the crvSTETH token that you get when depositing into that Curve pool.

### Zaps

Some vaults allow zaps from and to other assets. If possible, these options will show up in the box to select what asset to deposit or withdraw. You should always check the output to make sure the zap is giving you a good rate. There is a max slippage feature on the zaps that you may need to adjust if it isn't working. Click on the gear at the top right of the deposit/withdrawal modal and you can set the slippage there.

![gear icon](https://docs.yearn.fi/assets/images/gearIcon-f229fbaf033565bcebd27e7390f8b724.png)

### Swaps

You can also swap directly between vaults or from vaults to assets using third-party services. Yearn works with a solver on Cowswap (https://swap.cow.fi/) to provide routes between many different vaults and yearn assets. You may have to manually enter the vault or asset address in cowswap for it to be recognized. You can get that from the page for that vault, with the address living right below the name.

![copy address](https://docs.yearn.fi/assets/images/copyAddress-02695751c6a1c8bebe769e782874b435.png)

You can then paste that into the input or output fields of the cowswap interface. Always be sure to check and make sure the trade output looks right!

![CowSwap import](https://docs.yearn.fi/assets/images/cowClick-3d77dfb6fd753fa7bc26052efa4d57d1.png)

There are also other aggregators like Defillama (https://swap.defillama.com/?chain=ethereum&from=0x0000000000000000000000000000000000000000&tab=swap) and Kyberswap (https://kyberswap.com/swap/ethereum).

## How do yPT (Pendle Tokens) work?

Yearn offers vaults for Pendle fixed term positions in a number of different assets. Pendle is a yield trading protocol that allows users to split their yield from their principal and sell either part. This allows end users to get fixed interest rates on their deposits by selling their yield, and other end users can speculate on yield rates. This is all quite complicated, requiring the user to know when terms end and begin and how to optimize everything. yPT vaults are built to make it simple. You can deposit into the vault and it will automatically roll over your deposits into the next term.

Some things to be aware of:

- Because of how the underlying mechanics of Pendle work, if you withdraw far in time from the underlying strategy maturity date, you may get a bad price for your assets.

## What is Yearn X?

"Yearn X" is a user interface that puts partner products front and center. Instead of searching through the normal vault lists for a particular protocol vault, you can go to the UI for that partner. For example, if you are looking for an Aerodrome vault, you can see them all at https://aerodrome.yearn.space/.

The current partner sites are:

- Katana (https://katana.yearn.space)

- Aerodrome (https://aerodrome.yearn.space)

- Curve (https://curve.yearn.space)

- Morpho (https://morpho.yearn.space)

- Pendle (https://pendle.yearn.space)

- PoolTogether (https://pooltogether.yearn.space)

- Velodrome (https://velodrome.yearn.space)

## How do Harvests Work?

Yearn vaults auto-compound rewards, but they only do so when it makes sense. This means that for some pools, at some times, there is a period where rewards sit in the contract waiting to be harvested or swapped for more of the underlying vault tokens. Understanding how this works is important if you are depositing into some of the smaller pools that are harvested less frequently.

All yearn vaults have a permissionless `harvest` function that claims rewards earned by the vault. But this only claims the rewards. In order for these rewards to be re-invested, they have to be sold for the underlying vault assets. This is a separate, permissioned step due to the complexity of swapping into some of the more bespoke yVault assets. These swaps occur once there is enough assets waiting to be swapped that the cost to swap isn't too high. This depends on gas costs mainly. Once the assets have been swapped, they are ready to go back into the vault, but are not added until the next `harvest` call.

The intent is for this process to be happening continuously, where rewards are claimed, swapped, and then when the next round are claimed, the swapped assets get re-invested. For smaller TVL pools or those with low reward rates, this cadence may be delayed. If you are in a vault where rewards have not been claimed in a while, come into the Discord (https://discord.gg/yearn), open a ticket, and let us know!

The easiest way to see if there are harvests is to check if the Price Per Share of a vault is increasing. You can do this using the vault analytics site PowerGlove and clicking on the PPS chart to see if it is growing. Check out this page (https://yearn-powerglove.vercel.app/vaults/1/0x3f34A7eF4f17528CbFFb7817060941BCdaC924fa) for a good example of a vault that has an intermittent re-investing period.

## I have rSWELL tokens in a Yearn Vault but don't see them anywhere

If you are looking at a wallet or portfolio tracker like Debank, Zerion, or Zapper and it shows you have Swell tokens in a V3 yearn Vault, you need to go to the Swell website to withdraw them: https://app.swellnetwork.io/stake/rswell

The rSWELL vault was built on Yearn V3 contracts but was not deployed by yearn, so we don't show it on our website, but they will!

## I see I have a DSProxy but don't know what that is

A DSProxy is a "smart account" similar to a Gnosis Safe that was used by projects like DeFiSaver, instaDapp, Balancer, and others. You most likely have a wallet that controls it.

You may be able to access and operate your DSProxy using the DeFiSaver (https://app.defisaver.com/) website.

## How do I withdraw YFI staked in old governance staking contracts or ygov.finance?

If portfolio trackers show that you have governance-staked YFI for your address, it is likely in a legacy yGov staking contract. The ygov.finance site is deprecated, but you can still withdraw directly from the contracts through block explorers like Etherscan.

Step 1: Find Your Staked YFI

Your YFI is most likely in the main governance staking contract, but there are a few related contracts to check as well:

- 0xba37b002abafdd8e89a1995da52740bbc013d992 (https://etherscan.io/address/0xba37b002abafdd8e89a1995da52740bbc013d992) (Main governance contract)

- 0x3a22df48d84957f907e67f4313e3d43179040d6e (https://etherscan.io/address/0x3a22df48d84957f907e67f4313e3d43179040d6e)

- 0x0001fb050fe7312791bf6475b96569d83f695c9f (https://etherscan.io/address/0x0001fb050fe7312791bf6475b96569d83f695c9f)

- 0x033e52f513f9b98e129381c6708f9faa2dee5db5 (https://etherscan.io/address/0x033e52f513f9b98e129381c6708f9faa2dee5db5)

- 0xb01419e74d8a2abb1bbad82925b19c36c191a701 (https://etherscan.io/address/0xb01419e74d8a2abb1bbad82925b19c36c191a701)

For each contract:

- Open the contract page on Etherscan.

- Click the Contract tab.

- Click the Read Contract tab.

- Click Connect to Web3 and connect your wallet app, making sure your correct address is selected.

- Find the `balanceOf` function and click it.

- Enter your address in the field.

- Click the Query button.

- If the result is a non-zero value, you have YFI staked in that contract.

Step 2: Withdraw Your Staked YFI

- Stay on the same contract page.

- Click the Write Contract tab.

- Click Connect to Web3 and connect your wallet app, making sure you are using the correct address.

- Find the `exit` function and click it.

- Click the Write button.

- Sign the transaction with your wallet.

- Once confirmed, your entire staked balance will be returned to your address.

Tips:

- Always double-check you’re connected with the correct wallet address.

- If you have trouble or see unexpected results, reach out to the Yearn community for help.


How to Understand yVault ROI

How to Understand yVault ROI

ROI

ROI definition:

ROI calculation

Why does this happen?

Example

Conclusions

Other references

# How to Understand yVault ROI

### ROI

Trying to understand how ROI is calculated? Skip directly to "Why we should use ROI instead of APY to estimate yVaults returns (https://docs.yearn.fi/getting-started/guides/how-to-understand-yvault-roi#why-we-should-use-roi-to-estimate-yvaults-returns)"

If you are a beginner in DeFi or new to Yearn keep on reading!

#### ROI definition:

Return on investment (ROI) is a ratio between net profit (over a period) and cost of investment (resulting from an investment of some resources at a point in time). A high ROI means the investment's gains compare favorably to its cost. As a performance measure, ROI is used to evaluate the efficiency of an investment or to compare the efficiencies of several different investments.[1] In economic terms, it is one way of relating profits to capital invested. Source: Wikipedia (https://en.wikipedia.org/wiki/Return_on_investment)

- ROI is a key performance indicator (KPI) available in all Yearn Vaults (yVaults) located here as "Estimated Yearly Yield": https://yearn.fi/vaults.

- ROI is useful when comparing and assessing vault performance.

- ROI presented in Yearn is a yearly ROI. You deposit X and 1 year later you receive X + (X * ROI).

- The ROI presented is a current estimation based on data since the yVault's inception. If performance remains constant, after 1 year you will receive the displayed ROI. But in reality, rates are variable and fluctuate based on market/strategy.

yVaults have different yield farming strategies (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions), which determine how assets are moved between liquidity pools. Strategies are created by the `Controller` who manages the yVault.

New strategies are also voted by the community through governance proposals (https://gov.yearn.fi). A new strategy creates a new challenge in terms of ROI calculation.

- Individuals interested in participating in a yVault should monitor the ROI presented in the vault dashboard after a strategy change. The rate presented reflects the most recent ROI.

- An individual participating before a strategy change might be interested in comparing ROI before and ROI after. Historic ROI, e.g. since yVault creation, can also help users understand performance and inform future decisions.

## ROI calculation

Even though yVaults have a compounding effect inherently, this compound interest is not fixed like in a CeFi savings account. Hence, the concept of APY (https://www.investopedia.com/terms/a/apy.asp) and APR (https://www.investopedia.com/terms/a/apr.asp) is not the most accurate way to estimate yVault gains. They are used by the community and we also added them to our newer interfaces, but interpreting them should always be taken with a grain of salt.

### Why we should use ROI to estimate yVaults returns?

- This shows the estimation of an asset that has interest / compounded interest applied to it:

![""](https://i.imgur.com/OZKqesB.png)

- This is the actual, measured performance of an asset in the yUSD vault:

![""](https://i.imgur.com/NpogiO9.png)

### Why does this happen?

A bank's interest rate is constant: either linear or compounding. The interest rate is multiplied by the asset value each period.

yVaults work differently:

After depositing into a yVault, the user receives 'wrapped' tokens. These tokens start with a 'y' prefix and the depositor receives fewer tokens than were deposited (why is explained below).

Starting from its inception, the vault's input and output are governed by the following equation:

F=I∗PF = I * PF=I∗P
Where FFF is the amount of the tokens in the vault, III is the amount of 'wrapped' tokens held by users and PPP is the 'price' of those wrapped tokens.
At the start, P=1P = 1P=1
Thus I=FI = FI=F, amount of tokens inside the vault is equal to amount of wrapped tokens.
Almost all strategies are identical: invest deposited tokens, accumulate additional tokens which can be withdrawn in the future.
By keeping track of the number of wrapped tokens, and the amount of tokens inside the vault (which increase the longer they are held in the vault) the price can be calculated as follows:
(vaulttokens)/(wrappedtokens)=P(vault tokens) / (wrapped tokens) = P(vaulttokens)/(wrappedtokens)=P
Since the amount of wrapped tokens is constant but the amount of vault tokens increases, the price will increase.
The balance and thus price are therefore constantly increasing.
Therefore, the only thing we can do is:

Try to use data from two different points in time
Assume growth is linear (because simply there is no other information we have)
Construct a line using both points which we then extrapolate
Calculate price at future data to display ROI.

However, as shown below this is dependent on where we take those points.

### ROI extrapolation applied to the yUSD Vault chart

Below are examples to show different results possible by applying linear extrapolation to two points of the price chart for the yUSD yVault.
First of all, why and how is this done?
Vault input/output formula:
F=I∗PF = I * PF=I∗P
Now, we want to calculate the increment of FFF which would be our return.
Since III is constant, and only PPP changes, if we know PPP at a future date, we can calculate our return.
In order to get the formula for a line having two points we have to do some math:
Formula for a line: y=m∗x+cy = m*x + cy=m∗x+c
where yyy is the price, xxx is the block height and mmm, ccc are what we are looking for.
First, let's get ccc.
When x=0x = 0x=0 (so at inception of the yVault), we know that the price is 1, hence: y=m∗0+cy = m*0+cy=m∗0+c (x = 0) y=cy = cy=c y=1y = 1y=1 (price is 1 when x = 0) c=1c = 1c=1
Now m (here we have to apply derivatives):
Using the product formula and the constants formula:
y′(x)=my'(x) = my′(x)=m
Approximating the derivative of a linear function can be done by:
y′(x)=(y2−y1)/(x2−x1)=my'(x) = (y2-y1)/(x2-x1) = my′(x)=(y2−y1)/(x2−x1)=m
y2y2y2 being the price at block x2x2x2 and y1y1y1 the price at block x1x1x1.
Finally we have the complete formula and can estimate the price at any date in the future.
However, since y(x)y(x)y(x) is not linear, we get different lines for different points (shown below).
As a result, our estimation for price in future and the return varies greatly depending on which points we choose.
Here we take two points of the performance chart for the yUSD vault (numbered colored points) and apply the above. Notice that the different lines are relatively good indications for the short term, but when we try to use them to predict long term they're totally inaccurate!

![""](https://i.imgur.com/CJnIJub.png)

### Example

Jane has 100 yCRV tokens and decides to invest them in the yUSD yVault.
At that time the price PPP is 1.045, the total number of vault tokens is 10,450 and of wrapped tokens 10,000. 10450/10000=1.04510450 / 10000 = 1.04510450/10000=1.045
Now her yCRV tokens get adjusted according to the formula above which is why she sees her now wrapped tokens (yUSD) reduce in quantity and the tokens in the vault (yCRV) are equal to the amount she invested.
So, how many wrapped tokens will she receive?
I=F/P=100/1.045=95.7yUSDI = F/P = 100/1.045 = 95.7 yUSDI=F/P=100/1.045=95.7yUSD
This action, did not change the price because she supplied to the number of wrapped tokens and vault tokens each exactly according to the ratio of the current price. This is quite important since it means that deposits and withdrawals will not have any effect on the price of the wrapped token.
Fast forward a few days, the strategy uses Jane's funds to yield farm and uses the profits to purchase more tokens held inside the vault, increasing the balance to 10,500. For simplicity's sake, assume there were no other deposits. The wrapped tokens are still 10,000 and thus: P=10500/10000=1.05P = 10500/10000 = 1.05P=10500/10000=1.05
When Jane now looks at her balance of wrapped tokens, she will see that they have incremented to approx.:
F=I∗P=95.7∗1.05=100.5F = I * P = 95.7 * 1.05 = 100.5F=I∗P=95.7∗1.05=100.5
At this point, she could withdraw and receive her initial yCRV deposit and an additional amount of yCRV tokens, giving her a return of 0.5% on her initial investment (ignoring the 0.5% withdrawal fee).

### Conclusions

The short-term ROI data is a suitable estimation for the short-term (i.e. if we compare the % from the last two days, it's likely that the following two days are going to be similar).
Short-term ROI data is absolutely not accurate when extrapolated in the long-term.
Long-term data (say today and inception of vault) is a good overall estimation of the vaults performance and should be used when comparing different investment opportunities.

In other words, if your goal is to approximate returns in the short-term, you should use datasets that are recent (daily/weekly).

If you would like to make a crude estimation on how returns may look like in a year or longer, the longest possible historic timeframe should be taken.

### Other references

The community has been actively creating tools and guides on this topic.

- Statistics FAQ (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions)

- How Yearn shows APY in the v3 interface (https://medium.com/iearn/how-yearn-calculates-estimated-returns-apy-b4fd5b687bf9)


Yearn

yVault / Yearn Vault

Token

yvToken

Strategy

Strategist

Finance

Yield / Profit

Interest

Compound / Autocompound

Position

Hedge

Arbitrage

Vest

Collateral

Liquidation

Lend / Borrow Against

DeFi

Yield Aggregator / Yield Optimizer

Supply / Deposit / Stake

Harvest / Claim

Sell / Buy

Rewards

Lock

Unlock

Liquidity Provider

Joint Liquidity Provider

Liquidity Pool

Stable Pool

Impermanent Loss

Uniswap

DAI / USDT / USDC

Curve

Tricrypto

Curve Boost / Curve Gauge

Convex

Flashloan / Flashlend

Mint

Flashmint

Cooldown

Fold / Leverage

# How to Understand Strategies Descriptions

While reading the strategy descriptions at yearn.fi/vaults↗ (https://yearn.fi/vaults) you may come across unfamiliar terms. But do not fear, like a DeFi Duolingo, Yearn is here to help you navigate these strange semantic waters. So buckle in and let's learn the lingo of strategies.

- Regular links navigate between the glossary.

- Links marked with ↗ go to external websites.

# Yearn

### yVault / Yearn Vault

- Smart contract↗ (https://ethereum.org/en/developers/docs/smart-contracts/) that holds user deposits and allocates into different strategies.

### Token

- Token is any ERC20-compatible↗ (https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) DeFi token.

### yvToken

- Yearn Vault Token (yvToken) is an ERC20-compatible token that represents a position (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#position) in a Yearn Vault.

- For example: yvDAI represents a position in the DAI Yearn Vault.

### Strategy

- A smart contract↗ (https://ethereum.org/en/developers/docs/smart-contracts/) that knows how to allocate funds into a specific yield (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit)-generating automated operation.

### Strategist

- A person that creates and maintains one or more strategies.

# Finance

### Yield / Profit

- Money (or tokens) made by an investment that surpasses the invested initial amount.

### Interest

- Fee charged for lending (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lend--borrow-against) money.

### Compound / Autocompound

- Compounding is when you reinvest yields (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit) in the same investment.

- Autocompound is when a tool does compounding automatically for you.

- There is also a protocol called Compound Finance (COMP), but that is different.

### Position

- Total amount of money (or tokens) allocated into an investment.

### Hedge

- A position in a contrarian investment to one you already have, so if things go wrong in one thesis you offset losses by gains in the other position.

### Arbitrage

- Taking advantage of the price difference in different places.

- For example: ETH is 2000atoneplaceand2000 at one place and 2000atoneplaceand1950 at another, so you quickly buy from the cheaper source and sell on the more expensive source for $50 profit.

### Vest

Gradual unlocking of tokens or stocks.

- For example: if you receive 4000 tokens in a 4-year linear vesting it means you get 1000 tokens/year (unlocked on a daily or monthly basis depending on the contract).

### Collateral

- An amount of money (or tokens) that gets locked (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lock) until a pre-determined agreement is met, commonly at risk of liquidation (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidation)

### Liquidation

- When you fail to repay a loan (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lend--borrow-against) or other agreement which involves collateral (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#collateral) and the collateral is sent to other parties to repay and make them whole, so you can't access the collateral because it's not yours anymore.

- For example: you add ETH as collateral and borrow dollars against it, but you fail to repay the loan in due time, so your collateral gets liquidated and you lose the ETH deposited.

### Lend / Borrow Against

- Lending is when you provide liquidity to someone else for some time and expect them to pay you back in the future.

- Borrowing is when you take money from a lender.

- Borrowing against is used to specify the collateral (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#collateral) used by the borrower. Example: "I borrowed 5000$ against my car, so if I don't repay the loan the bank can take it".

- In DeFi this operation is often over-collateralized since there are no resources to charge debt.

# DeFi

### Yield Aggregator / Yield Optimizer

- DeFi protocols like Yearn that provide a single interface to allocate capital in different yield sources, leveraging autocompounding (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#compound--autocompound) to improve the yield (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit).

### Supply / Deposit / Stake

- Might be used interchangeably sometimes, but it often means that tokens are sent to a contract external to the current wallet.

- Supply often means that the money is being lent (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lend--borrow-against)

### Harvest / Claim

- When a strategy (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#strategy) collects profits (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit) or rewards (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#rewards) in a blockchain transaction.

### Sell / Buy

- Exchange a token for another token, in DeFi this happens on Decentralized Exchanges

### Rewards

- Tokens earned by a protocol-incentivized action.

- For example: if you deposit liquidity into Uniswap you get trading fees, but you also get UNI rewards for doing this at Uniswap and not at SushiSwap.

### Lock

- Tokens that are locked can't be used until a specific condition is met.

### Unlock

- Unlocking refers to meeting a condition and receiving locked tokens.

### Liquidity Provider

- Liquidity Provider is anyone that deposit (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#supply--deposit--stake) tokens in a protocol.

### Joint Liquidity Provider

- Joint Liquidity Provider (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidity-provider) is when your tokens are aggregated with another person's tokens to provide liquidity together.

### Liquidity Pool

- A Liquidity Pool↗ (https://www.coindesk.com/learn/what-are-liquidity-pools/) is a decentralized market for 2 (or more) tokens.

### Stable Pool

- A Stable Pool is a Liquidity Pool made only of stablecoins.

### Impermanent Loss

- When you lose money for being a liquidity provider to liquidity pools when compared to just holding the 2 (or more) tokens in your wallet, it happens when the market price ratio for the tokens diverges from the value that they had when you provided liquidity, which is why it can also be called Divergence Loss.

### Uniswap

- The Uniswap↗ (https://app.uniswap.org/#/swap?chain=mainnet) protocol, a decentralized exchange that aggregates many Liquidity Pools (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidity-pool), used to buy and sell tokens.

- The Uniswap protocol has a v1, v2 and v3, when you read "Uniswap" it refers to v2, the v3 is always explicitly mentioned like "Uniswap v3".

### DAI / USDT / USDC

- The three largest stablecoins in the market, pegged to the dollar value, so 1 token represents 1 dollar.

### Curve

- Curve is the most well-known and largest stablecoin swap protocol.

- CRV is the token Curve mints

- CRV can be locked for veCRV (untradeable) to receive Curve protocol profits (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit).

- veCRV also has governance power over the Curve protocol and allows boosting rewards for adding liquidity to their pools (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidity-pool).

### 3pool

- 3pool refers to the DAI / USDT / USDC (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#dai--usdt--usdc) Curve liquidity pool (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidity-pool).

### Tricrypto

- Tricripto refers to the wBTC + wETH + USDT Curve liquidity pool (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidity-pool).

### Curve Boost / Curve Gauge

- Locking up CRV (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#curve) on Curve allows you to boost your CRV rewards (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#rewards) for being a liquidity provider.

- Read more at Curve docs↗ (https://resources.curve.finance/reward-gauges/boosting-your-crv-rewards).

### Convex

- A protocol that made locked CRV (called veCRV) tradeable, managed to amass huge liquidity, and controls more than 50% of all circulating CRV. docs↗ (https://docs.convexfinance.com/convexfinance/general-information/why-convex).

### Flashloan / Flashlend

- Loan, use, and payback tokens in a single blockchain transaction.

- Often used to amass high liquidity for a quick operation where you don't have it.

### Mint

- The creation of new tokens.

- For example: new DAI is minted when someone borrows against (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lend--borrow-against) ETH.

### Flashmint

- Flashloan (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#flashloan--flashlend) tokens to mint (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#mint) new ones in a single blockchain transaction.

### Cooldown

- An obligatory period of waiting before you can do an action.

### Fold / Leverage

- Borrow (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#lend--borrow-against) tokens, sell them for the ones you borrowed against, and borrow again.

- For example: you deposit 100 ETH as collateral and borrow DAI, then trade that DAI for more ETH and deposit again as collateral (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#collateral) for increased yield (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#yield--profit) (but also increased liquidation (https://docs.yearn.fi/getting-started/guides/how-to-understand-strategies-descriptions#liquidation) risk).


How Yearn Boosts Yield

How Yearn Boosts Yield

CRV vote locking

Voting

Staking

Earning Trading fees

Boosting

The yveCRV yVault

Earn CRV with a better boost

The yvBoost yVault

Earn boosted CRV with compounding

A little alpha

Locking CRV for veCRV

CRV Vote Locking in Yearn

More information

# How Yearn Boosts Yield

info

While the general information below about how Yearn boosts yields within the Curve ecosystem is still accurate, yveCRV and yvBOOST have both been migrated to the yCRV liquid locker. You can read about yCRV here (https://docs.yearn.fi/getting-started/products/ylockers/ycrv/overview).

This is an overview of how Yearn investment strategies take advantage of CRV vote locking on Curve Finance in order to increase yield.

## CRV vote locking

Vote locking, "Boosties", or "Vote boosting" is a Curve Finance feature where CRV is locked into the Curve DAO.

Vote locking CRV rewards yields veCRV (voting escrow CRV tokens). The longer time period that CRV is locked for, the more veCRVs are received. The minimum locking period is 1 week and the maximum period is 4 years.

veCRV enables its holders to:

- vote in Curve governance

- stake to earn trading fees and

- boost rewards from liquidity provided

### Voting

Once CRV holders vote-lock their CRV, changing it into veCRV, they can then vote on various DAO proposals and pool parameter changes which are proposed, or propose their own changes.

It is worth noting that native veCRV cannot be transferred, and the only way to obtain it is by vote-locking CRV.

You can stake CRV on curve.finance (https://curve.finance/) and actively manage your boosts for Liquidity Pools yourself, or you can let Yearn take care of CRV staking for you with our dedicated vaults: yveCRV, and yvBOOST. Also our yVault tokens are tradeable and transferable unlike staking CRV at curve.finance (https://curve.finance/).

### Staking

veCRV (staked CRV), receives a share of trading fees from the Curve protocol (50% of all trading fees generated, from Sept. 19, 2020 - onwards). Those fees are collected and used to buy 3CRV, the LP token for the TriPool (DAI+USDC+USDT), which are then distributed to veCRV holders.

#### Earning Trading fees

Based on Yearn's share of the total veCRV, 50% of trading fees will be claimed as CRV, out of which 10% will in turn be locked into the Curve DAO for more veCRV.

### Boosting

Beyond staking, another major incentive for CRV is the ability to boost your rewards on provided liquidity. Vote locking CRV allows you to acquire voting power to participate in the DAO and direct CRV reward allocations towards selected pools, earning a boost of up to 2.5x on the liquidity you are providing.

The actual boost multiplier is determined by a formula that depends on the current pool gauge liquidity as a fraction out of the total amount of liquidity provided in Curve pools by Yearn, and the fraction of voting power that the veCRV constitutes out of the total (i.e. its share of the current total of veCRV issued).

See the Curve Guide (https://resources.curve.finance/reward-gauges/boosting-your-crv-rewards/) for more details on the formula and its calculation.

## The yveCRV yVault

![image](https://miro.medium.com/max/115/0*OsdD6266-e0jWcVH.png)

#### Earn CRV with a better boost

When a user deposits CRV into the vault, that CRV is locked on the curve.finance (https://curve.finance/) platform as veCRV and the user is returned a tokenized version of veCRV, yveCRV. This vault earns you a continuous share of Curve’s trading fees. Every week, these rewards can be claimed as 3Crv (Curve’s 3pool LP token).

You could do this yourself directly on the curve.finance (https://curve.finance/), but there is a very good reason one would prefer to use the yveCRV yVault: more rewards!

How much more? Your rewards through this vault can be more than double! Yearn achieves this because it periodically donates 10% of the farmed CRV it earns through all curve.finance (https://curve.finance/) based strategies to this yveCRV vault and allows yveCRV vault depositors to claim Yearn’s share of Curve protocol fees. This means we give all of Yearn’s rewards, which we could have claimed for the protocol, to yveCRV depositors, boosting their weekly rewards.

Locking your CRV tokens into the vault means that you delegate your curve.finance (https://curve.finance/) voting power to yearn. Yearn constantly runs simulations to optimize its voting allocations which maximizes yield across all vaults, benefiting your deposits in other vaults!

You can now claim your rewards and spend that money on mojitos while you enjoy retirement. Though, another option you might want instead is to add your rewards back into the vault to compound your gains and you can even find a “Restake” button to do just that. You could very well do this manually, but Yearn has you covered here with …

## The yvBoost yVault

![image](https://miro.medium.com/max/115/0*Xr6RMWyDc6gmZnKw.png)

#### Earn boosted CRV with compounding

The yvBOOST yVault is a fully automated and compounding version of the yveCRV yVault explained above.

To put it simply, this vault claims your weekly 3CRV rewards automatically and uses them to acquire more yveCRV (either via market-buy or mint, depending on which is most efficient at time of harvest).

Once deposited, just as in the yveCRV yVault, your CRV tokens’s voting power is handled and optimized by Yearn. You do not need to worry about claiming curve.finance (https://curve.finance/)’s weekly protocol fees, the vault does this for you!

This is a “set-and-forget” vault where your CRV tokens grow exponentially, harnessing the power of compound interest!

Now you might be wondering how one would extract any gains made from your CRV tokens in the vault, when as mentioned earlier, any CRV deposited into either the yveCRV or the yvBOOST are locked. While you cannot withdraw from the yveCRV vault, you can actually swap both of these vault tokens on Sushiswap. This is because Yearn and its users provide liquidity on Sushiswap to allow swapping of your yveCRV and yvBOOST tokens for ETH (or anything, really).

#### A little alpha

Yearn buys yvBOOST from the market, unwraps it into yveCRV, and donates that yveCRV into the yvBOOST vault, increasing the underlying value of yvBOOST.

### Locking CRV for veCRV

10% of all CRV earned by the strategies are locked up for 4 years in the Curve DAO in order to get the maximum reward ratio of 1:1 CRV:veCRV.

Actual veCRV distribution has not yet begun, with a date for this still to be announced by Curve Finance.

## CRV Vote Locking in Yearn

Staking your CRV directly on the curve.finance (https://curve.finance/) platform means locking your CRV token in exchange for a non-transferrable veCRV token that allows you to manually claim a share of the protocol’s fee (3CRV). You can use this veCRV token to manually rebalance your votes to obtain a boost on your provided liquidity to the curve.finance (https://curve.finance/) platform.

Yearn deploys a single CRV vote locking strategy that is shared across its general Curve strategies:

- StrategyCurveYBUSDVoterProxy (https://etherscan.io/address/0x112570655b32a8c747845e0215ad139661e66e7f#code)

- StrategyCurveBTCVoterProxy (https://etherscan.io/address/0x6d6c1ad13a5000148aa087e7cbfb53d402c81341#code)

- StrategyCurveYVoterProxy (https://etherscan.io/address/0x07db4b9b3951094b9e278d336adf46a036295de7#code)

- StrategyCurve3CrvVoterProxy (https://etherscan.io/address/0xC59601F0CC49baa266891b7fc63d2D5FE097A79D#code)

### Enter Yearn’s yveCRV and yveBOOST vaults

Both of these Yearn vaults reward CRV stakers with a share of the CRV locked by Yearn, making it an ideal destination for those who wish to stake CRV whilst remaining liquid:

- Earn a share of trading fees from the curve.finance (https://curve.finance/) protocol (3Crv), automatically reinvested (for the yvBOOST vault).

- Earn a share of Yearn’s claim of curve.finance (https://curve.finance/) protocol fees, on top of your own rewards (more 3CRV!), automatically reinvested (for the yvBOOST vault).

- The collective voting power of the veCRV tokens is optimized and rebalanced automatically to maximize rewards in all of Yearn’s Curve Pool vaults.

- Receive yveCRV or yvBOOST tokens for your deposited CRV, allowing you to easily extract profit or exit your staked CRV position

Yearn’s work to automate the yield generation and rebalancing of your crypto assets is especially true in the case of your CRV holdings, and Yearn’s yveCRV or yvBOOST offers a powerful, compounding, “set-and-forget” place to stake your CRV!

## More information

- curve.finance (https://www.curve.finance/) webpage

- Curve Guide (https://resources.curve.finance/lending/how-to-supply/#staking-assets) for staking CRV

- Curve Guide (https://resources.curve.finance/reward-gauges/boosting-your-crv-rewards/) for vote locking

- Curve FAQ (https://resources.curve.finance/crv-token/faq/)

- deFinn Infographic (https://gateway.pinata.cloud/ipfs/QmY8BZjN6oT4rrgveSqHjygcQmWitoMQk5B3moqFA6K8ea) on CRV Voting Boost and formula

- Boost calculator (https://dao.curve.finance/minter/calc)

- Yearn CurveDAO proxy strategy diagram (https://twitter.com/bantg/status/1308680661801340929)


How to Understand Vault APYs

How to Understand Vault APYs

Non-curve assets

Curve assets

Notes

Infographic

# How to Understand Vault APYs

It is a standard in DeFi to estimate returns through APY (https://www.investopedia.com/terms/a/apy.asp) and APR (https://www.investopedia.com/terms/a/apr.asp), and Yearn also does so. However, different calculations depend on the yVault underlying asset: one for Curve.Finance (https://curve.finance/) LP Tokens and another for non-curve assets. For a simpler version, check our APYs medium article (https://medium.com/iearn/how-yearn-calculates-estimated-returns-apy-b4fd5b687bf9) or the infographic at the end of the page. The following sections will show how each is calculated:

## Non-curve assets

The estimated returns are displayed on yearn.fi this way:

![image](https://lh3.googleusercontent.com/z2zbme8yXIquVgZjFqSFyz5RmRmxBX2-LEjBvCjSSdBeBYUC9HnfWrnJD5KDYjw4O_Do9wc8lVis0z01rG8HD8YLdvuQ3N9Yzy3hFArQ5DV5I76jgrPPCtUdKDF86933YRARcUOfoXOYPStetw)

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 Arbitrum, then the Weekly APY 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: https://github.com/yearn/yearn-exporter/tree/master/yearn/apy

![image](https://lh6.googleusercontent.com/1ubZF6PCD7BAd7lXM6sGHmTXmgAdzs-IjLkPN-mtsPgpnvXWZS7E4RPznBrmpXIKOaV7JAP_iZlpih0avNvTKYMU9xeuWQ8GLhcj4QmcB00v6wXXveVPHTq_O81TumVXDiykOqcpovW4YZNvEQ)

The file that contains the calculation for the most recent version of the yVaults is this one: https://github.com/yearn/yearn-exporter/blob/master/yearn/apy/v2.py

## Curve assets

The estimated returns are displayed on yearn.fi this way:

![image](https://lh3.googleusercontent.com/dvUnhactHIG6KEFHTpw77axZfgEldRjsmYd-qv5sYbx1_wp_A_Pjy_0f-ZzmFa-GxqkLjcjUZqhSfOtmA9ajqbPf_L7urk0SiQmRLXNQSYZ3mHhp_bMZTJKcK0_z9tsRZHsaZ4n_6nbEaISMtA)

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 (https://www.convexfinance.com/)

- 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: https://github.com/yearn/yearn-exporter/tree/master/yearn/apy/curve

![image](https://lh5.googleusercontent.com/0RcgjElU5oJ1831Ku1yyiwCuSDjjujo3SZjVhVdD8Ve596nB7Hedv9UHUIf_VwkLomCaO0XULTaghTKDLYJ1Uba_kcivY78s2tAA18iwnTi1k__LXqZVOqWKzI2Hj2a5zgte0DaYusDTaNOZ8w)

The file that contains the calculation for the most recent version of the yVaults is this one: https://github.com/yearn/yearn-exporter/blob/master/yearn/apy/curve/simple.py

### Notes

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

![image](https://i.imgur.com/H4VRhz8.png)

More details about rewards streaming on Convex Finance (https://docs.convexfinance.com/)

- 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](https://i.imgur.com/uT6VW9f.png)


Operations procedures

Operations procedures

From the vault

From the strategy

Emergency Procedures

# Operations procedures

## Revoking a strategy with normal migration

Let's say we found a problem in one of the strategies and we want to return all funds. There are two ways of doing it.

The scripts below use the HEGIC vault as an example.

### From the vault

```
# Grab the gov accountgov = accounts.at(vault.governance(), force=True)# The cream strategy is the first in the withdrawal queues1 = Contract(vault.withdrawalQueue(0))# Revoke msg should be sent from gov or guardianvault.revokeStrategy(s1, {"from": gov})
```

After running the command you will notice:

```
vault.strategies(s1).dict()['debtRatio'] == 0
```

Last step is running a `harvest` to return funds to vault:

```
s1.harvest({"from": gov})>>> hegic.balanceOf(s1)0>>> hegic.balanceOf(vault)/1e18291731.2666932462
```

### From the strategy

From the strategy itself we can turn on emergency mode.
To do it we need to run:

```
# Grab the strategist accountstrategist = accounts.at(s1.strategist(), force=True)# Turn on the emergency exits1.setEmergencyExit({'from': strategist})# Harvest to move funds to the vaults1.harvest({'from': strategist})
```

We should also see the strategy's `debtRatio` going to `0` and funds returning to the vault.

## Emergency Procedures

We can also shutdown the vault to return assets as soon as possible. To do that we will need a guardian or governance account:

```
# Sound the alarmvault.setEmergencyShutdown(true, {'from': gov})# Harvest all strategiess1.harvest({'from': gov})s2.harvest({'from': gov})s3.harvest({'from': gov})# Check all the tokens are back in the vault>>> hegic.balanceOf(vault) == vault.totalAssets()True
```

You will notice that this procedure doesn't change the debt ratio:

```
>>> vault.strategies(s1).dict()['debtRatio']1600
```

It drops the credit to `0`:

```
>>> vault.creditAvailable(s1)0
```


Hacking on Yearn

Hacking on Yearn

Core Tools

Getting Started

Starter Kit

Testing

Introduction

What do I need for testing?

How do I select a supported testnet?

Additional Resources

Frontend Integrations

Strategy Development

Data Analysis

Inspiration

Examples

Expectations

Resources

# Hacking on Yearn

This page is for the hackers and buidlers who are currently building, or planning to build, something cool with Yearn Finance. This guide details all the info you need to start hacking!

# Core Tools

- Solidity (https://docs.soliditylang.org/en/v0.8.6/index.html)

- Brownie (https://eth-brownie.readthedocs.io/en/stable/)

- ethers.js (https://docs.ethers.io/v5/)

- Web3.js (https://web3js.readthedocs.io/en/v1.4.0/)

- Ganache (https://trufflesuite.com/ganache/)

- Foundry (https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry)

# Yearn Vaults & Smart Contract Integrations

Yearn’s core product is the Vault (also known as yVault) — a set-it-and-forget-it yield aggregator running on top of DeFi’s yield-generating protocols like Compound, Aave, Curve, and Convex.

## Getting Started

#### Starter Kit

Here's an example of integrating V2 vaults and ERC-4626.

https://github.com/storming0x/ystarter-foundry-kit

What you'll find:

- Basic example Solidity Smart Contracts for integrating with Yearn Vaults for both V2 and ERC4626 interfaces.

- ERC4626 adapter to wrap yearn vaults.

- Example Contracts

- Sample test suite.

Yearn Vaults

This repository (https://github.com/yearn/yearn-vaults#readme) includes the set of smart contracts that are used for the Yearn Vaults. It contains the requirements, code, deployment scripts, and tests necessary for the core protocol, including an inheritable template strategy for use with Solidity-based strategies that interact with Yearn Vaults. These contracts are used to create a simple way to generate high risk-adjusted returns for depositors of various assets via best-in-class lending protocols, liquidity pools, and community-made yield farming strategies on Ethereum.

## Testing

### Introduction

You can test Yearn vaults without spending cryptoassets on the available testnet for each network.

To get started, head to the yearn testnet client which is available at: https://hack.yearn.fi/

Make sure to switch your wallet provider to the appropriate testnet network in order to use the protocol testnet without incurring costs on the mainnet network.

Testnet networks are different environments from mainnet and simulate real use cases for development, testing or production. The assets on a testnet are not “real,” meaning that they cannot be withdrawn to your wallet for any real economic value.

Testing is possible through Ethereum Rinkeby

Steps:

- Deploy your vault with your own token

- Mint your own tokens

- Hack!

### What do I need for testing?

When accessing each testnet, you will need to use its own native asset token.

Steps to test:

- Go to https://hack.yearn.fi/

- Switch to the testnet you wish to utilize over your wallet provider

- Make sure to have the native asset for the specific network

- Get some tokens from the test client faucet (Ethereum Rinkeby https://faucet.rinkeby.io/)

Make sure to select the correct market in the top right corner. You can find this on the left side of the address. Select the token you need and submit the faucet transaction but be mindful to make sure that you have certain amount of the native asset of the testnet you wish to transact on.

#### How do I select a supported testnet?

First, be sure to check if your wallet provider allows you to switch to testnet. Some providers, such as the Metamask extension, display the network selection on top of the menu over the extension and, in the case of mobile Metamask, above the wallet section. It’s important to always do your research for compatible wallets with compatible networks.

#### Additional Resources

- Workshop: Building and Integrating with Yearn Vaults: https://www.youtube.com/watch?v=urC35PMbpJ4
--> Learn how to leverage the power of Yearn by creating a money-making integration on top of v2 vaults by taking advantage of the brand new EIP-4626: Tokenized Vault Standard! This workshop will guide you through creating a B2B/business router for yearn v2 vaults, which complies with the new EIP-4626. You'll be able to choose from multiple fee strategies for your users to maximize your profit.

- https://hackmd.io/t8HlcedLQeCu2l7RG-5Vbw?view

- https://twitter.com/storming0x/status/1436851219864059906?s=20

# Frontend Integrations

Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both on-chain and off-chain.

The repository here (https://github.com/turtlemoji/yearn-sdk-examples) contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start interacting with the Yearn protocol in your own app.

Live Preview Sandbox

The following repository contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start:
https://github.com/turtlemoji/yearn-sdk-examples

# Strategy Development

A Yearn Strategy is a set of smart contracts that implement different farming strategies that utilize the deposited assets to generate the best yields for users.

The implementation of the strategies moves assets from one farming application to another one with higher interest. This will mostly be done automatically, which automatically monitors and tracks the best farming applications with high yield and low risks.

Rewards/profits generated by strategies are regularly updated, harvested, swapped for the original vault asset, and deposited again for compound farming. Each vault has a unique strategy and the strategy will be improved constantly based on the observations of our AI-based monitoring engines.

By having a strategy, users only need to deposit single assets and let the strategies generate profits from the funds. Yearn automates the whole compounding process, making it as close to optimal as possible.

-

https://github.com/yearn/brownie-strategy-mix

-

Forking a Strategy Locally: https://github.com/yearn/yearn-vaults/blob/main/CONTRIBUTING.md

# Data Analysis

Yearn aims to provide more insights into our products to our customers and partners through analyzing the on-chain and off-chain data. Given that all Yearn protocol data is publicly stored on-chain, there are lots of insights to be gained from analyzing these transactions.

Two common tools for on-chain data analysis are:

- Dune Analytics- Query contract data and generate dashboards with SQL

-

Current Dashboards (https://dune.com/projects/yearn)

Here's a list of all the new things you can query for:

- harvests

- deployments

- transactions

- contract_tokens

- contract_strategy

- v2_deployments

Fiddle with them all at https://dune.com/queries/625814

- The Graph- Query contract data with GQL using the Yearn subgraphs

The Graph is a decentralized protocol for indexing and querying data from blockchains, starting with Ethereum. It is an easier way to retrieve specific data from the blockchain, within the ethos of web3, with the advantages of decentralization and reliability.

GraphQL is the underlying query language used in The Graph.

What is the difference between standard RESTFUL API calls and GraphQL calls? The difference is that traditional APIs require the developers to create specific endpoints for users that return specific data. If the user requires more information, they may need to make multiple API calls, sometimes hundreds of API calls, to get the information they require. With The Graph (which uses GraphQL), only one call is needed to a subgraph, as long as the developer has created a flexible schema.

- https://thegraph.com/hosted-service/subgraph/rareweasel/yearn-vaults-v2-mainnet

- https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-mainnet/graphql

## Some of the research questions that we are interested in:

- Screening profitable liquidity pools for our strategies

- Assessing the impact of TVL on the impermanent loss

- Screening the volume of various pools

- Providing risk metrics to our vaults

- Price volatility of the underlying token

- Addressing the protocol risks

- Optimizing our strategies according to the change in gas fees

- Decide on when to deleverage and trade the governance tokens

- Decide on when to harvest

- Predicting impermanent loss for Uniswap V3 pools

- Portfolio construction across yearn products
More details on these topics can be seen in our issues tab.

Data Sources

Yearn SDK (https://github.com/yearn/yearn-sdk) [Docs (https://yearn.github.io/yearn-sdk/)]
https://docs.yearn.fi/vaults/yearn-sdk/yearn-stack
If you are not sure about which service you should first look into, Yearn SDK can provide you with addresses of contracts and endpoints of yearn’s services.

Yearn API (https://github.com/yearn/yearn-caching-api) [Docs (https://docs.yearn.fi/developers/data-services/yearn-data)]
Yearn's data services can provide vault-oriented data, including the TVL of vaults, APYs, fees, and strategy metadata through REST API, without the need to make web3 calls.

# Inspiration

Common use-cases for vaults include:

- Using Vaults as collateral for lending/borrowing

- Using Vaults to generate yield with user funds

In both cases, the protocol integrating with yearn is rewarded with performance fees taken from the vault’s overall profits, the more total volume that a partner contributes to a vault, the bigger share of the profit they receive.

Hundreds of protocols have built exciting functionalities using Yearn’s integration methods. These include:

- Alchemix provides self-repaying loans using vault yields

- Abracadabra provided the first yVault leveraging system that allows users to take loans and keep the yield rolling

- QiDao provides 0% interest loans if you use yVaults as collateral

Here are some ideas on what you can build:

- Use the Vaults as collateral to borrow money and probably get some leverage. (e.g. Abracadabra)

- Build a product that allows you to use yield to do cool stuff:
donate yield to an NGO
invest the yield in more risky stuff or directional bets
paying bills and subscriptions

- Create a metavault on top of multiple vaults. One idea that comes to my mind is having a USD metavault that deposits into multiple dollar-pegged vaults based on some strategy and abstracts the complexity from the user.

- Build a UI that accepts deposits and allows you to move assets across chains.

- Use the vaults as a place to earn interest on funds that are not currently actively being used by the user.

# Examples

Skew You (https://github.com/Tburm/tracer-vault): Users can borrow against their options collateral, unlocking a whole new world of capital efficiency.

Possum (https://github.com/Possum-ONE): Fixed-income product that can turn every farm into two fix/variable pools. Based on the game model, fixed pool users can have guaranteed APY while the variable user gets higher APY with higher risk.

Bowtie (https://github.com/ShayanJa/bowtie_finance): Allows users to borrow against their options collateral.

Additionally, doing a GitHub search for Yearn functionality you are interested in implementing is a good way to find working code examples.

# Expectations

Here are some guidelines on how to maximize your chances of 'winning':

- Have your code well documented on GitHub.

- Have a frontend!

- If you created a contract, deploy them to a testnet and ensure your frontend properly interacts with them.

- Implement something interesting with your Yearn integration. Simply calling deposit() will not help your submission stand out!

# Resources

Yearn GitHub Organization: https://github.com/yearn/

Yearn V2 Documentation: https://github.com/yearn/yearn-vaults


Requirements

Overview of our vetting process

# Getting Started with Vaults and Strategies

## Requirements

Before you start, you will need to download and install the following requirements.

- git

- eth-brownie (https://eth-brownie.readthedocs.io/en/stable/)

- ganache (https://trufflesuite.com/ganache)

- Text editor (VS Code, Sublime Text, vim, others)

If you are focusing on a strategy, you have the choice of brownie and foundry template repos:

- brownie-strategy-mix (https://github.com/yearn/brownie-strategy-mix) repository.

- foundry-strategy-mix (https://github.com/storming0x/foundry_strategy_mix) repository.

If you want to integrate with our vaults:

- BaseRouter (https://github.com/yearn/yearn-vaults/blob/main/contracts/BaseRouter.sol)

- BaseWrapper (https://github.com/yearn/yearn-vaults/blob/main/contracts/BaseWrapper.sol)

## Overview of our vetting process

This is the short version of the vetting process for a new strategy.

- Code the strategy using brownie-strategy-mix (https://github.com/yearn/brownie-strategy-mix) repository

- Complete peer review by, at least, 2 other strategists

- Test in prod on ape.tax (https://ape.tax) with real funds

- Create a Due Diligence document for the protocol. Follow the example: SNX (https://hackmd.io/0w1RZh7DSc27A9EyzlHbJQ?view)

- Get the strategy approved by the Safe Farming Committee

- Complete review by one internal auditor (includes internal risk score)

- The strategy goes to prod

When the strategy has more than 3M-10M in TVL, it should improve it's risk score.

Risk-score (https://docs.yearn.fi/developers/security/risks/risk-score) dimension: 1=best, 5=worst.

- Improve risk score in dimensions like external audit, additional security reviews
Internal Risk Dashboard (https://yearn.watch/risk)

- A required way to improve team knowledge score is to create a committee of 3 people with deep knowledge monitoring the strategy 24/7

When it's passed 50M in TVL

- Audit by at least one reputable external audit company

- Recurring internal reviews

- External security assessments by experienced professional in security space

For more details, check the complete deployment process (https://docs.yearn.fi/developers/v2/DEPLOYMENT).


Deploying a Vault and Strategy V2

Deploying a Vault and Strategy V2

Requirements

Deploying a new Experimental Vault

Deploying a new Strategy

Test harvesting manually

Scaling up / Moving to Endorse

Publishing Your Strategy Description

Setting up Keep3r

References

Limits per Stage

Sharer contract

Health Checks

Adding Health Checks to your strategy

Health Check Operations

Customizing Health Checks

Ethereum Addresses

Fantom Addresses

Arbitrum Addresses

# Deploying a Vault and Strategy V2

Note: This private repo (https://github.com/yearn/chief-multisig-officer) is encouraged to create multiple scripts for governance and dev multisig execution of complex transactions.

## Requirements

Make sure you have the brownie environment set up before trying to deploy a vault. Check out the Readme MD in Yearn Vaults Repo (https://github.com/yearn/yearn-vaults/blob/master/README.md) for instructions.

The below instructions show some python commands that assume you are using the brownie console or a brownie script setup.

## Deploying a new Experimental Vault

-

Clone the Yearn Vaults Repo (https://github.com/yearn/yearn-vaults/) and run `brownie run scripts/deploy.py --network `

-

Choose the brownie account for deploying your vault. This account needs to have funds to pay for the deployment transaction.

-

Confirm the script is using the latest version of registry `v2.registry.ychad.eth` against the planned new release vault to be sure it's an updated version. (Can validate on Etherscan for latest address)

-

Select the version of the vault to deploy or press enter to use the latest release.

-

Enter `Y` when prompt to deploy Proxy Vault

-

Enter the checksummed address of the ERC20 token the vault will use.

-

Enter the vault Parameters (Below are some suggested values):

- Set your address or an address you control as governance.

- Set Treasury (`treasury.ychad.eth`) as the rewards address.

- Set Core Dev multisig (`dev.ychad.eth`) as guardian.

- Set Strategist multisig (`brain.ychad.eth`) as management.

- Set name and symbol for vault or use suggested as default (can be changed on-chain later).

-

Confirm the Parameters are correct and press `y` and ENTER to deploy the vault.

-

Check new vault has ABI setup on Etherscan (Some vault versions from older releases may have verification issues with Vyper and proxy detection on Etherscan, consider using later releases >0.3.5 to ensure verification works).

-

Set deposit limit according to the table below (https://docs.yearn.fi/developers/v2/DEPLOYMENT#limits-per-stage)

```
vault.setDepositLimit(limit)
```

- Set management fee to 0:

```
vault.setManagementFee(0)
```

- (Optional) Set governance to ychad.eth (`0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52`) if vault is planned to be endorsed soon:

- Note you can still make changes to the vault after setting governance up until governance is accepted

```
vault.setGovernance(ychad.eth)
```

## Deploying a new Strategy

- Request access to a Core Dev strategist and create a new issue using the `Strategy Review` template in the strategies private repo (https://github.com/yearn/yearn-strategies/issues) Complete all the fields.

- If the strategy targets a new protocol/new chain not currently approved by yearn (used in production) it may also require due diligence and path to production plan documents for the strategy to be considered for endorsement.
Example(s) SNX (https://hackmd.io/0w1RZh7DSc27A9EyzlHbJQ?view)

- Coordinate with Core Dev strategist for reviewing strategy

- Have it peer-reviewed by at least two strategists.

- Check if `want` token has a deployed vault already (>=v0.3.0) and coordinate to use that first if possible.

- Coordinate with a core developer to set a proper deposit limit and other settings for the new vault. See the table below: Limits per Stage (https://docs.yearn.fi/developers/v2/DEPLOYMENT#limits-per-stage).

- Deploy strategy and upload code to Etherscan for verification.

## Make the Vault and Strategy work together

-

Add strategy to vault (for vault code v0.3.3+):

```
strategy = '' # Your strategy addressdebt_ratio = 9800 # 98%minDebtPerHarvest = 0 # Lower limit on debt addmaxDebtPerHarvest = 2 ** 256 - 1 # Upper limit on debt addperformance_fee = 1000 # Strategist perf fee: 10%vault.addStrategy( strategy, debt_ratio, minDebtPerHarvest, maxDebtPerHarvest, performance_fee)
```

- `debt_ratio` should be `9800` if first strategy on vault.

- `rate_limit` is `0` unless there is reason for it to be different.

-

Set keeper:

```
strategy.setKeeper(keep3r_manager)
```

- `keep3r_manager` = `0x736D7e3c5a6CB2CE3B764300140ABF476F6CFCCF`

-

Set health check:

```
strategy.setHealthCheck(health_check)
```

- `health_check` = `0xddcea799ff1699e98edf118e0629a974df7df012`

NOTE: see section on health check (https://docs.yearn.fi/developers/v2/DEPLOYMENT#health-checks) for more details.

-

Set rewards:

```
strategy.setRewards(address)
```

- Read below (https://docs.yearn.fi/developers/v2/DEPLOYMENT#sharer-contract) if you want to use the sharer contract.

-

Run tests against "live" vault and strategy in mainnet-fork:

-

Harvest.

-

Profitable harvest.

-

Revoke strategy and check that funds return to the vault.

-

Increase/decrease debt + harvest, and check that the strategy is working well.

-

Migration.

-

Check that tokens in the strategy cannot be sweeped by dust collection.

-

Example: Hegic strat repo (https://github.com/Macarse/yhegic/tree/master/tests/development).

## Test harvesting manually

You can coordinate with the strategists if you need a UI to test.

-

Deposit some `want` tokens into the vault.

-

Do first `harvest` and make sure it worked correctly.

```
strategy.harvest()
```

-

Monitor `harvest` and `tend` triggers for first few days. Call `harvest`/`tend` manually.

-

If this is a new vault deployment, test deposit, withdraw, and transfer to ensure functionality is as expected.

## Scaling up / Moving to Endorse

In addition to the two strategist reviews, a Core Developer has to review the strategy before going into production.

-

Create an issue (https://github.com/yearn/yearn-finance-v3/issues) in yearn's web repo to ensure that the new vault won't create any problems with the API and that all necessary token/vault metadata is ready. Additionally, if this vault needs to go in the "labs" category, it must be manually added to the website.

-

Increase deposit limit according to the table below (https://docs.yearn.fi/developers/v2/DEPLOYMENT#limits-per-stage)

-

Set management fee to production level:

```
vault.setManagementFee(200)
```

-

Set parameters for vault correctly before endorsement:

- Set Governance to (`ychad.eth`)

- Set Treasury (`treasury.ychad.eth`) as the rewards address.

- Set Core Dev multisig (`dev.ychad.eth`) as guardian.

- Set Strategist multisig (`brain.ychad.eth`) as management.

- Set description and symbol for vault or use suggested as default (can be changed on-chain later)

-

Yearn's governance now must accept this vault's governance and endorse it:

```
strategy.acceptGovernance()registry.endorseVault(vault)
```

- If using a Curve voter stategy, make sure to approve the new strategy on yearn's voterProxy:

```
proxy.approveStrategy(gauge, strategy)
```

### Endorsing a vault from a previous release

-

Check for the latest release number in the registry contract

-

Check the apiVersion of the vault you want to endorse to identify the target release

-

Calculate the releaseDelta from your target release. (see registry endorseVault param details)
E.g: latestRelease = 0.3.3 and numReleases = 5. New vault apiVersion is 0.3.2
`releaseDelta = numReleases - 1 - releaseTarget`

-

Confirm using `registry.releases(uint256)` that your `targetRelease` has the same apiVersion as your vault.

```
releaseTarget = 3 # e.g vault api version 0.3.2releaseDelta = registry.numReleases() - 1 - releaseTarget # (5-1-3) = 1strategy.acceptGovernance() # from ychad.ethregistry.endorseVault(vault, releaseDelta) # from ychad.eth.
```

## Publishing Your Strategy Description

The following steps are required for all strategies. These descriptions are pulled into the v3 website and used to generate strategy diagrams.

- Create a pull request at this link (https://github.com/yearn/yearn-meta/tree/master/data/strategies) to add a new `.json` file with your strategy description and details.

- Using other strategy files as a reference, create a 1-2 sentence description for your strategy.

- The author field is optional.

## Setting up Keep3r

-

Adjust trigger variables until they are correct:

```
strategy.setProfitFactor()strategy.setDebtThreshold()strategy.setMaxReportDelay()
```

-

Set strategy's Keep3r role to v2-keeper-contract:

```
strategy.setKeeper(0x736D7e3c5a6CB2CE3B764300140ABF476F6CFCCF)
```

-

Create an add-strategy PR in Keep3r repo (https://github.com/yearn/yearn-keeper) (TBD)

## References

### Limits per Stage

These are the standard deposit limits per stage, and they can be adjusted on a case-by-case basis:

StageLimitExperimental$500KProduction$10M

### Sharer contract

"Sharer" is a contract for distributing/splitting strategist rewards. For boarding school graduates suggested split is 34% to strategist multisig and 66% to strategist – Sharer Contract (https://github.com/Grandthrax/Sharer).

- Set up rewards for your strategy by calling `sharer.addContributors`.

- Include devs if you forked someone else's strategy.

- Be sure to reward people who helped you.

- You can find the sharer here: 0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d (https://etherscan.io/address/0x2c641e14afecb16b4aa6601a40ee60c3cc792f7d)

### Health Checks

Since the v0.4.3 release, we have introduced the concept of Health Checks contracts to vaults and strategies. These are helper contracts that can validate the end state of a harvest, or critical transaction, to ensure the accounting stays within established safe parameters.

You can think of these contracts as on-chain unit tests, or "self asserts", ensuring that the end state of a critical transaction matches an expected condition. The design allows health checks to be configured per individual vault or strategy. If the "assert" doesn't match expectations, the entire transaction will revert and require manual intervention by strategists or core devs.

Vaults from release v0.4.3 and onward, support attaching an on-chain health check contract to be called after every harvest report.

## Note on Health Checks Backward Compatibility

The health checks are designed to be backward compatible. To target already deployed vaults, we released a patch for each tagged release of `BaseStrategy`. e.g:

v0.3.5 -> v0.3.5-1 (https://github.com/yearn/yearn-vaults/tree/v0.3.5-1) (compatible version)

## Adding Health Checks to your strategy

-

Before deploying a strategy with brownie-strategy-mix (https://github.com/yearn/brownie-strategy-mix) make sure your `brownie-config.yml` points to the correct patched vault version, to get a Health Check enabled `BaseStrategy` imported to your strategy.

-

To interact with the health check contract, no change should be necessary on your extended `Strategy` logic. IMPORTANT: Check your contract size to see if refactoring is needed for compilation.

-

Update your unit tests to set to the common Health Check contract health.ychad.eth (https://etherscan.io/address/0xddcea799ff1699e98edf118e0629a974df7df012)

```
commonHealthCheck = Contract(web3.ens.resolve(“health.ychad.eth”))strategy.setHealthCheck(commonHealthCheck)
```

- Test your normal harvest operations using mainnet-fork and unit tests to validate that the integration is working correctly.

## Health Check Operations

A global setting check against deviations in reported profit and losses within a safe interval. Any report/harvest that falls outside this global safe interval will report.

If a harvest/report revert transaction is detected on-chain, manual intervention is required to debug and accept the transaction into the vaults accounting. This should be done after proper validation by the strategist's multi-sig and Core Devs group.

Disabling health checks is meant to be a one-time special event using the following steps:

```
# disables next health check on harveststrategy.setDoHealthCheck(false, { account: brain.ychad.eth })# do harvest with profit/loss deviationstrategy.harvest()
```

After this manual harvest, the health check will be automatically enabled back for further harvests.

NOT RECOMMENDED: Health checks can be disabled permanently by setting the health check contract to address `0x0` in the Strategy Contract. This should be done only in extreme circumstances and if you know what you are doing.

## Customizing Health Checks

The Common Health Check Contract `health.ychad.eth` uses a global default setting for profit and loss.

It also supports setting specific profit/loss limit checks per strategy via the following operation:

```
strategy = ''; # strategy addressprofitLimit = 100 # in bpslossLimit = 100 # in bpshealthcheck.setStrategyLimits(strategy, profitLimit, lossLimit)
```

Finally, if needed, a custom Health Check contract can be deployed and attached to the standard Health Check contract, which works as a registry. You can attach a custom Health Check to a strategy using the following operation:

```
strategy = ''; # strategy addresscustomHealthCheck = '' # custom health check addresshealthcheck.setCheck(strategy, customHealthCheck)
```

Custom Health Check must follow the interface for custom health checks (https://github.com/yearn/yearn-vaults/blob/3bea2d8c070efeb05bc02d7d0136120bc516af4b/contracts/CommonHealthCheck.sol#L5)

### Ethereum Addresses

IdentityENSAddressV2 Registryv2.registry.ychad.eth0x50c1a2eA0a861A967D9d0FFE2AE4012c2E053804 (https://etherscan.io/address/0x50c1a2eA0a861A967D9d0FFE2AE4012c2E053804)Yearn multisig (daddy)ychad.eth0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52 (https://etherscan.io/address/0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52)Strategist multisigbrain.ychad.eth0x16388463d60FFE0661Cf7F1f31a7D658aC790ff7 (https://etherscan.io/address/0x16388463d60FFE0661Cf7F1f31a7D658aC790ff7)Core Dev multisigdev.ychad.eth0x846e211e8ba920B353FB717631C015cf04061Cc9 (https://etherscan.io/address/0x846e211e8ba920B353FB717631C015cf04061Cc9)Treasurytreasury.ychad.eth0x93A62dA5a14C80f265DAbC077fCEE437B1a0Efde (https://etherscan.io/address/0x93A62dA5a14C80f265DAbC077fCEE437B1a0Efde)Health Checkhealth.ychad.eth0xDDCea799fF1699e98EDF118e0629A974Df7DF012 (https://etherscan.io/address/0xDDCea799fF1699e98EDF118e0629A974Df7DF012)

### Fantom Addresses

IdentityAddressRegistry0x727fe1759430df13655ddb0731dE0D0FDE929b04 (https://oklink.com/fantom/address/0x727fe1759430df13655ddb0731dE0D0FDE929b04)Strategist multisig0x72a34AbafAB09b15E7191822A679f28E067C4a16 (https://oklink.com/fantom/address/0x72a34AbafAB09b15E7191822A679f28E067C4a16)Governance multisig0xC0E2830724C946a6748dDFE09753613cd38f6767 (https://oklink.com/fantom/address/0xC0E2830724C946a6748dDFE09753613cd38f6767)Treasury0x89716ad7edc3be3b35695789c475f3e7a3deb12a (https://oklink.com/fantom/address/0x89716ad7edc3be3b35695789c475f3e7a3deb12a)Health Check0xf13Cd6887C62B5beC145e30c38c4938c5E627fe0 (https://oklink.com/fantom/address/0xf13Cd6887C62B5beC145e30c38c4938c5E627fe0)

### Arbitrum Addresses

IdentityAddressRegistry0x3199437193625DCcD6F9C9e98BDf93582200Eb1f (https://arbiscan.io/address/0x3199437193625DCcD6F9C9e98BDf93582200Eb1f)Strategist multisig0x6346282DB8323A54E840c6C772B4399C9c655C0d (https://arbiscan.io/address/0x6346282DB8323A54E840c6C772B4399C9c655C0d)Governance multisig0xb6bc033D34733329971B938fEf32faD7e98E56aD (https://arbiscan.io/address/0xb6bc033D34733329971B938fEf32faD7e98E56aD)Treasury0x1DEb47dCC9a35AD454Bf7f0fCDb03c09792C08c1 (https://arbiscan.io/address/0x1DEb47dCC9a35AD454Bf7f0fCDb03c09792C08c1)Health Check0x32059ccE723b4DD15dD5cb2a5187f814e6c470bC (https://arbiscan.io/address/0x32059ccE723b4DD15dD5cb2a5187f814e6c470bC)