GammaSwap-DeltaSwap: The Real Next-Gen Leap from UniswapV2

Background

Daniel Alcarraz, CFA
GammaSwap Labs
Published in
7 min readFeb 6, 2024

--

In traditional finance, the advent of electronic markets and the rise of computer algorithms have driven commission fees to virtually zero. This shift occurred as market making, fundamentally a practice of selling volatility, became increasingly efficient. Modern market makers have honed their skills in managing volatility to such an extent that they can support conventional exchanges offering zero-fee trading for spot transactions. The revenue they generate from their core activities in selling volatility as market makers is sufficient to sustain the trading industry without the need for commissions.

DeFi’s answer to centralized order books came in the form of Automated Market Makers (AMMs), with UniswapV2 leading the charge. This platform embodied the core principles of blockchain technology by pooling liquidity from the general public in return for trading fees from spot traders. UniswapV2 emerged as a solid, blockchain-centric alternative to traditional order book exchanges that depend on professional market makers. By eliminating the need for professional market makers, AMMs have significantly reduced the hurdles for gathering liquidity in emerging assets, while becoming a retail friendly passive investment vehicle akin to ETFs.

Problems

Unfortunately, the dependence of Automated Market Makers (AMMs) on trading fees has positioned them in tough competition with centralized exchanges that offer low or zero commissions to spot traders. Furthermore, the variability of volatility in financial markets implies that the fixed trading fees set by platforms like UniswapV2 might sometimes fall short for liquidity providers (LPs) in AMMs. This shortfall challenges the sustainability of liquidity provision in AMMs without resorting to incentives like staking rewards, which can lead to the dilution of token values crucial for the funding of crypto projects.

In response, alternative approaches like the development of concentrated liquidity AMMs, exemplified by UniswapV3, were introduced. However, these models deviated from the ethos of decentralized ledger technology by necessitating that liquidity providers possess expert knowledge in liquidity management. This shift inadvertently led to a greater centralization of execution, with the majority of returns accruing to these expert providers, to the detriment of retail LPs — the original target audience of DeFi.

Almost 90% of the volume in UniswapX is filled by the top 5 fillers. Source: https://dune.com/queries/3053932/5390851

Enter GammaSwap

GammaSwap addressed this issue by introducing the concept of borrowing liquidity from AMMs. This innovation transformed constant product market makers like UniswapV2 into dual-sided volatility markets. In this framework, if AMM liquidity providers (LPs) are undercompensated, it creates an opportunity for liquidity borrowers to take the counter position to the AMM’s LP and bet on higher volatility, thereby increasing the fees for LPs until a balance is achieved. This rate adapts according to traders’ volatility expectations, yet still allows AMM LPs to remain passive non-expert liquidity providers who can profit from volatility. Consequently, GammaSwap maintains low barriers for aggregating liquidity, especially for emerging assets.

Considering that AMM liquidity providers (LPs) can now achieve consistent profitability aligned with their exposure to volatility, it becomes feasible for AMMs to eliminate trading fees entirely. This shift enables them to rival traditional exchanges in terms of cost-effectiveness. Although GammaSwap is AMM agnostic — it can work with any AMM that can calculate a liquidity invariant to represent liquidity in its pool — all AMMs in existence charge trading fees to spot traders unfortunately.

Enter DeltaSwap

DeltaSwap was developed to continue the transformation that GammaSwap began, evolving AMMs into volatility exchanges that don’t levy fees on spot traders. Since DeltaSwap is the liquidity source for volatility traders in GammaSwap, it does not need to charge trading fees to spot traders. Consequently, AMMs are now equipped to compete head-to-head with centralized exchanges that also offer fee-less trading. Moreover, unlike centralized exchanges that rely on a limited number of liquidity sources, DeltaSwap has the advantage of being able to amass liquidity directly from the general public, broadening its base and inclusivity so that DeFi remains truly decentralized.

Trading Fees for Volatility Traders

DeltaSwap does charge trading fees, just not to spot traders. There’s a fee charged to GammaSwap volatility traders using DeltaSwap to rebalance collateral. The fee is currently 50 basis points charged on at most 10% of the collateral rebalanced in a long or short position, which equates to at most a 5.7 basis point fee charge on the notional value of the liquidity borrowed depending on which token is used to overcollateralize the loan.

Therefore, the cost of opening a long volatility position increases the farther the chosen strike price — collateral token ratio — is away from the current price. The strike price is set by how the collateral is rebalanced. If WETH/USDC pool is quoting a price of $2,000, then the 2/3 ratio used for rebalancing a long position equates to a $1,333 strike and the 3/2 ratio used for rebalancing a short position equates to a strike price of $3,000. Since the straddle position does not need to rebalance collateral, it is the cheapest volatility position to open.

Trading Fees for Spot Traders?

There’s also a 30 basis points trading fee charged to spot traders when the average transaction size is greater than 2% of the average liquidity in the AMM. This average liquidity is calculated with an exponential moving average that is updated with every deposit or withdrawal of liquidity from DeltaSwap to avoid manipulation.

The average transaction size, tradeLiqEMA, is updated with every transaction and also calculated with an exponential moving average to avoid manipulation. To calculate the transaction size, tradeLiquidity, we use the following formula.

Then to calculate the EMA of tradeLiquidity we use the following formula

The average transaction size, tradeLiqEMA, resets to 0 if there are 50 blocks of no swaps from spot traders.

All trading fees and thresholds are subject to change through governance vote to improve efficiency of the protocol.

Why Trading Fees

Although it might seem at odds with GammaSwap’s objectives to offer feeless trading for spot traders, the rationale behind imposing trading fees on certain situations is threefold:

  1. Prevent market manipulation
  2. Provide yield to low liquidity pools
  3. Protect LPs from undue volatility

Prevent Market Manipulation

The AMM’s primary purpose is to facilitate token exchanges without routing through individual intermediaries, thus creating a secondary market for DeFi projects to secure funding. It wasn’t designed to facilitate market manipulation. Consequently, DeltaSwap imposes trading fees on transactions that are likely to be manipulative, characterized by causing excessive price shifts. For instance, a transaction that is 5% of the liquidity in the pool — surpassing the fee threshold of 2% of average liquidity — will incur a slippage greater than 10% and alter the market price by more than 20% from its pre-transaction level. This transaction would generally not be considered normal market activity. Similarly, the traditional finance sector employs measures like circuit breakers and limit up/down rules to regulate market behavior. We want to make sure that DeltaSwap offers feeless trading for bona fide spot traders, not market manipulators.

On DeltaSwap, traders with large orders have the option to execute them in smaller segments, akin to execution strategies used in traditional finance, such as Time-Weighted Average Price (TWAP) and Volume-Weighted Average Price (VWAP). This approach to trading fees not only helps in preventing market manipulation but also promotes more efficient trade execution. By doing so, it aims to minimize trading costs and mitigate unwarranted volatility on DeltaSwap.

Provide Yield to Low Liquidity Pools

The second rationale for implementing trading fees when a transaction is greater than a percentage of liquidity in DeltaSwap pools is tied to the likelihood of new pools having limited liquidity. This low liquidity can make them less appealing for those looking to bet on the pool’s volatility, due to potential slippage issues. Consequently, the use of liquidity borrowing from such pools may be minimal. Additionally, in pools with lower liquidity, typical transactions might constitute a larger fraction of the average liquidity, making transaction fees a vital source of revenue until the pool accumulates sufficient liquidity to attract volatility buyers.

Protect LPs from Undue Volatility

The last rationale for implementing a trading fee is to address the problem of self fulfilling prophecies. As liquidity is borrowed from GammaSwap, DeltaSwap’s liquidity decreases. This reduction heightens the likelihood of significant price movements which benefits liquidity borrowers. In this scenario, the anticipation of higher volatility leads to an increased probability of such volatility actually occurring, without there being a fundamental reason for such volatility. To limit self-fulfilling prophecies from volatility speculators, DeltaSwap increases transaction costs when the price of volatility goes up. This mechanism aims to prevent unwarranted price fluctuations, which could adversely affect liquidity providers who are short on volatility, while still allowing price adjustments that accurately reflect changes in the fundamental values of the underlying assets. The trading fee does not prevent transactions from going through in DeltaSwap. It merely discourages them, unless they are warranted, to the benefit of GammaSwap’s liquidity providers.

Conclusion

In this article, we explored the problems that GammaSwap and DeltaSwap address in financial markets and discussed how they represent a progressive step in the evolution of AMMs, while staying true to the principles of decentralized ledger technology. Additionally, I outlined the circumstances and justifications for DeltaSwap’s imposition of a trading fee. In the next article, I will delve into the process of borrowing liquidity from GammaSwap to capitalize on market volatility.

--

--