# Equations

## Staking

$$
deposit = withdrawal
$$

Swaps between FAO and sFAO during staking and unstaking are always honoured 1:1. The amount of FAO deposited into the staking contract will always result in the same amount of sFAO. And the amount of sFAO withdrawn from the staking contract will always result in the same amount of FAO.

$$
rebase = 1 - ( faoDeposits / sfao Outstanding )
$$

The treasury deposits FAO into the distributor. The distributor then deposits FAO into the staking contract, creating an imbalance between FAO and sFAO. sFAO is rebased to correct this imbalance between FAO deposited and sFAO outstanding. The rebase brings sFAO outstanding back up to parity so that 1 sFAO equals 1 staked FAO.

## Bonding

$$
bond Price = 1 + Premium
$$

FAO has an intrinsic value of 1 DAI, which is roughly equivalent to $1. In order to make a profit from bonding, Dao.Finance charges a premium for each bond.

$$
Premium = debt Ratio \* BCV
$$

The premium is derived from the debt ratio of the system and a scaling variable called [BCV](https://docs.dao.finance/glossary#bcv). BCV allows us to control the rate at which bond prices increase.

The premium determines profit due to the protocol and in turn, stakers. This is because new FAO is minted from the profit and subsequently distributed among all stakers.

$$
debt Ratio = bondsOutstanding/faoSupply
$$

The debt ratio is the total of all FAO promised to bonders divided by the total supply of FAO. This allows us to measure the debt of the system.

$$
bondPayout\_{reserveBond} = marketValue\_{asset}\ /\ bondPrice
$$

Bond payout determines the number of FAO sold to a bonder. For [reserve bonds](https://docs.dao.finance/glossary#reserve-bonds), the market value of the assets supplied by the bonder is used to determine the bond payout. For example, if a user supplies 1000 DAI and the bond price is 250 DAI, the user will be entitled 4 FAO.

$$
bondPayout\_{lpBond} = marketValue\_{lpToken}\ /\ bondPrice
$$

For [liquidity bonds](https://docs.dao.finance/glossary#liquidity-bonds), the market value of the LP tokens supplied by the bonder is used to determine the bond payout. For example, if a user supplies 0.001 FAO-DAI LP token which is valued at 1000 DAI at the time of bonding, and the bond price is 250 DAI, the user will be entitled 4 FAO.

## FAO Supply

$$
FAO\_{supplyGrowth} = FAO\_{stakers} + FAO\_{bonders} + FAO\_{DAO} + FAO\_{pohmExercise}
$$

FAO supply does not have a hard cap. Its supply increases when:

* FAO is minted and distributed to the stakers.
* FAO is minted for the bonder. This happens whenever someone purchases a bond.
* FAO is minted for the FAO. This happens whenever someone purchases a bond. The FAO gets the same number of FAO as the bonder.
* FAO is minted for the team, investors, advisors, or the DAO. This happens whenever

  the aforementioned party exercises their pFAO.

$$
FAO\_{stakers} = FAO\_{totalSupply} \* rewardRate
$$

At the end of each epoch, the treasury mints OHM at a set [reward rate](https://docs.dao.finance/glossary#reward-rate). These FAO will be distributed to all the stakers in the protocol.&#x20;

$$
FAO\_{bonders} = bondPayout
$$

Whenever someone purchases a bond, a set number of FAO is minted. These FAO will not be released to the bonder all at once - they are vested to the bonder linearly over time. The bond payout uses a different formula for different types of bonds. Check the [bonding section above](https://docs.dao.finance/ecosystem/broken-reference) to see how it is calculated.

$$
FAO\_{DAO} = FAO\_{bonders}
$$

The DAO receives the same amount of FAO as the bonder. This represents the DAO profit.

$$
FAO\_{pohmExercise} = pFAO + DAI
$$

The individual would supply 1 pFAO along with 1 DAI to mint 1 FAO. The pFAO is subsequently burned.&#x20;

## Backing per FAO

$$
FAO\_{backing} = treasuryBalance\_{stablecoin} + treasuryBalance\_{otherAssets}
$$

Every FAO in circulation is backed by the Olympus treasury. The assets in the treasury can be divided into two categories: stablecoin and non-stablecoin.

$$
treasuryBalance\_{stablecoin} = RFV\_{reserveBond} + RFV\_{lpBond}
$$

The stablecoin balance in the treasury grows when bonds are sold. [RFV](https://docs.dao.finance/glossary#rfv) is calculated differently for different bond types.

$$
RFV\_{reserveBond} = assetSupplied
$$

For reserve bonds such as DAI bonds and FRAX bonds, the RFV simply equals the amount of the underlying asset supplied by the bonder.

$$
RFV\_{lpBond} = 2sqrt(constantProduct) \* (%\ ownership\ of\ the\ pool)
$$

For LP bonds such as FAO-DAI bonds, the RFV is calculated differently because the protocol needs to mark down its value. Why? The LP token pair consists of FAO, and each FAO in circulation will be backed by these LP tokens - there is a cyclical dependency. To safely guarantee all circulating OHM are backed, the protocol marks down the value of these LP tokens, hence the name *risk-free* value (RFV).
