> For the complete documentation index, see [llms.txt](https://voyage.gitbook.io/voyage/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://voyage.gitbook.io/voyage/depeg-protection/formula-and-parameters.md).

# Formula & Parameters

To determine when an asset is off-peg and initiate the swap, the protocol uses the following formula:

$$
Depeg Status = (\frac{|(Market Price - Peg Price)|}{Peg Price})
$$

Where:

* Market Price is the current price of the stablecoin or ETH-pegged asset on the open market.
* Peg Price is the intended stable price of the asset (e.g., $1 for USD-pegged stablecoins or a 1:1 ETH peg).

If the Depeg Status exceeds a predefined threshold (for instance, 2%), the asset is considered off-peg. The threshold can be customized based on the asset class and volatility expectations.

Example:

* For a USD-pegged stablecoin: Peg Price = $1.00. If the market price drops to $0.97, then:

$$
Depeg Status = (\frac{|(0.97 - 1.00)|}{1.00} = 3%)
$$

In this case, the Depeg Status exceeds the 2% threshold, triggering the swap mechanism to move funds out of this stablecoin pool into a safer option.
