# Beanstalk APY Calculations

Providing APY estimates has been one of the most highly requested features to add to app.bean.money. Presenting accurate information remains a foremost priority. Accordingly, below is the complete methodology behind the various APYs.

For this document, some of the variables are copied from the whitepaper, but it is not an exact match.

## Simplest Assumptions

There is a near infinite number of inputs you can add into APY calculations (e.g., changing liquidity over time, entry and exit to and from the Silo, and changes in price or volatility).

In the interest of presenting the most honest data, no speculative inputs are included in the APY calculation. Only Historical Average Beans Per Season, which is based on real historical data, and current information, is used.

## Disclaimer

The APYs calculated according to the formulas below are very rough estimates based on previous and current information about Beanstalk.

There is no reason to believe historical data on the state of Beanstalk is any indication of the future state of Beanstalk. The accuracy of APY calculations are dependant on the accuracy of this assumption which, again, there is no reason to make.

## Historical Average Beans Per Season

The primary datapoints underneath the APY calculations are the average number of Harvestable Beans per Season $$\left(\bar{n}^h\right)$$ and the average number of Farmable Beans per Season $$\left(\bar{n}^f\right)$$.

The formulas for $$\bar{n}^h$$ and $$\bar{n}^f$$ take the following variables as inputs:

• $$u$$, the number of Seasons to average over;
• $$\Lambda_i$$, the number of LP tokens at a given Season $$i$$;
• $$n^f_i$$, the number of new Farmable Beans at a given Season $$i$$;
• $$n^h_i$$, the number of new Harvestable Beans at a given Season $$i$$; and
• $$t$$, the current Season.

We define the average number of Harvestable Beans minted per Season as:

$$\bar{n}^h = \Lambda_t \frac{1}{u} \sum_{i=t-u}^t \frac{n^h_i}{\Lambda_i}$$

We define the average number of Farmable Beans minted per Season as:

$$\bar{n}^f = \Lambda_t \frac{1}{u} \sum_{i=t-u}^t \frac{n^f_i}{\Lambda_i}$$

To calculate the 30-day APYs, $$u$$ is 720 as there are 720 Seasons in 30 days.

## Deposit APY

The 30-day APY for depositing Beans or LP into the Silo ($$APY^{Silo}_x$$) is determined by the value of 1 newly Deposited Bean or 1 newly Deposited LP (by Bean-denomated value) in 8760 Seasons (1 year).

The Deposit APY calculations make the following assumptions:

• No new Beans/LP are Deposited into or Withdrawn from the Silo;
• No liquidity is added or removed from the BEAN:ETH pool;
• There are $$\bar{n}^f$$ Beans minted to the Silo each Season; and
• Every depositor farms Grown Stalk each Season.

The formulas for $$APY^{Silo}_x$$ take the following additional variables as inputs:

• $$C_i$$, the total number of Seeds at a given Season $$i$$;
• $$K_i$$, the total number of Stalk at a given Season $$i$$; and
• $$x$$, the type of Deposit where
• $$x = 1$$ for Bean Deposits; and
• $$x = 2$$ for LP Deposits.

The formulas for $$APY^{Silo}_x$$ make estimations of the following variables:

• $$\hat{K}_{i}$$, the estimated total number of Stalk at a given Season $$i$$;
• $$\hat{C}_{i}$$, the estimated total number of Seeds at a given Season $$i$$;
• $$\hat{k}_{i}$$, the estimated number of a depositor's Stalk at a given Season $$i$$; and
• $$\hat{b}_{i}$$, the estimated number of a depositor's Deposited Beans at a given Season $$i$$.

$$APY^{Silo}_x$$ is calculated from the estimated number of Beans owned in a year ($$\hat{b}_{t+8760}$$) by using a sequence from the current Season $$t$$ to $$t+8760$$.

In order to calculate $$\hat{b}_{t+8760}$$, first initialize the sequence with:

$$\displaylines{\hat{C}_{t} = C_t \\ \hat{K}_{t} = K_t \\ \hat{b}_{t} = x \\ \hat{k}_{t} = 1}$$

Then, iterate through the following sequence for $$i \in\{u | u \in \mathbb{N}, t < u \leq t+8760$$}:

$$\displaylines{\hat{C_{i}} = \hat{C}_{i-1} + 2\bar{n}^f \\ \hat{b_{i}} = \hat{b}_{i-1} + \bar{n}^f\frac{\hat{k}_{i-1}}{\hat{K}_{i-1}} \\ \hat{k}_{i} = \hat{k}_{i-1} + \bar{n}^f\frac{\hat{k}_{i-1}}{\hat{K}_{i-1}} + \frac{1}{5000} \hat{b}_{i-1} \\ \hat{K}_{i} = \hat{K}_{i-1} + \bar{n}^f + \frac{1}{10000}\hat{C}_{i-1}}$$

Therefore, the we define $$APY^{Silo}_x$$ for a given $$x$$ and $$\hat{b}_{t+8760}$$ as:

$$APY^{Silo}_x = \frac{\hat{b}_{t+8760} - \hat{b}_t}{100}$$

## Pod APY

The 30-day APY for sowing Beans in the Field ($$APY^{Pod}$$) is determined by the estimated Seasons Until Pod Clearance ($$\hat{Z}_f$$).

The Pod APY calculations make the following assumptions:

• No liquidity is added or removed from the BEAN:ETH pool; and
• There are $$\bar{n}^h$$ Beans minted to harvest Pods each Season.

The formula for $$APY^{Pod}$$ takes in the following additional variables as inputs:

• $$D$$, the total number of Unharvestable Pods; and
• $$w$$, the current Weather.

We define $$\hat{Z}_f$$ as:

$$\hat{Z}_f = \frac{D+1+w}{\bar{n}^h}$$

Therefore, we define $$APY^{Pod}$$ as:

$$APY^{Pod} = \frac{8760}{\hat{Z}_f}w$$