# Flash Pool

Mechanisms of supply, borrow, insurance, and auction activities in different versions of Wing Flash Pool

## Incentives for Each Asset in Its Pool

This section is applicable for all Wing Flash Pools. However, the WING incentive distribution rates for each Flash Pool are different, you can find the details in the previous section.
First, the incentives for one asset will be allocated to Supply, Borrow and Insurance Pools with below ratios: Next, the specific tokens will be distributed with a fixed WING incentives distribution ratio.
Then, each other asset’s WING incentives distribution ratio will be based on the Competitive Distribution Model.
The followings are parameters for the Competitive Distribution Model when calculating the WING incentives distribution for each asset:
*Assume that the fixed supply WING incentive distribution ratio and fixed borrow WING incentive distribution ratio for a specific asset are both x%
Asset utilization rate = total borrowed amount / total supplied amount
WING base amount (of an asset) = valid borrowed amount * asset utilization rate
WING distribution ratio (of an asset) = base amount / sum of all assets' WING base amount
Supply WING distribution ratio (of an asset)= WING distribution ratio (of an asset) *[(1-10%)/2-x%]
Borrow WING distribution ratio (of an asset)= WING distribution ratio (of an asset) *[(1-10%)/2-x%]
This WING distribution ratio updates once a week.
Let's go through an example： Assume that the WING incentives to Flash Pool (Ontology) is 2073.6 WING/day. There are three assets with Amounts listed below in USD and one Insurance Pool (In this case, suppose the total borrowed amount for all assets is equal to its valid borrowed amount): Meanwhile, FLM has a fixed supply WING incentives ratio 1.5% due to the voting result, FLM’s fixed borrow WING incentives ratio is 1.5% as well. That is, x%=1.5%.
First, we calculate the WING distribution base of assets according to the Competitive Distribution Model: Therefore, the WING distribution ratio obtained by each asset Supply, Borrow and Insure are as follows: Then, the WING distribution amount per day obtained by each asset Supply, Borrow and Insure are as follows: ### Incentives for a Wallet Address

Last, say a user supplied pETH worth $100 and insured WING worth$100. Based on the process above, the WING incentives this user earned on the day is: $100/$200*232.2432+$100/$1000*207.3600= 32.3482 WING

## Supply, Borrow and Insurance

This section is applicable for all Wing Flash Pools. Here we take Flash Pool (Ontology) as an example.

### Supply and Borrow

Users cannot supply and borrow one type of asset at the same time. For instance, if a user supply pETH and ONTd, they can only borrow ONG, pwBTC, prenBTC, pUSDC, pDAI, pUSDT, psUSD, pNEO, pUNI, pYFI and WING. Borrowed amount of an asset will not exceed the supplied amount. A user cannot borrow or withdraw an amount that surpasses the asset liquidity.
The user needs to first supply at least one asset and agree to use it as collateral, then they can borrow other types of asset from the pool. Each asset has its Collateral Factor which decides the maximum amount the user can borrow when using this asset as collateral. For example, a user has supplied 100 pETH and each pETH is worth $4,000, then the user's borrow limit is 100 *$4,000 * 80% = 320,000. Collateral Factors of different assets are here.
Once a borrow action is successful, the borrowed asset will be deposited directly into the user's wallet and start generating interest immediately. The use of the asset is without limitations. In order to avoid liquidation caused by token price fluctuation, users are recommended not to borrow more than 80% of their borrow limit (using the 80% of Limit button).
If users want to earn WING incentives by borrowing assets, they must lock WING asset that is equivalent to 3% of their borrowed amount in the Pool. Otherwise their loans do not earn interest. Borrowed assets are calculated based on the Annual Percentage Rate (APR) paid by the borrower. Each block is a calculation cycle and the calculated interest will be summarized as the principal when the next block is calculated.
Users can repay loans at any time entirely or partially. Interest continues accruing for outstanding loans, and stops if the principal and interest are paid off. As Wing DAO's income, a certain percentage (Reserve Factor) of the total interest paid by the borrower will be deposited into the Wing DAO Community Fund.

### Rates and Interest

The interest is compounded on a block basis. The Annual Percentage Rate (APR) for the borrower is calculated with the Kink point model below:
Say Borrow APR is
$R$
. When the capital utilization rate is
$U$
, the corresponding APR is
$R_u$
. The capital utilization rate at the kink point
$k$
is
$U_k$
. The basic APR is
$R_0$
. The APR at the kink point is
$R_k$
. When the capital utilization rate is 100%, the APR is
$R_{100}$
.
$If$
$U
$R=R_0+U/U_k*R_k$
$If$
$U≥U_k:$
$R=R_0+R_k+(U-U_k)/(1-U_k)*R_{100}$
Supply APR = Borrow APR * Borrowed Amount / Supplied Amount * (1 – Reserve Factor)
See more related parameters here.
Borrow APY = (Borrow APR/365+1)^365-1
Supply APY = (Supply APR/365+1)^365-1
Interest is in proportion to assets of the user in the Supply or Borrow Pool against total amount of same assets in respective pools. After users repay the loan or withdraw the supply, they will repay or receive interests settled with the borrowed or supplied type of asset.
Let's walk through 2 examples to help with your understanding.
Example 1: A user has supplied 100 pETH to the pool, after which the total supply reaches 1,000 pETH. The total borrowed amount is 600 pETH. In this case:
Borrow APR =
$[1\%+(600/1,000)/80\%*7\%]\%=6.25\%$
Borrow APY =(Borrow APR/365+1)^365-1=6.45%
Supply APR =
$6.25\%*600/1,000*(1–15\%)=3.19\%$
Supply APY = (Supply APR/365+1)^365-1=3.24%
Daily interest earned by this user is 100 * 3.24%/365 = 0.0089 pETH
Example 2: A user has supplied 100 pETH to the pool, after which the total supply reaches 1,000 pETH. The total borrowed amount is of 900 pETH. In this case:
Borrow APR =
$1\%+7\%+[(900/1,000–80\%)/(1–80\%)]\%=58\%$
Borrow APY = (Borrow APR/365+1)^365-1=78.52%
Supply APR=
$58\%*900/1,000*(1–15\%)=44.37\%$
Supply APY = (Supply APR/365+1)^365-1=55.80%
Daily interest earned by this user is pETH 100 ∗ 55.80%/365 = 0.1529 pETH

### Liquidation

Once the ratio of repayment (principal + interest) of a loan to the borrow limit of a user is greater than or equals to 95%, the loan details will be displayed on the liquidation page. Once it exceeds 100%, this loan will be open to liquidators.
For example, if a borrower supplies 100 pETH at $4,000 each as collateral, and borrows 100,000 ONTd at$2. Later, pETH price drops to $3,000, and ONTd price goes up to$2.5. At this point, the borrow limit of the borrower is
, and the amount to be repaid is
(Here we omit interest for ease of understanding, but in real cases, repayment consists of principal and interest). Since
, this loan will be displayed on the liquidation page and liquidation starts.
All Wing DAO community members are eligible to become liquidators. Liquidators can acquire collateral assets by repaying loans at a certain discount (see liquidation bonus). After that, the borrower’s collateral and the amount to be repaid will be deducted accordingly. The maximum amount of collateral a liquidator can acquire is 80% of the total. A liquidator can choose to acquire 0% to 80% of the collateral. A liquidator can execute one or more liquidations for the same loan, once the ratio of repayment to borrow limit is below 95%, the loan will be removed from the liquidation page.
Let's continue with the above example. If a liquidator repays part of the borrower's loan using 80,000 ONTd and obtains the corresponding pETH collateral. The discounted pETH price for the liquidator is
, so the liquidator acquires
pETH. Now the borrower still has
$100–72.463=27.536$
remaining pETH , so their borrow limit is
.The liquidator has repaid 80,000 ONTd for the borrower, so the amount to be repaid (excluding interest) drops to
.Since
, this loan will be removed from the liquidation page.

### Insurance and Compensation

The Insurance Pool only accept WING assets supported by each Wing Flash Pool: Once insured, assets will be locked for 72 hours. Afterwards users will be able to withdraw assets at any time.
In the case that prices of collateral and borrowed assets change drastically, and the loan cannot be paid off even when all collateral is acquired, insurance compensation will be triggered.
If the borrower has locked WING assets for the borrowed assets to earn interest, the locked WING assets will be liquidated first. The rest of the repayment will be borne by insurers using WING assets they insured.
In the example mentioned above, if the borrower locked WING assets, the value should be
. If after all collateral is bought, the borrower still needs to repay 4,000 ONTd, the locked WING worth $6,000 will be paid to ONTd suppliers first. Next, Insurers will repay worth of WING to ONTd suppliers. If an insurer has insured$10,000, and the total assets in the insurance pool is worth $1,000,000. This insurer needs to afford , which means the insurer loses$40 worth of WING on this loan.

## Auction

Currently only partial income of Ontology based WING Pools will be auctioned monthly. The team is developing this feature for other pools, which is expected to be live at the same time. Please follow the Wing DAO community for schedule and details.
Users can only participate in auctions through ONTO Wallet.
Partial income of the Wing community fund is used to buy back WING token via public auctions. All WING obtained from auctions will be burned afterwards. 