# AMM Deep Dive 2/3 — Model Optimization

# TL;DR

**Based on our selected AMM parameters, we end up with an average 5% rejection rate, together with 0.06% DV01/TVL, 0.96% daily VaR% with average annualized ROI% at 314.7% for our Strips AMM.**

# AMM Parameters

*In this section, we introduce all the parameters and factors that will be critical to the AMM’s efficiency and robustness. Followed by the section **Data & Assumption** and **Evaluation Matrix**, we will dive deep into the performance matrix of 216 combinations of the following AMM parameters that influences the profitability and stability of the Strips AMM.*

Liquidation level will be chosen between (3.5%, 5%), in the section **Evaluation Matrix**, we will discuss if we should apply higher liquidation level for stressed market condition.

Initial price haircut will be chosen from (50%, 70%, 90%). This parameter is to judge the sensitivity of AMM’s profitability to the setting of the initial market rate.

Traders’ initial preference to long or short: we simulate under 3 scenarios which are: (1) more traders are trying to long (e.g. leveraged yield farmers) (2) traders are balanced, and (3) more traders are trying to short (e.g. hedgers). In the section **Evaluation Matrix**, we will find out how AMM’s profitability will be impacted by each imbalanced skew of trader profiles.

Style factors: we also want to find out if the AMM’s profitability is tested by market styles between momentum and reversal.

- Reversal traders are more likely to long when market fixed rate < initial haircut · oracle APY%. This indicates when market fixed rate is deeply in discount, for example, 300% APY with fixed rate of 100%, then traders will try to capture the divergence between market fixed rate and oracle APY. A reversal market sentiment reflects that people care more about locking in funding PnL and capture value of 200% passive income.
- Neutral means market is balanced and finds its equilibrium between fixed and floating rate.
- Momentum means traders would continue to short when market fixed rate < initial haircut · oracle APY%. This indicates people still want to short even when market fixed rate is deeply discounted compared to floating rate. A momentum market sentiment reflects that people care less about value capture from funding PnL. Instead, people prefer to speculate on directional move, driven by Long/Short skew to boost their returns from trading PnL.

Integrity Check: we need to limit the risk of AMM. First, we need to reflect the staking liquidity that is available to AMM after considering the liability. At each block, smart contract will always know the amount of unpaid debt which is represented by Unrealized PnL of AMM. When it is unrealized loss, then we will add the negative number of Unrealized PnL to remaining staking liquidity to reflect lower capacity of AMM. In addition, if AMM only has staking liquidity of $10m, then it is very unreasonable for AMM to have a net position for $10bn, even AMM is making money from existing positions. Therefore, we will also restrict AMM’s net exposure:

# Dataset & Assumptions

*In this section, we used lending rate from aave, cream-finance, compound, definer and dydx from Feb 15, 2021 until Aug 3, 2021 for historical back-testing purpose. We also created a stressed dataset with the same size. In addition, we will discuss all the assumptions used for stakers and traders’ activities.*

Initial staking liquidity will be $2,000,000, with $400,000 provided across 5 markets. We also set $1 million for insurance pool.

- LP token price in our simulator is a function of AMM profitability. At each period of time, we allow STRP price to appreciate or depreciate with the same percentage as of average profit growth% across all AMM markets.

- To further introduce the effect of market beta, we apply BTC history as a multiplier such that if BTC price drops 5%, STRP price will drop 5%, assuming STRP’s beta = 1. We understand such simulation is very naive by assuming STRP beta to be 1 and by assuming STRP price is a linear function of AMM profit growth. In the future, once we have real market data after main-net launch, we can conduct more in-depth research.

Stakers: we assign probability of various staking activities such as staking more, unstaking, etc. The probability distribution shifts when staking profit growth is higher than holding profit growth. Otherwise, if impermanent loss is too high, it is unreasonable to assume that people will hold STRP-USDC LP tokens and stake in Strips:

- When staking profit growth cannot compensate for the price difference between STRP and STRP-USDC LP tokens, we will reduce the probability of staking and increase the probability of unstaking.
- If unstaked, we assume the unstaker will also unstake on SushiSwap by burning the LP tokens. Whether selling STRP or holding STRP after burning will be a fair random draw.

We understand in reality, it won’t be 100% conversion between staking on SushiSwap and use STRP-USDC LP tokens to stake on Strips, but in our simulation, we assumed 100% correlation between staking on SushiSwap and staking on Strips, because Strips provides **excess income** to compensate for the impermanent loss:

- Trading fee denominated in USDC
- Realized profit denominated in USDC
- LP token profit from other early unstakers’ penalties together with free STRP tokens as rewards

After traders and stakers receive STRP rewards, we also assume they will re-stake, hold, or sell STRP with certain probability distribution.

Traders: we assign probability of various trading activities such as: open, close, add collateral, etc. The probability of trading actions will be directed by market styles and initial preferences, described in section **AMM Parameters**.

The average standard deviation of historical data-set is only 3.95 while the average standard deviation of the stressed data-set is 35.7 which is unlikely to happen, but in such case we still want to validate if AMM and Insurance pool are robust enough to survive during 10-sigma events.

# Evaluation Matrix

*In this section, we judge its overall performance, sharpe (risk adjusted return), frequency and magnitude of drawbacks of AMM profits.*

In short, perpetual IRS introduces 2 main benefits

- First, perpetual IRS AMM would be robust regardless of underlying APY% level and volatility and its profitability will remain at level no worse than fixed term 1yr IRS AMM.
- Second, perpetual IRS AMM enable traders to enjoy higher return with reasonably stable underlying market. Traders are not forced to choose highly volatile and high yield markets to avoid higher trading fee. More details will be released in Trader Manual in the future.
- Perpetual IRS allows traders to create more diverse trading strategies and risk diversification.

Our model optimization is based on z-score of AMM comprehensive performance (ROI, Sharpe, peak-trough magnitude, drawback frequency, etc.). Due to length, we won’t be able to show the full details in this article, but we will give some examples of how we compare AMM’s performance under different market conditions and evaluate the synergy created by combinations of different AMM parameters.

Example #1 (integrity check): if the trade is helping AMM to reduce its directional net exposure, shall we relax the threshold on integrity check and approve more trades?

- Left is “approve” and right is “reject”. We can see that relaxing the threshold will help AMM avoid some sharp drawbacks (left). In contrast, if AMM reject trades regardless of traders’ side of transaction, then it will take longer time to recover from directional trend in market (highlighted in blue circle).
- For example, when more traders try to long when fixed rate is in deep discount, AMM will be forced to take on short positions when market fixed rate moves upward due to leveraged yield farmers. AMM can alleviate the situation by
*not*rejecting*large short*trades. - However, we cannot make the decision only by judging one parameter’s independent effects. We also need to see how it plays its role together with other parameters.

- Example #2 (initial haircut): when underlying markets are low yield and low volatility: shall we set initial haircut at very low level or not? By looking at green line in right chart, we can tell if we set initial haircut too low, AMM will be vulnerable when market is reversal sentiment and traders are skewed to short initially.

- Example #3 (initial haircut): when underlying markets are high yield and high volatility: shall we set initial haircut at very low level or not? By comparing the range in left chart ($10m, $20m) with the range in right chart ($6m, $14m), we know choosing a too-low initial fixed price significantly hinder the profitability of AMM, when underlying markets are high yield and high volatility.

We understand (f+g)(x) =/= f(x)+g(x) unless it is an abelian group. **Similarly, while parameters A and B separately might lead to better AMM performance, but together can still lead to undesirable results. **Below shows an example of 2 parameters combined and its effects on AMM performance.

## Low Yield Low Volatility

- Example #4: If we compare top left (with a few large drawbacks and AMM has loss 3 times) with top right(AMM never has loss and higher maximum), and compare bottom left (AMM loses money many times and largest loss at -$2m) with bottom right (AMM only has few small losses and much higher profit range), then we find that non-directional integrity check is dominantly better than directional integrity check. This contradicts the observation we had in Example #1 and this is because we picked a different initial fixed price level.
**Therefore, when we perform model optimization, we are not choosing AMM parameters based on local optima of each parameter, instead we approach the global optima after considering the synergies derived from all parameters combined.**

## High Yield High Volatility

# Risk Analysis

*In this section, we will discuss how Strips will measure its overall risk levels, based on selected parameters discussed in previous section **AMM’s Parameters** and **Evaluation Matrix**. We will evaluate systemic risks in terms of DV01, DV01 as a percentage total staking liquidity, empirical VaR%, as well as Extreme Value Analysis. In addition, we will discuss how Strips will adjust AMM parameters as a function of underlying markets’ volatility and traders’ activities.*

- First, DV01 indicates the amount that Strips’ net income in USDC value will change, for every 1 basis point (0.01%) of change in market fixed rate. On daily basis, Strips’ AMM across 5 markets have DV01 of $3,411, which means for every 0.01% of move in 5 markets, AMM will make or lose $3,411 USDC.
- Among all market conditions, momentum market condition leads to highest DV01 of $3,641, because AMM tend to be more sensitive to underlying market fixed rate move when traders’ are skewed to one side. Not surprisingly, when market is balanced, average DV01 is lowest at $3,294 only. Strips’ DV01 is also sensitive to traders’ initial preference. When traders tend to long (more leveraged yield farmers), then Strips has the lowest DV01 average at $2,466. When traders tend to short, then Strips has the highest DV01 average at $4,383, which is as twice of long-heavy markets. This is because AMM will tend to accumulate larger net exposure from the initial market fixed rate until it finds its equilibrium.
- If we take the absolute value on DV01 level, then it is the opposite: reversal markets ($5,786) and long-heavy markets ($5,948) yield higher absolute DV01 level. This is because under these markets, AMM is more likely to random walk with a mean at low level, because traders tend to flip their sign and arbitrage between floating rate and fixed rate. Under such condition, AMM’s DV01 level is like a swing between positive and negative numbers. If we flip the sign of short duration, then AMM shows higher average level of DV01 in absolute terms.

- As expected, under high yield high volatility markets, average DV01 across all markets is 687 only, which is about 1/10 , and this is because the underlying market floating rate for HYHV markets is about 10× of LYLV markets. As a result, for perpetual IRS, duration is dampened by 1/10 .

- DV01% of total staking liquidity is constantly below 0.03% and peaked at 0.06%. To judge whether this utilization level is high or low, we can compare with DV01% of AUM (asset under management) in hedge funds. Our team’s experience working at $1bn+ macro hedge funds gives us some clues. We have witnessed a macro hedge fund with $5 million DV01 under an AUM of $2 billion, which translates to a DV01% of 0.25%. With a sharp move in JGB (Japanese Government Bonds) of 1.2% to 2%, 80bps move led to loss of $400 million and liquidation of the hedge fund (-20% loss).
- Therefore, 0.25% of DV01% is considered extremely risky in traditional finance, but does it mean 0.06% is extremely low in DeFi? This is not necessarily true, because in DeFi, there are no central banks providing the liquidity of last resort, so underlying APY% can be much more volatile than interest rates in Trad-Fi, and hence we also need to judge VaR% level based on empirical simulated data.

We plot daily returns% of Strips under each market condition for selected parameters, with total data sample size of 1530. We can find there are certain “fat tails” on downside for momentum market conditions.

- Based on empirical simulated results from selected AMM parameters, the worst 5% daily return is -0.947%, compared to normal distribution at -0.96%. As shown in left chart, overall the distribution is close to normal distribution with small skew to downside tails.

- At 95% confidence level: Strips’ daily VaR% is 0.96%, which is lower than hedge funds at 1–2%. This doesn’t mean Strips is taking too little-risk, since hedge funds tend to take directional bets while Strips AMM makes money from trading fees and slippage.
- Compared to banks (monthly VaR level is typically 1–2%), Strips’ monthly VaR% is slightly higher, but this is because banks usually use inter-broker market to reduce its DV01.

## Dynamic Decision-Making

**Based on our selected AMM parameters, we end up with average 5% rejection rate, together with 0.06% DV01, 0.96% daily VaR% with average annualized ROI% at 314.7%. In reality, these parameters will not be fixated permanently.**

- If risk level is too high, then Strips should change parameters such as integrity check level to reject more trades.
- If rejection rate is too high while we don’t see any pickup in risk level across all AMM markets or uptick in volatility level of floating and fixed rates, then we should increase bandwidth of integrity check level to on-board more trades.
- In simulation, we linearly aggregate DV01 across all markets which is a naive assumption. In reality, we we also need to consider covariance matrix of all underlying markets. For example, market A moving 1% higher always corresponds with market B moving 1% lower, and then total DV01 will be lower because market A and B are negatively correlated.
- In addition, for a single market, if we launch both fixed term IRS and perpetual IRS, total DV01 is also affected by term structure, such as term premium between 1yr-IRS and perpetual IRS.
- We believe Strips’ risk measures should be reflected as a function of sigma of underlying market rates, both fixed and floating: f(σ(Yt , Ot)).
- In conclusion, AMM parameters decides dynamic relations between rejection rate, risk level, and marginal income. For example, we can choose to make extra $2 million a year by reducing rejection level below 2%, but the business might only last for 10 years. Instead, we can also choose to make $2 million less a year by increasing rejection level above 7%, but the business can last for 30 years.

## Extreme Value Analysis

- To evaluate the fat tail risks, we will apply Extreme Value Theory, which is a statistical theory concerning extreme (downside) values: values occurring at tails of a probability distribution. In our analysis, for example, we used GEV, GLO, etc. We can use either Block Maxima (BM) or Points above a Threshold (PoT) to define extreme values. In our analysis, we use BM method by choosing the minimum daily return% across all market conditions.
- Strips team will build up the model for constant risk monitoring and leave the decision to the DAO eventually.

- There are several tests available to select the best distributions. Here we used the Kolmogorov Smirnov(KS) test.
- If the K-S statistic is small or the p-value is high, then we cannot reject the hypothesis that the distributions of the two samples are the same.

# Disclaimer

*Any past performance, projection, forecast or simulation of results is not necessarily indicative of the future or likely performance of any investment.The information and publications are not intended to be and do not constitute financial advice, investment advice, trading advice or any other advice or recommendation of any sort offered or endorsed by Strips Finance.*