Uniswap V3 is conceived as the most successful AMM protocol.
But few people know it can also be an Option protocol.
Want to know a secret?
Here is my research on Uniswap V3 (@Uniswap)π§΅π
But few people know it can also be an Option protocol.
Want to know a secret?
Here is my research on Uniswap V3 (@Uniswap)π§΅π
Today We'll Cover:
β’ How Uniswap V3 works
β’ Power of Concentrated Liquidity
β’ LP Token as Perpetual Options
β’ Thoughts on potential developments
Let's dive in βοΈ
β’ How Uniswap V3 works
β’ Power of Concentrated Liquidity
β’ LP Token as Perpetual Options
β’ Thoughts on potential developments
Let's dive in βοΈ
A quick intro on Uniswap
Uniswap is a decentralized exchange protocol for swapping tokens without permission.
The price of token traded is defined by a notable equation :
X*Y = K
Depositors add two tokens of equal value into a liquidity pool, and traders trade with the pool.
Uniswap is a decentralized exchange protocol for swapping tokens without permission.
The price of token traded is defined by a notable equation :
X*Y = K
Depositors add two tokens of equal value into a liquidity pool, and traders trade with the pool.
What's new in Uniswap V3:
β’ Concentrated Liquidity
β’ Oracle upgrades
β’ Range Order
These improvements aim to offer:
β’ Better capital efficiency
β’ Less impermanent loss
β’ Lower slippage
β’ Less manipulative price
β’ Concentrated Liquidity
β’ Oracle upgrades
β’ Range Order
These improvements aim to offer:
β’ Better capital efficiency
β’ Less impermanent loss
β’ Lower slippage
β’ Less manipulative price
How to create a pool:
β’ Select two tokens: ETH, DAI
β’ Select a fee tier: (1%, 0.3%, 0.05% 0.01%)
β’ Select a tick spacing: 10
A pool is created.
β’ Select two tokens: ETH, DAI
β’ Select a fee tier: (1%, 0.3%, 0.05% 0.01%)
β’ Select a tick spacing: 10
A pool is created.
How to add liquidity:
β’ Select a pool: ETH-DAI 0.3%
β’ Select deposit amounts: 0.1 ETH, 280 DAI
β’ Select a price range: 2550, 2850
Liquidity is added to pool, and an ERC-721 LP Token is minted to the depositor.
The LP Token can be traded on Opensea, Rarible, and Looksrare.
β’ Select a pool: ETH-DAI 0.3%
β’ Select deposit amounts: 0.1 ETH, 280 DAI
β’ Select a price range: 2550, 2850
Liquidity is added to pool, and an ERC-721 LP Token is minted to the depositor.
The LP Token can be traded on Opensea, Rarible, and Looksrare.
Important Details - Base and Quote
β’ Two assets in a liquidity pair: Base and Quote
Ex: ETH - DAI, ETH is the Base asset, and DAI is the Quote asset.
The price of ETH is quoted by the unit of DAI.
β’ Two assets in a liquidity pair: Base and Quote
Ex: ETH - DAI, ETH is the Base asset, and DAI is the Quote asset.
The price of ETH is quoted by the unit of DAI.
Important Details - How Price Range Defined
β’ A Tick of a trading pair is 0.01% of the price.
Ex: a Tick on ETH-DAI when the price at 2850 is 0.01%*2850 = 0.285
β’ A minimum increment of price is Tick*Tick Spacing.
Ex: 0.285*10 = 2.85
β’ A Tick of a trading pair is 0.01% of the price.
Ex: a Tick on ETH-DAI when the price at 2850 is 0.01%*2850 = 0.285
β’ A minimum increment of price is Tick*Tick Spacing.
Ex: 0.285*10 = 2.85
How Swap works:
Step 1 :
A user specifies an order with:
β’ Swap pair:
Token A used to swap for Token B
Ex: ETH <> DAI
β’ Amount:
Total amount to swap
β’ Price Limit:
Maximum price to swap for Token B.
Price goes all the way up when swapping.
β’ Fee tier:
Ex: 0.3%
Step 1 :
A user specifies an order with:
β’ Swap pair:
Token A used to swap for Token B
Ex: ETH <> DAI
β’ Amount:
Total amount to swap
β’ Price Limit:
Maximum price to swap for Token B.
Price goes all the way up when swapping.
β’ Fee tier:
Ex: 0.3%
Step 2:
The protocol will find the pool with the above parameters.
Each pool records its current Tick.
If the Tick's price is lower than the price limit and the required amount is not fulfilled yet, the liquidity in the Tick will be swapped.
The protocol will find the pool with the above parameters.
Each pool records its current Tick.
If the Tick's price is lower than the price limit and the required amount is not fulfilled yet, the liquidity in the Tick will be swapped.
Step 3:
If the liquidity in a tick is used up and the required amount is not filled, the protocol will find the next tick with a higher price.
The process will continue until the required amount is reached or the price limit is crossed.
All the trade in Ticks will be recorded.
If the liquidity in a tick is used up and the required amount is not filled, the protocol will find the next tick with a higher price.
The process will continue until the required amount is reached or the price limit is crossed.
All the trade in Ticks will be recorded.
The trading fee is recorded at each Tick and will not be added to the liquidity pool.
LP token holders have to claim to get their trading fee.
LP token holders have to claim to get their trading fee.
2/ Oracles
Uniswap V3 maintains a list of trade that happens in each Tick to 65536 data points.
Every data point contains price and time stay in the Tick.
A Time-weighted price will be written into Oracle and updated with every swap.
Uniswap V3 maintains a list of trade that happens in each Tick to 65536 data points.
Every data point contains price and time stay in the Tick.
A Time-weighted price will be written into Oracle and updated with every swap.
3/ Range Order
Users can specify the price range they want to swap in.
Just like limit order in the order book, Range Order prevents users from slippage.
The interface of Uniswap doesn't set a price range in Swap.
Range Order can be founded in protocols like Sorbet Finance.
Users can specify the price range they want to swap in.
Just like limit order in the order book, Range Order prevents users from slippage.
The interface of Uniswap doesn't set a price range in Swap.
Range Order can be founded in protocols like Sorbet Finance.
4/ Power of Concentrated Liquidity
A Tick can represent any part of the price curve.
We can replicate other CFMM (Constant Function Market Maker) functions with different Tick combinations.
A Tick can represent any part of the price curve.
We can replicate other CFMM (Constant Function Market Maker) functions with different Tick combinations.
How Replication works:
Every CFMM is a relationship of two tokens.
For Uniswap V3, liquidity L can be defined as the rate of change of y (dy) for a given change in the square root of price (βP) by tweaking the formula.
L = dy/dβP
source: paradigm.xyz
Every CFMM is a relationship of two tokens.
For Uniswap V3, liquidity L can be defined as the rate of change of y (dy) for a given change in the square root of price (βP) by tweaking the formula.
L = dy/dβP
source: paradigm.xyz
5/ Uniswap V3 as Perpetual Option
If we look at the single Tick position of ETH<>DAI, we can find the position will be:
β’ 100% ETH if the price is lower than the lower bound
β’ 100% DAI if the price is greater than the upper bound
This is similar to a covered call position.
If we look at the single Tick position of ETH<>DAI, we can find the position will be:
β’ 100% ETH if the price is lower than the lower bound
β’ 100% DAI if the price is greater than the upper bound
This is similar to a covered call position.
The price range of a tick can be seen as choosing Implied Volatility.
The trading fee will be seen as an option premium collected.
Selecting a fee tier can be seen as writing open with the different strikes because it affects the chance of trade happening in the pool.
The trading fee will be seen as an option premium collected.
Selecting a fee tier can be seen as writing open with the different strikes because it affects the chance of trade happening in the pool.
A general form of Implied Volatility calculated by LP position data is:
Implied Volatility = Ο = 2Ξ³β(Daily Volume/Tick Liquidity)
And we can calculate IV for each uniswap LP position.
source:@guil_lambert
Implied Volatility = Ο = 2Ξ³β(Daily Volume/Tick Liquidity)
And we can calculate IV for each uniswap LP position.
source:@guil_lambert
5/ Why LP lost money
A profit in an option selling position will be determined by the Implied Volatility.
If implied volatility turns out close to real volatility, then the chance of profit is high.
A profit in an option selling position will be determined by the Implied Volatility.
If implied volatility turns out close to real volatility, then the chance of profit is high.
The Implied Volatility in a pool is affected by Daily Volume and Tick Liquidity.
Chance is that the high TVL in a pool dilutes the fee collected and makes implied volatility low.
The option sellers (LP) do not get a fair gain to compensate for their risk, so they lost money.
Chance is that the high TVL in a pool dilutes the fee collected and makes implied volatility low.
The option sellers (LP) do not get a fair gain to compensate for their risk, so they lost money.
6/ New lens of looking at LP
β’ Impermanent Loss can be the price of low volatility
Like the classic 60/40 equity-bond portfolio, we can see LP position as a self-rebalancing 50/50 portfolio.
It has way lower volatility than the HODL strategy.
β’ Impermanent Loss can be the price of low volatility
Like the classic 60/40 equity-bond portfolio, we can see LP position as a self-rebalancing 50/50 portfolio.
It has way lower volatility than the HODL strategy.
β’ Borrowing LP tokens as buying an option
If holding an LP position is similar to holding a covered call option, then borrowing an LP token can be like holding a perpetual call option.
Interest paid to borrow can be viewed as premium pay for the call.
If holding an LP position is similar to holding a covered call option, then borrowing an LP token can be like holding a perpetual call option.
Interest paid to borrow can be viewed as premium pay for the call.
Takeaways
Personally, I think there might be a lot of potentials to build on top of Uniswap V3.
TL;DR
β’ Uniswap V3 can replicate all CFMM
β’ Selecting price and fee is like choosing IV
β’ Successful protocols like @perpprotocol, and @rage_trade are worth exploring.
Personally, I think there might be a lot of potentials to build on top of Uniswap V3.
TL;DR
β’ Uniswap V3 can replicate all CFMM
β’ Selecting price and fee is like choosing IV
β’ Successful protocols like @perpprotocol, and @rage_trade are worth exploring.
Here is my recommended list for reading:
Everlasting option: paradigm.xyz
Uniswap: the universal AMM: paradigm.xyz
Solid article by @guil_lambert:
lambert-guillaume.medium.com
The Replicating Portfolio of a Constant Product Market:
papers.ssrn.com
Everlasting option: paradigm.xyz
Uniswap: the universal AMM: paradigm.xyz
Solid article by @guil_lambert:
lambert-guillaume.medium.com
The Replicating Portfolio of a Constant Product Market:
papers.ssrn.com
paradigm.xyz/2021/05/everlaβ¦
Everlasting Options - Paradigm
Introduction This paper introduces a new type of derivative, the everlasting option. Everlasting opt...
lambert-guillaume.medium.com
Guillaume Lambert β Medium
Read writing from Guillaume Lambert on Medium. Asst professor in Applied Physics at Cornell. Lambert...
paradigm.xyz/2021/06/uniswaβ¦
Uniswap v3: The Universal AMM - Paradigm
Introduction Uniswap v3 (paper) allows liquidity providers to provide custom amounts of liquidity in...
papers.ssrn.com/sol3/papers.cfβ¦
I hope you found this research helpful, all the content I wrote is by reading docs and tracing source code.
I'd appreciate a Like/Retweet of the first tweet below if you can:
I'd appreciate a Like/Retweet of the first tweet below if you can:
@Uniswap Special thanks to @thedefiedge for the suggestion of writing tips.
Loading suggestions...