Derify Protocol Documents
English
Search…
⌃K

# Other

## How is the system net profit and loss being calculated?

The system net profit and loss are the difference between the sum of all users' margin balance and the balance of system liquidity pool (all users' accumulated deposit - all kinds of fees - funds withdrawal). For example, the sum of all users' margin balance is 1.1 million BUSD, which means the total money users are supposed to have. If the liquidity pool has a balance of 1 million BUSD, the system has a net loss of 100,000 BUSD while users have net profit. If the liquidity pool has a balance of 1.1 million BUSD, the system has a net profit of 100,000 BUSD while users have net loss.
The system net profit and loss is mainly caused by naked positions and derivative price changes.

## If the system has a net loss, how can 100% of the user's funds be redeemed?

When there is a net loss in the system, if the user withdraw money, it will calculate how much the user should share the net loss of the system, and the share of system net loss will be paid by the insurance pool. If the insurance pool doesn't have enough balance, bToken will be issued for redemption.
For example, the system liquidity pool has a balance of 1 million BUSD, the sum of all users' margin balance is 1.1 million BUSD. Obviously, the system has a net loss of 100,000 BUSD. At the same time, Alice tried to withdraw 1100 BUSD, then she would bear the system net loss of 1100 * (1 - 1,000,000/1,100,000) = 100 BUSD. This allocation is paid by the insurance pool and bonds, and the rest is paid by the liquidity pool. The shared loss is paid by the insurance pool and bonds, and the rest is paid by the liquidity pool.

## Where does the money of insurance pool come from? What is the mechanism behind?

The source of funds for the insurance pool: 40% of the trading fee, the income of invalid brokers (30% of the trading fee), the remaining margin of liquidation, and users' net loss sharing, etc. The insurance pool is mainly used for the net loss (if any) of the redemption system when users withdraw cash. The insurance pool is mainly used to redeem the system net loss when users withdraw money.
For Example,
The system liquidity pool has a balance of 1 million BUSD, the sum of all users' margin balance is 1.1 million BUSD. Obviously, the system has a net loss of 100,000 BUSD. At the same time, Alice tried to withdraw 1100 BUSD, then (1,100 * 1,000,000/1,100,000) = 1000 BUSD is paid by the liquidity pool, and the remainder is paid by the insurance pool.
On the contrary, if the system liquidity pool has a balance of 1.1 million BUSD, the sum of all users' margin balance is 1 million BUSD, then the system has a net profit of 100,000 BUSD. If someone tried to withdraw 1,000 BUSD, then the liquidity pool redeems that 1,000 BUSD, and at the same time, an additional 100 BUSD will be injected into the insurance pool. For details, please check https://derify.medium.com/how-does-the-insurance-pool-in-derify-works-c8887ceda8c5

## Where does the money come from (buyback fund)? Why does the insurance pool have positive balance but the balance of buyback fund is 0?

The buyback fund is originated from the overflow of the insurance pool. The calculation formula is, buyback fund = x * MAX(0, insurance pool balance - MAX(sum of users net profit or loss, 0)) [x∈[0, 100%]，adjustable parameter]. When the balance of insurance pool is positive, but the system net loss is greater than the balance of the insurance pool, 100% of the funds in the insurance pool will be used to redeem system loss, and will not be used for \$DRF buyback.
For example,
scenario 1: The balance of insurance pool is 1,000 BUSD. The system net loss is 1,200 BUSD. The balance of buyback fund is 0 BUSD.
scenario 2: The balance of insurance pool is 1,000 BUSD. The system net profit is 400 BUSD. The balance of buyback fund is 1000 * 20% = 200 BUSD.
scenario 3: The balance of insurance pool is 1,000 BUSD. The system net loss is 300 BUSD. The balance of buyback fund is (1000 - 300) * 20% = 140 BUSD.

## What are the rules of \$DRF buyback and burn? Why is it designed this way?

When the buyback fund has a positive balance, a price snapshot of \$DRF will be taken every Monday at UTC 00:00 (price discovery -- PancakeSwap). If the \$DRF price in current week is higher than the snapshot price (last Monday), the buyback action will not be initiated; If the price of the current week is lower than the snapshot price (last Monday), the buyback contract is activated. The buyback execution will stop until the buyback fund is depleted or the price of \$DRF is higher than the snapshot price (last Monday). Those bought back \$DRF will be automatically sent to the black hole for burning.
For example,
Scenario 1: The balance of buyback fund is 1,000 BUSD. The price of \$DRF at UTC 00:00 on Monday is \$0.1, and the price of \$DRF last Monday was \$0.08. No buyback. Buyback fund remains in the insurance pool.
Scenario 2: The balance of buyback fund is 1,000 BUSD. The price of \$DRF at UTC 00:00 on Monday is \$0.1, and the price of \$DRF last Monday was \$0.11. Buyback started. If the price of \$DRF from \$0.1 back to \$0.11 only cost \$500, then only 500 BUSD will be used for buyback, and the remaining funds will remain in the insurance pool.
Scenario 3: The balance of buyback fund is 1,000 BUSD. The price of \$DRF at UTC 00:00 on Monday is \$0.1, and the price of \$DRF last Monday was \$0.11. Buyback started. If the price of \$DRF is still lower than \$0.11 after the 1000 BUSD buyback, 100% of the buyback fund will be used.
The reason behind designing the buyback rules is that on the one hand, the buyback fund can purchase \$DRF at a relative lower price, and the amount of \$DRF buyback and burn can be increased. On the other hand, this can inform users that the buyback will be started at a certain point, then the user will have the expectation that the token price will go up, and thus buy \$DRF in advance. After users buy in \$DRF, the price of \$DRF goes up, which may be higher than the price in last week. Then the buyback will not be activated. This supports the token price due to users buying power, and as a consequence, improve the capital efficiency of the buyback fund.