Unleashing the Power of Trader JOE's Liquidity Book #1
Exploring the Benefits and Differences of Trader JOE's Liquidity Book and Uniswap v3
Are you curious about the buzz surrounding Trader JOE's Liquidity Book, the cutting-edge liquidity pool design that has taken the DeFi world by storm? You're not alone. While it has been available on the Avalanche blockchain since August, many DeFi users only recently discovered Liquidity Book after it was deployed on the Arbitrum blockchain. So what is Liquidity Book, how you can get your hands on it, and what sets it apart from other options? In this article, I'll try to answer these questions and compare Liquidity Book to Uniswap v3. And if you're looking to dive even deeper, stay tuned for a future article on advanced Liquidity Book strategies.
Let’s start with “WTH is Concentrated Liquidity?
Since the inception of the x*y=k formula, which was a key innovation in the early days of decentralized finance (DeFi), there has been relatively little innovation in automated market maker (AMM) designs until Uniswap's introduction of concentrated liquidity in version 3 (v3). AMMs are an important part of DeFi, as they enable decentralized exchanges to provide liquidity to users without the need for an order book. Other AMM designs, such as those designed by Curve and Balancer, have also emerged, but they have not been as capital efficient as centralized order book exchanges (CLOBs).
In response to this challenge, Uniswap developed a hybrid model that combines elements of AMMs and CLOBs. Uniswap v2 allows liquidity providers (LPs) to specify a specific price range in which they want to provide liquidity, rather than distributing it across the entire price range of zero to infinity. This approach has proven to be very effective in increasing capital efficiency, but it still has some trade-offs, which we will discuss later in this paper.
Comparing LB with UniV3
Approximately a year and a half after the release of Uniswap v3, Trader JOE introduced Liquidity Book, a concentrated liquidity design that can also be described as a "modular liquidity" (i made it up, lol) system. The team at Trader JOE appears to have studied Uniswap v3 closely in order to create a competitive design. Liquidity Book is a new and improved AMM design that benefits both traders and liquidity providers.
In Liquidity Book, liquidity providers have the ability to select any price range in which they want to provide liquidity and earn fees, while traders can trade without experiencing price impact within the same price range or "bin." Price impact may occur when the active bin or price range changes. It may seem LB is similar to UniV3 at first but there are some major innovations and differences between them.
1- Token Standart
UniV3 uses NFTs (ERC-721 token standard) as liquidity token to describe and diversify LP positions. On the other hand Trader JOE’s LB uses a different type of token standard which is built specially for LB. It’s more similar to ERC-1155 but without NFTs. So you might be asking what are the pros and cons between those two options. Let’s cover it up.
Interoperability
The ERC-721 standard is used for non-fungible tokens, which means that each LP position is unique and non-composable. This makes it difficult to build protocols on top of them, such as autocompounders or aggregators, which limits interoperability. While there are some options available, such as Arrakis Finance for UniV3, the limitations of ERC-721 make it challenging to create new protocols and features.
On the other hand, ERC-1155 is more composable, as LP tokens are assigned an ID that matches the bin they are part of. Apart from that difference, ERC-1155 tokens behave much like ERC-20 fungible tokens, which increases interoperability. This means that protocols can more easily build new features on top of Liquidity Book compared to UniV3. One example is SteakHut Finance, which is developing a dapp to make LP management easier.
Gas Efficiency
One potential issue with using Liquidity Book is its gas efficiency. The ERC-1155 token standard used for LP positions requires a significant amount of gas due to the high number of tokens that must be minted. In contrast, Uniswap v3 is more gas efficient, as it only mints a single NFT to represent an LP position.
I want to add a bracket here; managing and composting multiple LB positions may be more cost-effective over a longer period of time than managing individual NFT positions in Uniswap v3.
2- Liquidity Type
In the second paragraph, I said I would rather describe Liquidity Book as “Modular Liquidity” rather than “Concentrated Liquidity” and now I’ll try to explain why.
Divide Type; Ticks vs Bins
Liquidity Book uses bins which “discretize” liquidity for describing prices rather than ticks. UniV3 uses ticks and “concentrates” liquidity at a range. Liquidity providers can use those bins to create their own sophisticated strategies on Liquidity Book. You might be thinking the same thing occurs for UniV3 too but remember, all different positions on UniV3 are different NFTs even at the same pool while Liquidity Book’s bins are compostable. You can compose or separate your positions to create different strategies.
Think of every bin as a box or a lego piece; you can build a tower with those lego pieces or you can build a deep pool. This makes it modular. You have modules, which are bins, and you can build anything you want with them.
Also u can think bins like a orderbook. There are some orders waiting on bins to get filled but those orders are staying there until the LP provider removes it. It do
Liquidity Position Control
Liquidity Book's modular design allows liquidity providers to have more granular control over their positions compared to Uniswap v3, which allows for positions to be spread out across a range. With Liquidity Book, an LP can directly intervene in their position at a specific bin, rather than a range.
Price Reflection
When it comes to price reflection, Uniswap v3's use of ticks and constant product formula allows for a wider range of prices on the bonding curve. In contrast, Liquidity Book pre-defines the price of bins and the price can only take the value of the bins, not the value between separate bins. This can make Uniswap v3 a more effective solution for price reflection.
Price Impact
Price impact is a common problem in primitive automated market maker (AMM) models, such as those that use the x*y=k formula. To mitigate price impact, these AMMs require deep liquidity, which means that there must be a large amount of supply and demand for a particular asset. Both Liquidity Book and Uniswap v3 are effective at reducing price impact, but Liquidity Book is able to completely eliminate it at the bin level.
In Liquidity Book, assets are distributed into bins as token X and token Y. The active bin contains both token X and Y, while the upper bins contain only token X and the lower bins contain only token Y. For the price to change, one of the tokens in the active bin must run out, at which point the price will move to the next bin. This means that price impact only occurs when the active bin changes, not while traders are trading within the same bin.
To illustrate this concept, consider the example of a liquidity pool with ETH and USDC. If the active bin contains both ETH and USDC, and traders are buying and selling within that bin, there will be no price impact. However, if traders sell a large amount of ETH for USDC, the active bin may run out of USDC, at which point the price will move to the next bin and the active bin will change.
3- Formulation
UniV3 uses variation of constant product formula “x*y=k” for specified ranges. Liquidity providers can specify a range for their capital and the liquidity may run out while price is changing; liquidity providers only have one of the tokens at last. Same thing occurs on Liquidity Book too but it uses a constant sum formula at bins; “x+y=k”. Which differences makes them? Let's find out.
Token Distributions on the LP
As a liquidity provider people can not choose the token ratio in the range on UniV3. If you put the Token X amount on the “Add Liquidity” page, the system fills the Token Y amount. However you can put your capital at a ratio as you wish on Liquidity Book.
Let's say you have 1k worth of tokens and you want to put some capital for ETH-USDC pair at the price range of 1200-1250 for both UniV3 and LB.
Univ3 calculates the ratio and lets you put a specific amount of both tokens at the range.
LB lets you put any amount of tokens to the range and then distributes it between the bins.
Capital Efficiency
At this level they both are good solutions for capital efficient with their unique designs. I just can say that constant product formula has a price effect even in a tight range while constant sum doesn’t have any price effect. Which makes it more favorable for traders. Also, constant product equation is more vulnerable for impermanent lose which is not gud for LP providers.
4- Impermanent Lose
Both Liquidity Book (LB) and Uniswap v3 (UniV3) offer features to help reduce the risk of impermanent loss (IL) for liquidity providers (LPs). These features include:
Range-based liquidity provision: Both LB and UniV3 allow LPs to specify a range within which they would like to provide liquidity, rather than having to commit to a fixed ratio between assets. This helps LPs to reduce their exposure to market movements and minimize the risk of IL.
Liquidity Book
Volatility accumulator: LB's internal mechanism measures market volatility and adjusts fees charged to traders in response. By increasing fees during high volatility and decreasing them during calmer periods, the volatility accumulator helps to reduce IL risk for LPs.
Tiered fees: LB also offers tiered fees, which are not permissionless and depend on the TJ core team.
Uniswap v3
Tiered fees: UniV3 allows LPs to choose one of three fee tiers: 1%, 0.3%, or 0.05%. This allows LPs to reduce their exposure to market movements and minimize the risk of IL. However, the trade-off of this tiered fee mechanism is that it divides liquidity and there are no more options beyond these three tiers. Additionally, there is no equivalent to LB's volatility accumulator to charge higher fees at times of high volatility.
In general, both Liquidity Book and Uniswap v3 offer mechanisms to mitigate the risk of impermanent loss, but the specific approach and effectiveness of these mechanisms may vary depending on the specific market conditions and the strategies employed by liquidity providers.
5- Pool Creation
Trader JOE currently does not allow the creation of random pools on its Liquidity Book platform. However, the team has recently implemented a governance model that allows new pools to be created, with the decision being left to holders of the $JOE token. An ongoing proposal to add the $yyavax-$avax pair to Liquidity Book is currently being considered.
On the other hand, Uniswap allows for the creation of any pool on its UniV3 platform, making it more decentralized in my opinion but as many of us know people can manipulate token prices on UniV3 while creating a buy-sell wall, specially on tokens with low volume. This might lead traders to get rekt and not suitable. I am considering this as a market risk and #DYOR thing. It is important for traders to do their own research and be aware of potential risks when trading on any platform.
In conclusion, Trader JOE's Liquidity Book offers a number of benefits over other AMM designs, including the ability for liquidity providers to select any price range in which they want to provide liquidity and earn fees, and the ability for traders to trade without experiencing price impact within the same price range or "bin." Additionally, the use of ERC-1155 tokens for LP positions allows for greater interoperability with other protocols, and the variable fee model based on the volatility accumulator helps to incentivize liquidity providers to provide liquidity in times of high volatility. While there are some concerns about the gas efficiency of Liquidity Book, the overall design appears to be a strong contender in the DeFi space and worth considering for both traders and liquidity providers.
Sources;
https://www.reddit.com/r/ethereum/comments/55m04x/lets_run_onchain_decentralized_exchanges_the_way/
https://arxiv.org/ftp/arxiv/papers/2111/2111.09192.pdf
https://uniswap.org/whitepaper-v3.pdf
https://avaxholic.com/how-does-liquidity-book-work-the-different-with-v3-of-uniswap/