# How It Works

## Summary

When you deposit into an insured farm you are depositing into an insured (“wrapped”) version of an existing bsc farm. Each farm is covered by NUTS collateral which pays out **automatically** to users if the underlying farm has any withdrawal issues (such as “rugs” etc.) which prevents users from recovering their deposits.

![Cake Farm deposits into Pancake’s CAKE pool to farm CAKE. Farmers receive bonus NUTS.](https://2376994564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MZDicYUHLybnRkuYzIf%2F-MZ_h-L9y_k83xShXtSh%2F-MZ_hO42ShfrDsEe_U49%2Ffarm.png?alt=media\&token=c0f070fc-f923-4c56-83f5-421a2b1fbf73)

### **Examples**

**Example #1**\
User deposits 10 CAKE into Cake Farm, they then unstake a day later & receive their 10 CAKE back. In this case no NUTS compensation is needed.

**Example #2**\
User deposits 10 CAKE into Cake Farm, but when they come to unstake PancakeSwap’s farm has lost their CAKE (e.g. rug or unintentional math issue). In this case the user is **automatically** compensated with NUTS to make up for the CAKE loss. The amount the user receives is up to 100% of their CAKE value (each Insured Farm has a NUTS allocation which would be split proportionally between depositors). As Squirrels TVL increases and it insures more farms, the amount of coverage on each farm will increase. See the roadmap!

The risk of covered BSC projects to “rug” or have unforeseen withdrawal issues is **low**, but Squirrel is providing the protection for those who value the extra safety.

## Protection

* Nefarious activities such as intentional "rugs" that steal your deposits.
* Bugs in the Farms, Vaults, or Smart Contracts that could accidentally lock your funds.
* All other cases that could prevent you from withdrawing your funds.

## Compensation Calculation

In the case that an insurance payout is made, the underlying assets may get incredibly volatile. To ensure fair pricing of the insured assets, Squirrel [TWAP's (Time Weighted Average Price) ](https://en.wikipedia.org/wiki/Time-weighted_average_price)the assets price over the last 24 hours using an oracle. Squirrel then multiplies each users covered amount (up to 100%, but not guaranteed to be 100%) by the TWAP'd price to obtain a dollar amount that is insured. Squirrel converts this to NUTS at the current market rate to determine each users compensation in NUTS.

### **Example**

* User deposits 100 of asset X with a stable price of \~$10.00
* X Farm "rugs" or has a bug that locks users funds
* X becomes volatile and crashes 80% in seconds
* The TWAP'd value of X is calculated as \~$9.90, even though X is trading at $2.00
* Squirrel determines the user is insured for 100 \* $9.90, or $990
* Current price of NUTS is $10
* **User receives 99 NUTS automatically and instantly**

## Volatility On Insurance Payout

NUTS themselves may become volatile upon an insurance payout. The supply of NUTS inflates by the total coverage paid out. If the TVL of NUTS remains relatively unchanged, the expected dividends per NUT will decrease by the inflation %. Volatility should be minimized as the platform matures and liquidity increases over time.

Users that were insured may choose to sell their NUTS immediately or choose to hold onto them and farm them for dividend payments. A payout may add downward pressure on price, **however** users who receive NUTS may infact decide to buy more as they gain more faith in the platform and want to invest in the future of Squirrel. Additionally the TVL may increase as new users move funds over from other platforms who want the insurance Squirrel offers.

