# Equations

## Staking

$deposit = withdrawal$
Swaps between BLKD and sBLKD during staking and unstaking are always honored 1:1. The amount of BLKD deposited into the staking contract will always result in the same amount of sBLKD. And the amount of sBLKD withdrawn from the staking contract will always result in the same amount of BLKD.
$rebase = 1 - ( BLKDDeposits / sBLKD Outstanding)$
The treasury deposits BLKD into the distributor. The distributor then deposits BLKD into the staking contract, creating an imbalance between BLKD and sBLKD. sBLKD is rebased to correct this imbalance between BLKD deposited and sBLKD outstanding. The rebase brings sBLKD outstanding back up to parity so that 1 sBLKD equals 1 staked BLKD.

## Bonding

Bonding happens by allowing users to purchase a bond. This bond price is the bond price.
$bond Price = 1 + Premium$
BLKD has an intrinsic value of 1 DAI, which is roughly equivalent to \$1. In order to make a profit from bonding, Blk Finance charges a premium for each bonding action.
$Premium = debt Ratio * BCV$
The premium is derived from the debt ratio of the system and a scaling variable called 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 BLKD is bonded from the profit and subsequently distributed among all stakers.
$debt Ratio = bondsOutstanding/BLKDSupply$
The debt ratio is the total of all BLKD promised to bonders divided by the total supply of BLKD. This allows us to measure the debt of the system.
$bondPayout_{reserveBond} = marketValue_{asset}\ /\ bondPrice$
Bond payout determines the number of BLKD sold to a bond holder. For reserve bonds, the market value of the assets supplied by the bond holder 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 BLKD.
$bondPayout_{lpBond} = marketValue_{lpToken}\ /\ bondPrice$
For liquidity bonds, the market value of the LP tokens supplied by the bond holder is used to determine the bond payout. For example, if a user supplies 0.001 BLKD-ETH 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 BLKD.

## BLKD Supply

$BLKD_{supplyGrowth} = BLKD_{stakers} + BLKD_{bonders} + BLKD_ {DAO}$
BLKD supply does not have a hard cap. Its supply increases when:
• BLKD is bonded and distributed to the stakers.
• BLKD is bonded for the bonder. This happens whenever someone purchases a bond.
• BLKD is bonded for the DAO. This happens whenever someone purchases a bond. The DAO gets the same number of BLKD as the bonder.
$BLKD_{stakers} = BLKD_{totalSupply} * rewardRate$
At the end of each epoch, the treasury bonds BLKD at a set reward rate. These BLKD will be distributed to all the stakers in the protocol.
$BLKD_{bonders} = bondPayout$
Whenever someone purchases a bond, a set number of BLKD is bonded. These BLKD will not be released to the bond holder 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 to see how it is calculated.
$BLKD_{DAO} = BLKD_{bonders}$
The DAO receives the same amount of BLKD as the bond holder. This represents the DAO profit.

## Backing per BLKD

$BLKD_{backing} = treasuryBalance_{stablecoin} + treasuryBalance_{otherAssets}$
Every BLKD in circulation is backed by the community treasury. The assets in the treasury can be divided into two categories: stablecoin and non-stablecoin.
$treasuryBalance_{stablecoin} = BackingPerBLKD_{reserveBond} + BackingPerBLKD_{lpBond}$
The stablecoin balance in the treasury grows when bonds are sold. Backing per BLKD is calculated differently for different bond types.
$BackingPerBLKD_{reserveBond} = assetSupplied$
For reserve bond such as DAI bonding, the Backing per BLKD simply equals to the amount of the underlying asset supplied by the bond holder.
$BackingPerBLKD_{lpBond} = 2sqrt(constantProduct) * (\%\ ownership\ of\ the\ pool)$
For LP Bonds such as BLKD-ETH Bonding, the Backing Per BLKD is calculated differently because the protocol needs to mark down its value. Why? The LP token pair consists of BLKD, and each BLKD in circulation will be backed by these LP tokens - there is a cyclical dependency. To safely guarantee all circulating BLKD are backed, the protocol marks down the value of these LP tokens.