Volatility Mitigation Mechanism
Last updated
Last updated
The Volatility Mitigation Mechanism is designed to reduce the risks associated with extreme price fluctuations in automated market makers (AMMs). Without proper controls, large token swaps can cause significant price slippage, leading to deviations from external market prices and disrupting liquidity pools.
And with the enhanced version of this formula set in the core of the AMM:
Where k is presenting a constant balance of assets. This structure leads to the problem of price regulation when big swaps of the tokens are able to cause extreme changes in the token prices and therefore decline pool price distributions from following the external markets and lead to the total elimination of the pool activity due to broken pool parameters.
The AMM pricing formula maintains a constant balance of assets (k), but large transactions can distort price distribution. If a pool’s reserves are small, a large trade can disproportionately affect pricing, causing severe deviations from the broader market and discouraging further participation.
For example:
Small Pool Reserves → Large swaps create significant price changes → Market instability
Large Pool Reserves → The same swap has minimal impact → Stable pricing
A mitigation algorithm is required to smooth price fluctuations and adjust dynamically to market conditions.
A regulation algorithm must adapt in such a manner that the first case could be blocked because of a big price impact and in the second case transaction would not be blocked considering price distribution before the reviewed one.
Step 1: Pre-Mitigation Verification
Before assessing mitigation conditions, the system checks: ✅ Liquidity Reserves – Ensures the pool has enough reserves to support the transaction. ✅ Slippage Check – Confirms that the expected price deviation remains within an acceptable range. ✅ Market Alignment – Compares the transaction price with external market trends to prevent major disparities.
Only transactions that pass these verifications proceed to the mitigation check.
Step 2: Mitigation Verification
The mechanism evaluates the "slice factor", which determines how much a transaction deviates from expected pricing. Key steps include:
Calculating Post-Transaction Reserves – Estimates liquidity levels after trade execution.
Defining Acceptable Price Margins – Creates a "tunnel" within which trades must occur to prevent price manipulation.
Adjusting Margins Dynamically – If limits are too broad, they can be tightened manually to maintain pool stability.
The system then compares the actual transaction price with the TWAP (Time-Weighted Average Price) estimate to measure deviation. If the deviation exceeds acceptable limits, the trade is rejected to maintain market equilibrium.
The mitigation mechanism takes transaction for verification if it successfully passed previous verifications and mitigation mechanism work is enabled. Verification of the transaction is based on finding the slice factor of the transaction, which requires a calculation of tokens out values with applied system fees to see how reserves after performing the transaction will look like.
and then calculates a slice factor curve using the formula:
This slice factor curve will estimate margins (limits) of price distribution (or forms a “tunnel” where transaction should be placed to pass the check, the principle is shown above), but in case if curve sets too high margins it is possible to reduce them to smaller window manually (estimated acceptable deviation for pool). After preparing “margins” to perform transaction verification it is required to find how the transaction deviates from the expected distribution. The algorithm calculates out a value that should have been placed in case the tokens would have been exchanged conform TWAP value:
After calculating TWAP-estimated out value, is calculated difference between the transaction-estimated out the value of the token and TWAP-estimated out value of the token:
The final check is in comparison of the found out value difference with the slice factor curve, conform the next principle:
After all, those verifications can be estimated if a transaction can pass and can be executed or should be declined.