On-chain options based on Uniswap V3 Pools

Kirill Bogomolov
7 min readJul 5, 2023

--

In this article, I will show how to create on-chain options contracts based on Uniswap V3 pools.

TLDR

The method that I propose here, allows to create calls, puts, call spreads, and lots of different options contracts with any strikes. The option buyer gets all the positive payoff from Uniswap V3 position + fees, while another counterparty effectively sells a put and receives the premium (at the t = 0).

More accurately, not selling a put, but selling a covered call. But as they have the same payoff function (TV — TV_0), across the article I analyze selling a put.

What’s in this article:

  1. Uniswap V3 position
  2. Decomposition of Uniswap V3 position
  3. Fair price valuation of considered option contracts
  4. Backtesting considered Uniswap V3 position
  5. How will the positions look after taking into account premiums and fees
  6. Letting the upper tick approach infinity

Uniswap V3 Position

In the following examples, I consider the pair USDC-WETH.

Suppose the first user (Alice) opens Uniswap V3 position, i.e. provides liquidity to the selected price range.

The parameters of this Uniswap position:

  • underlying_price: 1247 USDC per ETH
  • lower_price: 1122 (10% off)
  • upper_price: 3118 (2.5x)
  • initial total value in USDC: 1247

In this position, initial tokens amounts are:
- 152 USDC
- 0.87 ETH

Let’s see how the total value of this position depends on the ETH price:

Uniswap V3 decomposition

Suppose another user (Bob) wants to buy a call option. We will see that Alice and Bob can make a deal that would satisfy both of them.

Let’s consider the following derivative contract:

At the time t = 0:

  1. Alice opens a Uniswap position with specified parameters and liquidity
  2. Alice locks this position within the time 𝑇 (i.e. she doesn’t close this position)
  3. Bob pays to Alice the premium

At the time 𝑇:

  1. Alice closes the Uniswap V3 position
  2. If the Total value of the position at the time 𝑇 is greater than the initial TV, then she sends all the difference in TV to Bob.
    If the Total value is lower than the initial TV, she leaves the TV to herself.
  3. Alice collects all earned fees and sends these fees to Bob

We can display these contracts on the chart in the payoff notation:

In the chart above I didn’t add the option premiums as it’s needed to evaluate the prices of such option contracts (see the next sections of this article).

In this case, if we decompose the Uniswap V3 position, Bob would get a payoff that is similar to at-the-money call spread payoff.

At the same time, Alice's payoff is almost exactly the payoff of sold at-the-money put option (without the option premium, we will add the premium after evaluating the fair price of this contract)

For Bob, this contract is beneficial since he needs to pay only a fixed premium.

Here’s how vanilla call spread usually looks like in TradFi:

Valuation of the fair prices of considered option contracts

Alice would consider selling a put option to Bob if he pays a premium that is at least equal to the fair value of Alice’s put option.

Moreover, in this case, if Bob offers to pay more than the fair value of Alice’s put option, it would be more profitable for Alice to make a deal with Bob rather than creating a Uniswap V3 position.

Calculating the fair price

Due to the curvature of our considered options, it is not possible to utilize the simple Black-Scholes formulas for call and put pricing. Additionally, the Black-Scholes formula assumes a constant implied volatility across different strikes, which does not hold true.

So I’m using much more advanced, stochastic volatility model (SABR model):

where

This stochastic model accurately fits the Implied volatility surface of options market. In other words, this model allows us to obtain different Implied volatility depending on the chosen strike price.

Once we have calibrated the model, we can find the fair prices of any exotic option contracts as the expectation of the discounted payoff in the risk-neutral measure:

The risk-neutral valuation is widely used in traditional finance as it enables the calculation of the cost of replicating a hedging portfolio of the corresponding derivative contract.

For a more detailed explanation of what is the risk-neutral measure, check out my article: https://medium.com/@kirill.bogomolov95/options-and-black-scholes-formula-8f17a5cad771

So let’s evaluate the fair prices of considered two option contracts

At first, I calibrated the SABR model to the options market on Deribit. Then, with the calibrated model we can simulate the asset price paths and obtain the fair prices of any exotic option contract via Monte Carlo simulations.

Here is an example of path simulation utilizing the SABR model. It is noteworthy that the probability distribution is not lognormal, but more flexible, enabling a more precise fitting to the market.

The fair price of the given put:

It can be obtained that the fair price is $89.7

The fair price of the given call spread:

For this contract, it can be obtained that the fair price is $70.2

The difference is 89.7–70.2 = $19.5.

But the Uniswap V3 position earns the fees.

What amount of fees would this Uniswap V3 position earn?

Reminding the parameters of our Uniswap V3 position:

  • underlying_price: 1247 USDC per ETH
  • lower_price: 1122 (10% off)
  • upper_price: 3118 (2.5x)
  • initial total value in USDC: 1247
  • Period: 29.2 days (i.e. time to expiration, backtesting period)

I conducted a backtest of this Uniswap V3 position to evaluate the amount of fees it would generate on the Polygon blockchain.

I calibrated the options pricing model to the market options prices at the timestamp 2023–01–04 06:00:00, and conducted the backtest from starting at this timestamp.

Backtesting result

Backtested this Uniswap V3 position, I obtained: earned_fees = $19.8.

This indicates (in this particular case) that the fair price of a put option is equal to the fair price of a call spread plus generated fees. In other words, it means that fees could potentially compensate the difference in option prices. As a result, both parties could potentially benefit from such a contract (i.e. both counterparties get fair prices)

Additionally, Bob (option buyer) does not need to lock any collateral, he just needs to pay the premium at the time t = 0

How will the positions look after taking into account premiums and fees?

It’s important to note that for this example the fair price of the put option equals the fair price of the curved call option plus fees that Uniswap V3 position would generate.

What if we let the upper tick approach infinity while leaving the lower tick the same?

If we let the upper tick approach infinity while leaving the lower tick the same, the total value of Uniswap V3 position depending on the price will become more and more straight and more look like a forward.

By increasing upper tick, we will get a simple Vanilla call and Vanilla put:

However, by increasing the upper tick, the liquidity is distributed over a wider range, so the Uniswap V3 position will generate a smaller amount of fees.

In the next articles, I will explain how @Alcor Finance will utilize this approach to change the game in the on-chain DeFi options space

Thanks for your time.

Stay tuned.

My twitter:
https://twitter.com/kirrya95

My telegram:
https://t.me/kirr_ya

--

--

Kirill Bogomolov

Entrepreneur building the future of decentralised finance