avatarMaverick Protocol

Summarize

Backtests for Constant Product vs. Maverick AMM

In this post, we’ll provide a more detailed account of a presentation that CTO Bob Baxley made during our first Discord Community Town Hall. As part of his explanation of Maverick’s next-gen AMM technology, Bob presented data from a series of backtests that show how handily Maverick’s AMM outperforms the ubiquitous constant product AMM in terms of returns for LPs.

Read on to find out why we’re so confident that our technology is poised to change how people provide liquidity in DeFi!

These backtests simulate a situation where all swap trades flow to one of two AMMs: the Maverick AMM or a constant product AMM (for more info on AMM types, you can check out our Maverick 101 post!). Trade requests are generated randomly over time, and a simple router function then routes each incoming trade to the AMM that offers the best price at the time; i.e., whichever AMM has the best price gets the trade.

For these tests, we used ETH-USD price data from the year 2019. This period saw a sideways market for ETH, with a 2x price jump followed by a crash in the middle of the year.

The upper left panel in the image above shows the results of three different investing strategies:

  1. The brown line represents the value of a 50–50 HODL, i.e., the results of owning a position that was 50–50 ETH-USD and not investing it anywhere. As we can see, it basically tracks the price of ETH as it pumps and crashes.
  2. The green line represents the value of investing that 50–50 position in a constant product AMM. It slightly outperforms the HODL, since in addition to the changing value of ETH the owner would also collect fees from swaps performed against their position.
  3. The purple line represents the value of investing the same position in Maverick’s AMM. Over the course of the year, it drastically outperforms both the HODL and constant product AMM strategy, even during the crash at the midpoint.

Why does the Maverick position pay off so well compared to constant product? It’s simple: the Maverick AMM was consistently able to offer better prices, which meant that it captured more of the incoming trades. More trading volume meant more fees were generated in the Maverick AMM, which flowed back to LPs and made this the most profitable strategy.

In this particular test, Maverick’s AMM has 8x the capital efficiency (268k/24h vol vs 34k/24h vol) as well as 6x higher returns (32% vs 5%). But where Maverick’s AMM truly shines is in achieving more capital efficiency while still protecting LPs from extreme impermanent loss (IL).

To show this, let’s zoom to day 132 of the backtests, when ETH began its pump, to see Maverick’s liquidity shifting mechanism in action. In this high price movement period, the Maverick AMM actually lets the price slip significantly, which causes worse pricing and thus leaves the constant product AMM to fill more volume than in steady price periods. This is illustrated in the lower left panel in the image below, where we can observe a noticeable dip in the purple trading volume and accompanying increase in the green volume:

But wait, didn’t we just show that higher trading volume is better for LPs? In a steady price situation that is true, but in periods of high price movement an LP’s deposit is actually at risk of IL from arbitrage.

As the exterior market value of ETH increases, arbitrageurs will come to AMMs to remove ETH at a lower price for as long as it is available, since AMMs trade agnostically and naively according to their algorithmic rules. At this point, it is in the LPs’ best interest for an AMM to let the price slip in order to limit IL and not give away reserves to arbitrageurs. So on a day like this, LPs still do better if they’re invested in a Maverick AMM than in a constant product AMM.

Essentially, Maverick has found a way to have great pricing without overpaying arbitrageurs for price discovery.

Finally, let’s take a look at a stable pair price feed, using USDC-USD data from 2021.

Once again, in the upper left panel we can see that Maverick’s concentrated liquidity far outperforms the constant product AMM. The simulation shows a 340x improvement in capital efficiency and a 140x improvement in LP return, all while offering traders better pricing. The constant product strategy, by comparison, is barely more profitable than just HODLing.

Importantly, if one side of the stable pair unpegs, the Maverick AMM will shift liquidity as the price moves. This will protect LPs, because it will limit their IL exposure, just as it did during the ETH pump. In contrast, stableswap-like AMMs are not as robust to unpegging pairs, leaving LPs at risk to IL from arbitrage.

In summary, Maverick’s AMM maintains a static concentrated liquidity distribution when the price is not moving, but shifts the distribution as and when the price moves significantly. In sideways markets, traders get great pricing. In moon or bust markets, LPs are protected from IL. As these backtest simulations show, this gives Maverick a significant edge when compared to other AMM providers, and users can enjoy the benefits whether they visit Maverick’s own UI or reach its market through swap aggregators.

DISCLAIMER: The information provided in this Medium Post pertaining to Maverick Protocol (the “Project”), its crypto-assets, business assets, strategy, and operations, is for general informational purposes only and is not a formal offer to sell or a solicitation of an offer to buy any securities, options, futures, or other derivatives related to securities in any jurisdiction and its content is not prescribed by securities laws. Information contained in this Medium Post should not be relied upon as advice to buy or sell or hold such securities or as an offer to sell such securities. This Medium Post does not take into account nor does it provide any tax, legal or investment advice or opinion regarding the specific investment objectives or financial situation of any person. The Project and its agents, advisors, directors, officers, employees and shareholders make no representation or warranties, expressed or implied, as to the accuracy of such information and the Project expressly disclaims any and all liability that may be based on such information or errors or omissions thereof. The Project reserves the right to amend or replace the information contained herein, in part or entirely, at any time, and undertakes no obligation to provide the recipient with access to the amended information or to notify the recipient thereof. The information contained in this Medium Post supersedes any prior Medium Post or conversation concerning the same, similar or related information. Any information, representations or statements not contained herein shall not be relied upon for any purpose. Neither the Project nor any of its representatives shall have any liability whatsoever, under contract, tort, trust or otherwise, to you or any person resulting from the use of the information in this Medium Post by you or any of your representatives or for omissions from the information in this Medium Post. Additionally, the Company undertakes no obligation to comment on the expectations of, or statements made by, third parties in respect of the matters discussed in this Medium Post.

Amm
Crypto Trading
Crypto Trading Platform
Dex
Blockchain
Recommended from ReadMedium