“In the industry, people often equate AMMs with capital inefficiency. To get a feel for the difference, we compared the transaction cost rankings for trading 100 ETH on DeFi and CeFi perpetual contracts exchanges that use AMMs or order book systems and combined them with the ranking of liquidity provider funds in the system. The final conclusion is that perpetual AMMs are not capital inefficient.”

In our recent Medium article, we found that DeFi perpetual contracts are not necessarily more expensive than CeFi perpetual contracts. However, does this mean that the capital requirements for AMM liquidity providers are greater than the capital provided by market makers for order book based systems?

In “The Homogeneous Properties of Automated Market Makers”, Jensen et al. [1] show that for constant function market makers, a specific form of spot AMMs, slippage is a function of market depth relative to the volume in the pair’s liquidity reserve. The authors conclude that to reduce excessive slippage, these AMMs require reserves that are several orders of magnitude larger than daily volume, making the AMMs capital inefficient. However, is this a necessary trade-off for perpetual swap AMMs?

How to measure capital efficiency?

There are currently different ways to measure capital efficiency in DEXs. These include measures labeled “utilization”[3] or “liquidity turnover”[4], which are essentially the ratio of a DEX’s trading volume to the total liquidity deposited by liquidity providers. They are useful for liquidity providers because they allow measuring the volume (and fees) generated by a DEX per unit of liquidity. However, they do not address the price impact issue faced by traders.

Lim[2] defines capital efficiency as a function of the amount of capital required to make markets efficiently. This definition contains two key concepts: (i) the amount of capital required and (ii) efficient market making. The more efficiently a market can be made with as little capital as possible, the more capital efficient an exchange is. This is the view we adopt in this paper. To determine (i) the amount of capital required, we extract the amount of capital posted by liquidity providers. To determine (ii), we evaluate the cost faced by a trader in trading 100 ETH given the amount of capital.

  • AMM’s liquidity provider capital: the amount of capital in a given liquidity pool and its insurance fund (if any), divided by the number of perpetual contracts in that pool.

  • Amount of capital in the order book: Order book depth is a relevant metric for estimating the price impact of a given trade. The capital required to provide a given order book depth is only a fraction of it due to leverage. For example, if the volume at the best ask price is equal to 50 ETH, the leveraged market maker has posted less than 50 ETH of collateral. If the average leverage at the best ask price is 10x, then only 5 ETH will be posted as collateral. Therefore, we can estimate the capital required for a given order book by dividing the volume of the order book by the average leverage.

  • Efficient Market Making: The better the price an exchange can offer for a given trade, the more efficient that exchange is in that particular market. To compare the market making efficiency of different exchanges, we compared the transaction costs for a representative trade. The lower the transaction costs, the more efficient the market making of a given exchange. We not only consider price impact, but also other costs such as fees and holding costs. The reason for considering fees is that fees are an integral part of operating an order book exchange, as both limit and market orders are customers of the exchange, and without fees or order flow payments, the exchange would not make any profit. The reason for considering holding costs is that some decentralized exchanges do not have price impact by design (such as GMX), and they must generate revenue through other means to attract liquidity providers.

We refer to our recent research “Are DeFi Perpetual Swaps More Expensive Than CeFi?” [5] for a detailed overview of transaction costs.

Competitors

We compared the capital efficiency of four AMMs: Perpetual Protocol, Gains Network, GMX, and D8X. To make the results more accurate, we also compared two order book-based exchanges: Binance and dYdX.

AMM-based exchanges

AMM-based protocols like Perpetual Protocol, Gains Network, and GMX use pricing functions to determine trading prices. Each trader trades with a "liquidity pool" through the AMM's pricing function. The liquidity pool allows anyone to contribute tokens to the protocol (usually a form of USD tokens such as DAI or USDC) and participate in the profits and losses of the AMM.

GMX has a multi-asset liquidity pool that acts as a counterparty to traders. The target composition and target weights of the multi-asset pool are defined by the GLP index (see [6]). On Arbitrum, the GLP index consists of ETH, BTC, LINK, UNI, USDC, USDT, DAI, and FRAX. Liquidity providers can deposit any index asset into the pool and mint GLP by paying a dynamic fee. GLP holders earn 70% of the platform fee (in the form of ETH on Arbitrum) plus the custodial GMX. GMX's pricing function has zero slippage, but introduces a borrowing rate, which traders pay to GLP (for both short and long positions) (see [5] for more details on pricing).

Gains Network has a single asset (DAI) liquidity pool that serves as the counterparty for all trades. DAI from negative PnL trades goes to the pool, and the DAI in the pool is used to pay traders for positive PnL trades. Liquidity providers deposit DAI into the vault and earn DAI rewards based on fees based on the platform's trading volume [7]. Gains Network uses a linear pricing approach. That is, Gains adds a spread to the index price and worsens the price linearly with the size of the trade (see [5] for more details on pricing).

Perpetual Protocol has a bilateral liquidity pool. Liquidity providers provide liquidity to takers for trading within a specified price range. Liquidity can be provided in USDC, ETH/WETH, FRAX, and OP, and may be divided into base tokens (e.g., ETH) and quote tokens (e.g., USD) [8]. Liquidity providers receive protocol fees and funding payments to compensate for temporary losses, and participate in the profits and losses of the system. Perpetual Protocol borrows its pricing function from Uniswap v3's centralized liquidity AMM (see [5] for more details on pricing). Somewhat similar to market makers in an order book system, Perpetual Protocol's liquidity providers are leveraged and can be liquidated.

D8X has two single-asset liquidity pools, a MATIC pool and a USDC pool. Liquidity providers participate directly in D8X’s PnL, which is paid in the pool currency. D8X uses a derivative pricing approach where the AMM sets the price so that traders are incentivized to minimize AMM risk (see [5] for more details on pricing). This results in much better price impact in benign times compared to Perpetual Protocol and Gains, as well as prices that can be arbitraged when supply and demand differ greatly.

Order Book Exchanges

Taking Binance as a representative of CEXs, at the time of writing this article, Binance ranks first in terms of trading volume and has lower fees compared to other CEXs. Our measure of the amount of capital provided by market makers for a given perpetual contract is Binance's order book depth divided by average leverage.

dYdX is the only DEX we selected that uses an order book instead of an automated market maker (AMM). Although dYdX is non-custodial and implements an off-chain order book at StarkWare, its single centralized ranker is its bottleneck. Our measure of the amount of capital provided by market makers for a given perpetual contract is dYdX's order book depth divided by average leverage.

data

Transaction cost data

To compare the market making efficiency of different exchanges, we compared the transaction costs of a representative trade. We selected the following trades: opening a 100 ETH position, holding the position for 8 hours, and closing the position. We used data collected in the article “Are DeFi perpetual contracts more expensive than CeFi?” See [5] for more details on the data collection process.

Liquidity data

To compare the amount of capital required by exchanges to make markets, we collect liquidity data as follows.

GMX

We use data published by GMX on their analytics dashboard [8], which shows a USDC pool of over 155 million at the time of collection in early November 2022. GMX offers 4 perpetual swap pairs and allows traders to use other currencies as collateral, so as a conservative lower bound on their liquidity we get 38.5 million USDC per perpetual contract.

Gains Network

Official data on Gains liquidity pools is published on their dashboard [10]. All of their perpetual contracts share the same liquidity pool, denominated in DAI, which continues to hover around 20 million DAI at the time of writing. At the time of data collection in early November, most perpetual pairs on Gains had very low volume, with approximately 14 out of 71 being completely inactive. Nonetheless, using a conservative estimate and counting all active perpetual contracts, we come up with a liquidity of 3.3 million DAI per pair.

Perpetual Protocol

We collect TVL in the ETH:USD pool directly from the v2 DApp [11]. We collected 2 data on October 30, 2022, and 3 data on November 5, 2022, with an average TVL of $7 million.

D8X

Since D8X is not live on the mainnet yet, we use an agent-based simulation to get liquidity and transaction cost data. The simulation mimics the D8X AMM. The perpetual index price is taken from the historical data of the corresponding perpetual contract. The agents involved are liquidity providers and traders. Liquidity providers randomly add funds to the system. Liquidity providers withdraw funds after a determined holding period. Traders' individual trading preferences are randomized in terms of cash holdings, leverage selection, long/short selection, trading frequency, and they have different strategies. These strategies include momentum trading, noise trading (not a strategy per se), and arbitrage trading, where they compare the perpetual price to the index when deciding whether to trade.

We parameterize the simulation so that the number of traders increases over time and simulate up to 1,000 traders at the end of a quarter. Finally, we select a benign period, comparable to competitor evaluations, and average out slippage.

The simulation provides us with data on transaction costs and perpetual liquidity.

Binance

We reuse the order book data collected in [5]. We only collect up to 50 order books, which provides us with a lower bound on the market maker funding allocation. We assume that the average leverage of market makers is 5x. We calculate the amount of funding provided by market makers by dividing the order book depth by the average leverage.

dYdX

We reuse the order book data collected in [5]. We assume that the average leverage of market makers is 5x. We calculate the amount of funds provided by market makers by dividing the order book depth by the average leverage.

in conclusion

The chart below shows total transaction costs (our measure of exchange market making efficiency) and capital provided by market makers/liquidity providers.

We rank each exchange in descending order for transaction costs and capital provided (e.g., a transaction cost ranking of 1 means the exchange has the lowest transaction costs). The more capital efficient an exchange is, the lower its transaction costs and the lower the market-making capital required. To get a sense of overall capital efficiency, we add together each exchange’s rankings for transaction costs and capital requirements to arrive at our capital efficiency ranking.

  • Perpetual Protocol and GMX are the least capital efficient exchanges in the sample. Perpetual Protocol ranks 6th in transaction costs (129bps) and 4th in capital requirements (US$7 million). Therefore, this AMM-based exchange requires a lot of capital from liquidity providers, and the market efficiency is still relatively low. GMX ranks at the bottom with Perpetual Protocol in terms of transaction costs, with relatively high transaction costs (ranked 4th, 22.6bps) and a large amount of capital provided by liquidity providers (ranked 6th, US$38.5 million).

  • dYdX is an order book-based exchange, ranked 4th, with transaction costs in the middle of all exchanges (ranked 3rd, 15bps), but market makers provide a large amount of capital (ranked 5th, US$10.6 million).

  • Gains Network ranks 3rd, with relatively high transaction costs (ranked 5, 53bps), but lower capital requirements (ranked 1, $300,000).

  • Binance ranks #2. It ranks#1in transaction costs (tied with D8X), but#3in capital requirements. Note that Binance’s ranking on capital requirements is overstated given the way we collect data. If we took the full order book into account, Binance would most likely rank worse on the capital requirements scale, and thus worse on the overall capital efficiency scale.

  • D8X is the most capital-efficient exchange in the sample, ranking first in both transaction costs (11 bps) and capital requirements ($300,000).

After the above thorough demonstration, our conclusion is that perpetual AMM is not necessarily capital inefficient. To understand how D8X achieves such high capital efficiency, please pay attention to the introduction of D8X perpetual contracts.

references

[1] Jensen, Johannes & Pourpoune, Mohsen & Nielsen, Kurt & Ross, Omri. (2021). The Homogeneous Properties of Automated Market Makers. 10.13140/RG.2.2.24015.82086.

[2] Lim, Tristan,. (2022). Predictive Crypto-Asset Automated Market Making Architecture for Decentralized Finance using Deep Reinforcement Learning. 10.48550/ARXIV.2211.01346.

[3] Buckler, Nicole. (2022). Bridge Liquidity Paradox: It’s Not Always Water Under the Bridge.

[4] Powers, Chris. (2021). “AMM’s Capital Efficiency, Wintermute’s trades”

[5] D8X, “Are DeFi Perpetual Futures More Expensive than their CeFi Counterparts?”

[6] GMX, “GLP”

[7] Gains Network, “DAI Vault”

[8] Perpetual Protocol, “Providing Liquidity”

[9] GMX, “Analytics Dashboard”

[10] Gains Network, “Pools”

[11] Perpetual Protocol, “Pools”

risk warning

Nothing in this article constitutes an offer, solicitation or advice to sell, buy or recommend securities or other products (tokens) or services, whether or not such securities, products (tokens) or services are mentioned in this article.

Original English material: https://medium.com/@d8x.exchange/are-amms-capital-inefficient-by-design-40b44b3f370a