# Safeguard Pool

## Safeguard parametersβ

The Safeguard Pool is designed to provide safety mechanisms to protect liquidity providers against extreme unexpected events, as outlined in the Security documentation and the v2 whitepaper.

At present, the Swaap Labs team's multisig governs these parameters. The authority to adjust individual parameters is granular and can be permanently revoked if needed. The parameters have preset limits that are determined when a pool is launched.

Here's an overview of the adjustable parameters and their configuration as of 10/10/2023:

**Allowed Token Imbalance**: This parameter prevents strategies that excessively expose the pool to one token reserve. At the time of writing it is set at 15% for most pools. This parameter can be modified by the Swaap Pool Control multisig, with a maximum of 20%.**Last look**: To account for potential delays between off-chain pricing and transaction validation, the Last Look parameter ensures that the pool does not underprice an asset below the indicated oracle prices. The initial allowed deviation is set to 1% for most pools. This parameter is controlled by the Swaap Pool Control multisig, with a maximum deviation of 3%.**Management Fees**: The initial management fees are set at 0%, with an upper limit of 5% annually.**Max drawdown circuit breaker**: This safety mechanism guards against harmful strategies, mistakes, or malicious acts. It disables trades if the latest pool's performance falls below the allowed threshold. The initial setting is 4% for most pools. This parameter is controlled by the Swaap Pool Control multisig, with a maximum of 5%.**Performance Update Interval**: Initially set at one day for most pools. This parameter is controlled by the Swaap Pool Control multisig, with an authorized range for the performance update interval between 0.5 to 1.5 days.**Signer**: This refers to the off-chain signer responsible for providing quotes. This parameter is controlled by the Swaap DAO multisig.

By adjusting these parameters, the Swaap Labs team ensures the implementation of robust safeguards within the Safeguard Pool to protect liquidity providers against unforeseen extreme events.

## Safeguard management feesβ

The safeguard pool implements a unique approach in fees collection. This management fee is a flat fee that depends on the pool's total supply, the elapsed time and the overall yearly fees (up to 5%).

Below is a technical description of how to derive the functions and how the fees are calculated based on total supply.

To expresses a flat and constant management fee rate we need to find a function y(t), that represents an LP's ownership of the pool, with the following properties: $\forall$ tβ, tβ β ββΊ βͺ {0} and $t_2 - t_1 = \Delta t$

Where:

- $t$ is the time such that $t_2 \ge t_1$
- $\Delta t$ is a constant time difference
- $y(t)$ is the pool ownership ratio of an LP at a given time ($0 \le y(t) \le 1$)
- $f$ are the fees accrued in $\Delta t$ ($0 β€ f < 1$)

The equation can be reordered to represent a homogeneous first-order difference equation. To satisfy the condition letβs consider an exponential function:

where $C$ and $a$ are constants. If we substitute result (2) in equation (1):

For $\Delta t$ = 1 year, $f$ will represent the yearly collectible fees and constant rate $a$ will be:

The collection of fees on the pools is done by minting pool tokens to the DAO to increase its pool ownership. This will dilute the pool share % that the LPs own, such that:

Where:

$TS(t)$ is the total pool token supply at time $t$

$MT(t)$ are the minted pool tokens at time $t$

For reference, equations $(4)$ and $(5)$ are implemented here.