Designing a Low-Toxicity Automated Market Maker

In this series of posts, we suggest a design for a new low-toxicity AMM. Other parts: part two.

Alexander Nezlobin
4 min readAug 24, 2022

Introduction

When the order flow is toxic (that is, dominated by informed arbitrageurs), liquidity providers on average lose money. According to several studies (one, two), this is currently the case for the largest decentralized exchange protocol, Uniswap v3.

The solution to this problem is to attract a higher volume of regular, non-arbitrage, trade. In our previous series, we described several issues that large non-arbitrage investors face when trading on the existing DEXes. Now we present an AMM designed to address these issues.

Our goal is to come up with an AMM that:

  • is efficient both in terms of storage requirements and execution complexity,
  • provides efficient ways for large non-arbitrage investors to trade by gradually making and taking liquidity,
  • maximizes returns to passive LPs.

In this first article of the series, we describe the specific features that the we want the AMM to have.

The features that we are after

There are ten of them.

  1. Cheap execution, low storage use. Transactions and storage are expensive on the blockchains with the highest TVL. Our AMM should have constant-storage/constant-time complexity for simple swaps. It should only rely on basic arithmetic operations. A rough implementation of a simple swap should not require more than 200,000 gas on the EVM.
  2. Continuous, fully internal, price discovery. The AMM should have uninterrupted price discovery, not requiring any external oracles. If the AMM price deviates from the efficient price due to an uninformed trade, market participants should have incentives to correct it quickly. This will prevent the issues with market resilience described here and facilitate the execution of large orders by gradual taking of liquidity.
  3. Automatic positioning and concentration of liquidity. There is a trade-off between automatic and LP-controlled positioning of liquidity, which we discussed before. The main advantages of automatic positioning of liquidity include higher composability, easier LP experience, and higher swap fees for passive LPs. Since one of our goals is to maximize the returns to passive liquidity provision, the positioning and concentration of liquidity should be automatic.
  4. Dynamic fees. Swap fees and the after-fee bid-ask spread should be dynamic — increasing at times of high volatility and decreasing when the volatility is low. Combined with the automatic concentration of liquidity, the AMM should incentivize consistent trading activity. When trading volume is low, fees decrease and liquidity gets more concentrated, attracting a higher trading volume. When volume is high, fees increase and liquidity gets more dispersed. This reduces the overall trading volume but makes it more profitable to the LPs.
  5. One-way liquidity with a predictable conversion rate. The AMM should accommodate directional traders who want to execute their swaps by providing rather than taking liquidity. (For more details, see this post from our previous series). Such liquidity should only convert in one direction and then be removed from the pool. The conversion rate over time should be reasonably predictable.
  6. Two-way liquidity. The protocol should allow for the traditional two-way liquidity provision.
  7. One-sided liquidity provision. LPs should be able to provide both one-way and two-way liquidity in a single token of their choice. This feature opens up many new scenarios of liquidity provision. For instance, LPs who believe that one token is likely to appreciate relative to another are usually reluctant to provide liquidity in the appreciating token. The AMM should allow them to provide liquidity in the depreciating token alone. Their liquidity can then be used on price up moves of that token, which should be temporary according to their beliefs.
  8. Incentives to balance the book. Liquidity providers should have incentives to balance the book, that is, provide liquidity to the side on which it is depleted.
  9. Resistance to price manipulation. Protocols that move liquidity in response to order flow can be vulnerable to price manipulation attacks. Informed traders can manipulate the AMM price (and therefore the distribution of liquidity) by trading against their private information, and withdrawing or contributing additional liquidity before or after such trades. The AMM should be resistant to such attacks.
  10. Liquidity provision with a predictable risk of loss. One advantage of LP-controlled liquidity positioning is that it makes losses predictable for passive LPs. For instance, one can always calculate the maximum loss for a Uniswap position as a function of the beginning and ending AMM prices. Our AMM should provide a way to contribute liquidity with a similarly predictable risk of loss.

Conclusion

The features described above are designed to maximize options for non-arbitrage traders and LPs. Traders can execute large orders by gradual taking of liquidity or provision of one-way liquidity. LPs can contribute one- or two-way liquidity with any amounts of tokens. In our next post, we will start describing the protocol from the traders’ perspective.

Next post in this series.

Thoughts/ideas/suggestions? Leave a comment here or reach us at ltdex@pm.me.

--

--

Alexander Nezlobin

I am a professor at the London School of Economics, and I write about DeFi.