🧠

# Equations

### Staking

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

### Minting

$mintPrice = 1 + Premium$
​$TOP has an intrinsic value of 1 USDC, which is roughly equivalent to$1. In order to make a profit from minting, Top Fi DAO charges a premium for each mint.
$Premium = debtRatio * 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 mint prices increase.
The premium determines profit due to the protocol and in turn, stakers. This is because new $TOP is minted from the profit and subsequently distributed among all stakers. $debtRatio = mintsOutstanding/TopSupply$ ​The debt ratio is the total of all$TOP promised to minters divided by the total supply of $TOP. This allows us to measure the debt of the system. $mintPayout_{reserveMint} = marketValue_{asset}/ mintPrice$ Mint payout determines the number of$TOP sold to a minter. For reserve mints, the market value of the assets supplied by the minter is used to determine the mint payout. For example, if a user supplies 1000 USDC and the mint price is 250 USDC, the user will be entitled 4 $TOP. $mintPayout_{pMint} = marketValue_{lpToken} / mintPrice$ For liquidity mints, the market value of the LP tokens supplied by the minter is used to determine the mint payout. For example, if a user supplies 0.001 TopG-USDC LP token which is valued at 1000 USDC at the time of minting, and the mint price is 250 USDC, the user will be entitled 4$TOP.

### $TOP Supply $Top_{supplyGrowth} = Top_{stakers} + Top_{minters} + Top_{DAO }$ •$TOP is minted and distributed to the stakers.
• $TOP is minted for the minter. This happens whenever someone purchases a bond. •$TOP is minted for the DAO. This happens whenever someone purchases a bond.
• The DAO gets a proportional number of $TOP to the minter. $Top_{stakers}= Top_{totalSupply} * rewardRate$ At the end of each epoch, the collateral pool mints$TOP at a set reward rate. These $TOP will be distributed to all the stakers in the protocol.​ $Top_{minters = }mintPayout$ Whenever someone purchases a mint, a set number of$TOP is minted. These $TOP will not be released to the minter all at once - they are vested to the minter linearly over time. The mint payout uses a different formula for different types of mints. Check the minting section above to see how it is calculated. ### Backing per$TOP

$TopG_{backing} = collateral poolBalance_{stablecoin} + collateral poolBalance_{otherAssets }$
Every $TOP in circulation is backed by the Top Fi DAO collateral pool. The assets in the collateral pool can be divided into two categories: stablecoin and non-stablecoin. $collateral poolBalance_{stablecoin} = RFV_{reserveMint}+ RFV_{lpMint}$ The stablecoin balance in the collateral pool grows when mints are sold. RFV is calculated differently for different mint types. $RFV_{reserveMint} = assetSupplied$ ​For reserve mints such as USDC mint, the RFV simply equals to the amount of the underlying asset supplied by the minter. $RFV_{lpMint}= 2sqrt(constantProduct) * (percentOwnership of the pool)$ For LP Mints such as Top-USDC mint, the RFV is calculated differently because the protocol needs to mark down its value. Why? The LP token pair consists of$TOP, and each $TOP in circulation will be backed by these LP tokens - there is a cyclical dependency. To safely guarantee all circulating$TOP are backed, the protocol marks down the value of these LP tokens, hence the name risk-free value (RFV).​