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:

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:

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

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

\(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:

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

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 $$