Deeply understand the principles of the general AMM model: Why is it not suitable for DeFi options pricing?

Aerhy
2021-02-26 15:59:46
Collection
Using a model like Uniswap to price options may not be the best choice for liquidity providers.

This article was published on Tuo Luo Finance, author: Aerhy, translation: Aguas.

Key Points:

  1. Option pricing depends on various factors (such as expiration time and implied volatility), and in most cases, they tend to be zero (referring to unexercised or out-of-the-money options).
  2. The price discovery mechanism of general AMMs (like Uniswap) typically relies on trading volume; in a liquid market, the price of an asset should be determined by market forces. However, at the time of this article's publication, the DeFi options market was still in its infancy, and options might not be updated frequently, which could lead to outdated prices and significant impermanent losses for liquidity providers in the options pool.
  3. This article explores the mathematical principles behind Uniswap v1 and concludes that using it as a trading venue for option tokens may not be the most suitable choice.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

General AMMs and Impermanent Loss

General AMMs, such as Uniswap v1 and v2, are one of the most important components in DeFi.

Their model combines price discovery and market making, allowing even the least liquid assets to have a market and development.

It has carefully designed incentive mechanisms that encourage different participants to engage as sellers, buyers, and liquidity providers. In fact, liquidity providers are participants who play a crucial role in the system. This feels like an abstraction of traditional market makers. The reason behind this similarity is that AMMs do not require continuous ledger management and order filling, allowing users to trade their funds. Some may argue that those are not the same users and do not perform the same business. But ultimately, both participants (liquidity providers in Uniswap and market makers in traditional finance) are guiding a market.

Currently, liquidity providers must contribute equal amounts of funds on both sides of the liquidity pool, expecting to earn fees from all transactions occurring in the pool and to reclaim their initial investment.

In DeFi, some users have always understood the activity of providing liquidity as a form of "passive income investment," meaning providing assets, holding the amount of funds, and earning fees proportional to the initial capital. While this may be true for stable asset pools (like DAI:USDC), it is not entirely accurate for volatile asset pools (like USDC:ETH) in certain scenarios.

There is a phenomenon known as impermanent loss (IL), which we use to refer to the negative yield of adding liquidity to Uniswap with volatile assets compared to simply holding the two assets.

It describes a situation where the profitability of liquidity providers seeking passive income is negatively impacted. If the price of the added tokens eventually returns to the price at which they joined the liquidity pool, then impermanent loss is nonexistent or minimal. However, if the price situation differs from the initial price situation, the amount withdrawn may be less than the total of simply holding the assets.

This means that impermanent loss only occurs when liquidity providers (LPs) remove liquidity under different price conditions than those initially used. If they do not remove it and wait for a more opportune moment to withdraw, the loss will not occur (impermanent loss). In contrast, in traditional finance, we can think of this as a "perpetual cross-position" because this position has no expiration date, and LPs can hold it for as long as they wish.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

This means that even in a volatile market, if LPs remove liquidity at the price level they entered, they will profit from fees during this period without suffering impermanent loss.

Some may argue that they expect trading fees to compensate for their losses. This can happen, but only to a certain extent, depending on the price at the time of withdrawal and how much liquidity was in the pool during the period of providing liquidity, as well as how many transactions occurred. Therefore, we can understand that the most profitable combination for liquidity providers is a pool with a stable asset and many transactions daily. It is also important to consider that the market defines the pricing of assets; whenever the token pricing in Uniswap deviates from the market price, arbitrageurs will exploit this arbitrage opportunity by trading in Uniswap, helping to guide Uniswap's price closer to the market price of the token.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Simulated Returns

To analyze the returns from liquidity provision activities on Uniswap v2, the following variables should be considered:

• The spot price of the trading pair at the time of providing liquidity

• The spot price of the trading pair at the time of withdrawal

• The trading volume in the pool

• The amount of assets in the pool

• The total fees generated from transactions will be distributed to LPs

Constant Product

The constant_product (k) factor is a way to price trades and maintain the balance of value on both sides of the pool. When ignoring fees, the calculation method for the coefficient is:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Pricing

Uniswap uses the following pricing formula to define the trading value of each asset in the liquidity pool.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Putting formulas 1 and 2 together, we ultimately get the following result:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

It is important to emphasize that the constant product is used to price the assets before another LP adds liquidity to the pool. When this occurs, the constant product is updated with the new pool balances and is used for pricing subsequent trades.

For example:

The initial pool has 100 ETH and 10,000 DAI. Therefore, constant_product (k) = 100 * 10,000 = 1,000,000.

If after 1 day, John decides to add liquidity to the pool with 2 ETH and 2,000 DAI (with no trades in the pool), the constant product needs to be updated since both sides of the liquidity pool have increased. Therefore, the new constant_product (k) will be used for pricing the following trades: k = (100 + 2) * (10,000 + 2,000) = 102 * 12,000 = 1,224,000.

Considering that Uniswap's AMM requires liquidity providers to maintain a 50/50 ratio in terms of value for each trading pair, formula 2 determines that the pricing of assets depends on the trading volume occurring in each pool. This means that in the absence of trades in the pool (the only activity in the pool is liquidity provision), the eth_price will remain the same as when the pool was created. In other words, prices will only be updated when there is trading activity.

When adding liquidity, the pricing of assets differs from the pricing when wanting to buy 1 asset from the pool, as we can see in the following situation.

For example, let’s assume Rob wants to add liquidity to a pool of ETH:DAI. He wants to add 1 ETH, but how much DAI does he need to provide? The current pool balance is 95 ETH and 10,529.49 DAI. According to formula 5, the amount of tokens he needs to provide = 1 * (10,529 / 95) = 110.87 DAI.

After providing liquidity, the new pool balance is:

95 + 1 ETH = 96 ETH

10,529 DAI + 110.87 DAI = 10,640.36 DAI

New k = 96 * 10,640.36 = 1,021,169.85

Liquidity Provider Returns

To understand Uniswap's AMM, and the difference between the initial price of tokens entering the pool and the price of tokens when withdrawing liquidity, another important concept is LP tokens.

LP tokens represent how much each liquidity provider has in the pool, and thus each LP will receive corresponding returns from the total fees generated by the pool.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Impermanent Loss

Now that we have introduced key concepts, let’s analyze a scenario where liquidity providers encounter impermanent loss.

Babi creates an ETH:DAI pool by adding a total liquidity of 20k (100 ETH and 10,000 DAI). As the first liquidity provider, she receives a total of 1000 LP according to formula 6.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

LPtokensamount = sqrt(100 * 10,000) - 0.00000000000000001 = 1,000 LP shares.

Assuming that after creating the pool, there are 9 transactions that occur as follows—n refers to each period after the pool is created.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Consider the following types of transactions:

exactoutputx: When a user wants to buy 1 ETH at any price.

exactoutputy: When a user wants to use any amount of ETH to buy 1 DAI.

exactinputx: When a user wants to spend an exact amount of ETH to buy an equivalent amount of DAI.

exactinputy: When a user wants to spend an exact amount of DAI to buy an equivalent amount of ETH.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

The constant product of 1,000,000 (k) is the main guide for the pricing mechanism of the above transactions. It calculates what the impact on each side of the liquidity pool should be to allow the transaction to occur while still maintaining the constant product when ignoring fees. Now let’s calculate the impact on each side of the pool after the transaction occurs.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Let’s dig into the transaction that occurs when n=1.

• Initial pool balance = 100 ETH and 10,000 DAI

• Constant_product = 100 * 10,000 = 1,000,000

Transaction type: exactoutputx → The trader wants to buy exactly 1 ETH (so he will remove 1 ETH from the ethliquiditypool).

New ethliquiditypool = 100 - 1 = 99 ETH → Now that we have this new ETH pool balance, what is the new DAI pool balance, as a large amount of DAI tokens will flow into the pool?

New DAIliquiditypool = constantproduct / new ethpool_balance = 1,000,000 / 99 = 10,101.01.

From the inflow of DAI into the pool, we can assume the following formula.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

eth_price = (10,101.01 - 10,000) / 1 = 101.01 → So in the transaction at n=1, the price at which the trader buys ETH is 101.01.

Final pool balance: 99 ETH and 10,101.01 DAI.

We can see in the table below what happens in Uniswap's AMM, considering the constant product of 1,000,000 and the new pool balances after the transaction. We can also visually see the price and the 0.3% fee charged for each transaction.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

After the transaction, the final pool overview is:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Now let’s assume Tom (user10Add1ETH) wants to add 1 ETH of liquidity at the moment n=10. Since AMM requires LPs to provide a pair of tokens of equal value on both sides, Tom must provide an amount of DAI equivalent to the value of 1 ETH, with the price taken from the previously introduced formula 5.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

So Tom must provide 1 ETH.

DAIamountto_provide = 1 * (10,529 / 95) = 110.87 DAI.

Since a new liquidity provider is entering the pool, the constant product for pricing trades needs to be updated before the new LP enters the pool, with the new K = 96 * 10,640 = 1,021,170.

Just after Tom, 7 other LPs provide liquidity in the pool, receiving corresponding LP shares according to the pricing provided by AMM's formula 5 and formula 7, as follows.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Let’s first consider the information provided to facilitate the analysis of impermanent loss.

Tom's initial position when entering the pool is: 1 ETH and 110.87 DAI.

Tom (user10Add1ETH) decides to remove their tokens from the pool at any moment after n = 17.

Tom's LP in the pool is Tom LP tokens / totalLPtokens = 10.53 / 1,284.30 = 0.008199 = 0.82%.

After n = 17, no additional liquidity providers enter the pool, only transactions occur.

Given the high trading volume in the ETH:DAI pool, we can assume that Uniswap's pricing mechanism reflects the true market pricing, as arbitrageurs continuously correct prices by exploiting arbitrage opportunities.

The time period (n) represents each time period of price updates in the AMM.

Let’s compare what happens to his funds when he withdraws liquidity from the pool versus keeping the assets in his wallet.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Now let’s compare how each of the above scenarios differs.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Applying the formula for impermanent loss from Pintail's blog to this case, we have:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

From the above simulation, we can conclude that there is indeed a loss when providing liquidity compared to holding tokens in a wallet. This occurs when the balances in the pool change, and the price of each token fluctuates with the transactions in the pool.

It is important to emphasize that LP providers may remove their LP. In this case, at the moment Tom decides to remove liquidity, he removes 0.8% of the current pool. Since the pool from which Tom wants to remove liquidity may have changed compared to when he added liquidity, his final price will differ from his initial price.

This phenomenon can also be observed in the graph below by plotting the price changes.

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Fee Impact

Uniswap allocates 0.3% of all transactions to LPs based on their participation in the pool. Therefore, the more transactions occur in the pool, the more passive income LPs earn. This is distributed according to each LP's share in the pool, as mentioned earlier.

We can see that since Uniswap's AMM functions to maintain the product of the two liquidity pools, known as constant_product, equal to the product before the transaction (excluding fees), impermanent loss occurs—we can say that AMM is a retro price scale that ensures equal weight in value for both sides (50%/50% ratio).

It is important to emphasize that the token prices in Uniswap are updated as transactions occur in the pool, which largely depends on the ability of arbitrageurs to find profitable arbitrage opportunities by comparing Uniswap prices with those on other exchanges. Therefore, we can say that the pricing of Uniswap's AMM is entirely determined by the transactions occurring in the pool.

While this model may work well for non-volatile assets and high-volatility trading pools, it may not be suitable for all types of assets.

What About Options?

Options Pool

In DeFi options (taking Pods options as an example), users must lock 100% of the collateral to mint option tokens. The option tokens represent the rights of the buyer and the obligations of the seller. However, since the seller locks the collateral upfront, there is nothing to execute; the smart contract holds the seller's obligations.

Once the options are minted, users can choose to sell them or provide liquidity to the pool. Since Uniswap is a decentralized protocol, anyone can initiate a pool for any pair of assets, and users can directly sell each series of option tokens in the Uniswap pool.

a) Assume that the market for the option is the most liquid, thus the AMM price is correct, representing a fair, up-to-date price through pure arbitrage forces.

Or

b) Arbitrage the pool price if the pool misprices the options, with the opportunity to narrow the gap.

Unfortunately, DeFi is just beginning, and DeFi options are also just starting. This means that the DeFi options market may not always be able to correct Uniswap's prices. If a pool remains inactive for a long time, there will be significant arbitrage opportunities. While this may be good for traders, it may not be so good for liquidity providers.

But how do you know if the price of an option is wrong?

Pricing of Options

There are several models for pricing in traditional finance, the most well-known being the Black-Scholes model. The Black-Scholes formula is as follows:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

Black-Scholes is a mathematical model for pricing options contracts, one of the assumptions of which is that the volatility of the asset remains constant during the life of the option (which does not hold true—especially in cryptocurrencies). This formula only applies to European options (and American call options on non-dividend-paying assets).

All methods attempt to calculate the probability of the option expiring, and if it does, what its current value is. To calculate such theoretical prices, the authors incorporate factors such as the spot price of the underlying asset, time to expiration, implied volatility, risk-free interest rate, and strike price.

The time to expiration of the option is also the time value of the option, which is an important factor affecting pricing when using the Black-Scholes model.

The closer the option is to its expiration date, the more its intrinsic value tends to amplify; that is, if the option is in-the-money as it approaches expiration, its value is higher because the probability of the option being exercised and profiting is high, making the option's pricing more expensive. The same logic applies when the option is far from its expiration date: the probability of the option being executed is very low, meaning its value approaches worthless (zero). You can see more details about this concept below:

In-depth | Why the General AMM Model is Not Suitable for Options Trading Pricing?

At expiration, the option price is either in-the-money or out-of-the-money. In most cases, options ultimately end up out-of-the-money, so at expiration, the option's value is zero.

This means that if users provide liquidity to the options pool and they ultimately end up out-of-the-money, they can withdraw a larger proportion of option tokens. At that time, the value of the option tokens may be zero. They have no "minted" options and no collateral to withdraw. When considering impermanent loss, in this case, we must consider that one of the assets in the trading pair has no value at expiration.

If these factors cannot be input into Uniswap's pricing, what will happen to its option prices?

Options Trading with General AMM

Each trader will treat these formulas in a way they deem appropriate. However, most of them have some method of calculating option prices that can take into account all the factors affecting option pricing. Traders are likely to find arbitrage opportunities, but liquidity providers may ultimately incur losses by allocating their assets to potentially mispriced trades.

For this reason, using a model like Uniswap to price options may not be the best choice for liquidity providers.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
banner
ChainCatcher Building the Web3 world with innovators