135 subscribers
join
Rating
Login
Logout

Concentrated liquidity: Beginner Guide to Uniswap V3 & Liquidity Book

Crypto Education

Table of Contents

Concentrated liquidity AMMs maximize pool APR thanks to higher capital efficiency, but they can be difficult for newbies to understand.  Liquidswap is working on new concentrated liquidity pools, so it’s time to learn how it works on other major platforms like Uniswap, Trader Joe, PancakeSwap & Sushi.

TL;DR

  • Concentrated liquidity maximizes capital efficiency and earnings for liquidity providers. It lets you decide where on the price curve your funds should be traded.
  • The best-known Concentrated Liquidity Market Makers (CLMM) are Uniswap V3 and Trader Joe’s Liquidity Book. Concentrated liquidity pools account for 85% of the volume on Uniswap. You can earn up to 320% more this way, as your money constantly works for you instead of lying idly in a pool.
  • Concentrated liquidity is suitable only for experienced liquidity providers.
  • CLMMs use different approaches: Uniswap v3 has price ranges, where you pick a section of the price curve from point A to point B. Liquidity Book uses “bins” -- mini-pools within the main pool, where every step of the price corresponds to a new bin.
  • The advantage of Trader Joe’s approach is that within one bin, swaps happen with zero slippage and zero price impact. Once tokens in a bin are depleted, the contract moves to the next bin.
  • On the other hand, the Uniswap interface can be easier to use.
  • Uniswap V3 positions are represented as NFTs, which makes them more expensive to use than Liquidity Book’s fungible LP tokens.
  • Concentrated liquidity is suitable only for experienced liquidity providers. If the price exits the range, you won’t earn any fees. Because of this, you’ll have to rebalance the range frequently.
  • Another issue is impermanent loss: it can be several times higher on concentrated liquidity AMMs than on a regular DEX.
  • Liquidswap plans to introduce concentrated liquidity pools on Liquidswap in the near future. They will be roughly based on the approach of Liquidity Book.

What Is Concentrated Liquidity?

Concentrated liquidity is a DEX feature that allows users to allocate liquidity in a custom price range instead of along the whole possible range of prices. Platforms that have this functionality are known as Concentrated Liquidity Market Makers (CLMM), as opposed to simple Automated Market Makers (AMMs).

The feature was first introduced by Uniswap V3 in March 2021. In August 2022, Trader Joe, the biggest DEX on Avalanche, introduced its own version, called Liquidity Book  (arguably more efficient, but also a bit more complex, so we’ll start with Uniswap V3.)

Imagine the whole curve of potential prices for ETH-USDT: from $0 to huge valuations  like $200,000 for 1 ETH. (If that seems absurd, remember that LUNA went from $120 to $0.0002 in just a few weeks.)

When you deposit liquidity in a regular trading pool (called V2 on Uniswap), it is spread along the entire price curve. Think of a very, very thin layer of butter covering an incredibly long slice of bread. At both ends of the slice, the butter just sits waiting for someone to take a bite (make a token swap and pay a fee).

The problem is that almost all the eaters (swappers) bite from the middle of the sandwich, where the current price is. The further ends of the bread slice don’t generate any fees. Your capital is there, but it’s not generating any income.

What if you could spread your butter on just one section of the sandwich? You’d put it right around the current price where swaps are happening. Your liquidity would be working constantly, generating more fee income. In other words, your capital would be used more efficiently.

On Uniswap, this is possible with V3 pools, where you can choose the price range to deploy your funds, earning up to 300% more in LP rewards.

The Advantages of V3

  1. Less capital for the same gains

V3 pools on Uniswap allow you to deploy much less capital while earning the same amount in fees compared to a V2 pool.

For example, using a calculator for Uniswap V3, we can estimate that $10,000 in the ETH-USDT pool on V3 will give you the same returns as $50,500 in the V2 pool, as long as ETH trades between $1,200 and $2,900.

Credit: Uniswap blog
  1. Less slippage and price impact for swapper

V3 pools have deeper liquidity where it matters most: around the current price. Deep liquidity means less price impact and less slippage. Your swap will be executed at the price you expect, and even a large transaction won’t move the price by much.

In fact, research shows that Uniswap V3 has deeper liquidity for pairs like ETH/USDT and ETH/BTC than Binance and Coinbase combined.

Credit: Uniswap Labs
  1. Lower fees

On top of this, Uniswap V3 data shows that swapping fees tend to be a bit lower on V3.

Disadvantages of Concentrated Liquidity

  1. Rebalancing

For maximum earnings, you’ll need to readjust the price range regularly, making sure that the range includes the current price. Every rebalancing is a transaction that costs gas.

  1. Technical complexity

Concentrated liquidity AMMs aren’t designed for newbies, both Uniswap V3 and - especially - Trader Joe’s Liquidity Book with its liquidity bins, radiuses, and strategies.

  1. Time-intensive

You’ll need to spend time monitoring prices, adjusting ranges, studying strategies, etc.

  1. Impermanent loss

The impact of impermanent loss is larger.  That is, if the token price rises sharply, you’ll miss out on more gains relative to simply keeping the tokens in a wallet. (More on this below.)

  1. NFTs instead of LP tokens on some platforms

Uniswap V3, PancakeSwap, and Sushi all use NFTsto represent concentrated liquidity positions. It’s more difficult to integrate these  NFTs into yield farms and other DeFi protocols for additional earnings than with LP tokens. That’s one of the reasons why Liquidswap chose a different approach for its upcoming concentrated liquidity pools on Aptos, which will use regular LP tokens.

How Concentrated Liquidity Works In Uniswap V3

V2 and V3 pools are different and separate. V3 pools are used by default for swaps whenever a V3 pool is available. If you open the router settings in the swap details, you’ll probably see it says V3. However, if the router finds that the price in the V2 pool for the same pair is better, it will offer the user to switch to V2.

The Pools section, too, prioritizes V3. If you want to deposit funds in a V2 pool, you’ll need to open the More dropdown and choose V2 Liquidity. The complete list of V2 pools can be found  here.

V3 and V2 pools use the same constant product function x*y=k, where X and Y are the amounts of the two tokens in the pool and k is a constant. See our article on liquidity pools for an explanation.

Every V3 position is represented by an NFT. An NFT is minted when you open a position and burned when you reclaim liquidity. You can trade these V3 NFTs on marketplaces like OpenSea.

In V2, there was just one swap fee of 0.30%. But V3 has four fee tiers: 0.01%, 0.05%, 0.30%, and 1%. The DAO of UNI holders can vote to introduce new tiers, which was how the .01% fee tier came to be.

0.01% and 0.05% are best for stablecoin pairs, 0.30% is the most common for uncorrelated pairs, and the 1% fee is used for pairs with lower liquidity and volume where providers would otherwise struggle to earn a decent APR from fees. There can be up to four V3 pools for the same currency pair, depending on the fee tier. However, most of the liquidity tends to accumulate in just one of them.

A liquidity provider earns fees only when their range includes the current price. To keep earning an APR, you need to monitor the price and adjust the range when needed. This is called “rebalancing.”

Rebalancing is costly on Ethereum, because every range adjustment costs gas. For smaller positions, rebalancing fees can easily outstrip the pool APR. Luckily, Uniswap also runs on Polygon and other low-cost chains.

An alternative is to set a wide range and leave it without rebalancing. This is  called a “passive position,” and it will still usually be more efficient than a V2 pool. There’s even a Full Range setting that covers the whole price curve.

When choosing a range, it’s important to consider historical volatility for the chosen pair. If the price moved by 10% or 20% in a day on some occasions, the range should be wide enough to accommodate such swings. For stablecoins, a narrow range (like 0.995-1.005) is usually fine. You can open many positions in the same pool, each with a different price range.

In V3, you don’t always have to deposit equal amounts of both tokens, as you do in V2 (e.g. 100 USDT and 100 USDC). The  range and amounts can be asymmetrical relative to the current price. If you set a range that doesn’t include the current price, you’ll need to deposit just one token.

The smallest step between prices is called a tick. The tick size is different for each cryptocurrency.  When you drag the range slider, it will move from one tick to the next, so you may not be able to set an exact price.

As the price nears one of the ends of the range, the reserves of one of the tokens will be depleted. When the price moves outside of the range, the whole position will be converted to just one token.

If you already provide liquidity on Uniswap V2, there is a handy migration tool. We are planning to introduce the same migration feature when Liquidswap launches concentrated liquidity on Aptos.

How To Become A Liquidity Provider On Uniswap V3

  1. Pick a chain and connect a wallet. Uniswap works on Ethereum, Polygon, Arbitrum, Optimism, BNB Chain, and Celo. Supported wallets are MetaMask, Uniswap Wallet, Coinbase Wallet, and WalletConnect.
  2. Make sure you have enough money for gas fees. Apart from the actual liquidity deposit (minimum $20-25 in May 2023 on Ethereum), you may have to pay a gas fee for approving a token ($3-5) and swapping ($3-5). If you plan to deposit $100 in liquidity, doing so on Ethereum probably doesn’t make sense. Consider a lower-fee chain like Polygon or Arbitrum instead.
  3. Choose a pool. The official Uniswap analytics page doesn’t display the APR, only the TVL, volume, and fees. However, there are many third-party tools for calculating returns, such as Metacrypt, Flipside, and Uniswap Fish. Note that V3 mostly supports bigger pools, while new tokens usually launch on V2.
Credit: Metacrypt
  1. Decide on the range. If you are a beginner, consider Full Range, or a range that has room for a 30-50% price drop and a 50-100% increase for bigger tokens. With a wider range, you’ll earn less in fees, but you won’t have to rebalance often and will suffer less impermanent loss.
  2. Select the fee tier. By default, Uniswap will pre-fill the most popular fee tier --, for ETH-USDC it’s 0.05%, selected by 58% of liquidity providers. However, you can see the proportion of LPs that are using each tier.  (like 41% for .3% in this example).
  1. Swap if needed. Uniswap will show how much of token X and token Y you need for the chosen range and fee tier. For the Full Range, it will usually be 50/50, but not necessarily. If you don’t have enough, swap some.
  2. Approve the tokens if prompted. There’s a gas fee to pay for this (around $5 on Ethereum in early May 2023).
  3. Preview and confirm. You can also edit the gas fee in MetaMask if you’d rather save money and wait longer.
  4. Your new liquidity position will appear on the Pools page.

Concentrated liquidity, trading volume, and APR

Numbers show that V3 trading with liquidity ranges now dominates on Uniswap. As of May 2023, V3 pools account for 90% of the daily trading volume on Uniswap. For stablecoins, the stats are even more dramatic: 99% of volume is in V3 pools.

Credit: @mtitus6 on Dune Analytics

There is also a huge difference in the number of monthly active users: over 1.4 million on V3 and only 18,000 on V2.

It’s interesting, though, that V2 still dominates in terms of the number of swaps (65%). This is because most currency pairs are available only on Uniswap V2. V3 has far fewer pools, but they are the most popular ones with the highest volume.

So what about the APR? A research paper found that the average returns for V3 providers were between 22.8% and 324% higher than for V2 providers, depending on the pool and the fee tier.

The returns are higher even for passive providers who use the Full Range setting and never rebalance their positions. In pools with the 1% fee tier, passive positions yield 80% higher returns than in V2; for V3 pools with a 0.30% swap fee, the APR is 16% higher; and in stablecoin pools with a 0.01% fee, V3 LPs earn 160% more! The only fee tier where V3 providers are at a disadvantage is 0.05% (68% lower fees per $1 deposited).

But before you get excited by the much higher APR, we need to consider the elephant in the room: impermanent loss (IL).

Concentrated liquidity and impermanent loss

Concentrated liquidity as trading on leverage

This may seem like a strange idea at first, but bear with us.

When trading on leverage, a user borrows money from an exchange in proportion to their own capital (like 5x or 10x). As a result, they can open larger positions and make higher profits. A 5% profit on the trader’s own $1,000 account would be $50, but when operating on a 10x margin, the same 5% is $500.

The risks are amplified, too, however. Losing 5% of your own $1,000 position means losing 5%. But on 10x leverage, it’s $500, or 50% of your capital. Trading on leverage exposes you to significantly increased risk for the possible rewards.

With concentrated liquidity, you can also make larger gains with the same amount of capital. Remember the example from the V3 calculator? Depositing $10,000 in the ETH-USDT pool with a $1,200-$2,800 range for ETH will give you the same returns as $52,000 in the V2 pool for the same pair. Earned fees per $1 deposited is 5.2x higher --  effectively the same as operating on  5.2x leverage.

As the price range gets tighter, the “margin” gets higher. With a $1,300-2,400 range, you’ll earn 7.1x more in fees per each dollar; in the $1,400-2,300 range, 8.5x, and so on.

The bad news is that risks are also amplified, just like in margin trading. One of these risks is impermanent loss.

Impermanent loss in CLMM

Impermanent loss (IL) is a decrease in the value of a liquidity position compared to the hypothetical situation where the user holds them in a wallet without depositing them in a pool.

IL occurs because the token prices change. If the prices were to return to where they were when the user first deposited the liquidity, IL would disappear. That’s why it’s called impermanent. But this term is somewhat misleading, because when you withdraw liquidity (plus the fee rewards) and realize that you could have earned more if you had simply held the tokens in a wallet, the missed gain is real -- and permanent.

IL isn’t necessarily a loss, because you’ll have hopefully earned money from trading fees. Rather, IL is a type of opportunity cost. Ideally, you would earn more from fees than you miss out on from  impermanent loss, but this is often not the case.

On AMMs with concentrated liquidity, the impact of IL is several times higher for the same change in prices, depending on the width of the range. This is demonstrated in an excellent blog post by the Auditless founder Peteris Erins, who used the original liquidity formula from the Uniswap V3 White Paper (page 2). We’ll spare you the derivation here and provide just the end result.

Here, IL(a,b)(k) is the impermanent loss in V3 for a range that spans from Price a  to Price b. IL(k) is the impermanent loss for a V2 position that covers the full range, and n characterizes how large the range is. For n=2, you have a range where the starting point Pa is half the current price P and the end point Pb is double, so even if the price falls by 50% or grows by 100%, you’ll still be earning fees. The ratio 1/(1-(1/√n)) in this case equals:

1/(1-(1/√2))=1/(1-(1/1.414))=1/(1-0.707)=1/0.293=3.41

Simply put, the impact of impermanent loss will be 3.4 times higher with concentrated liquidity, even for a fairly wide range. And the narrower the range (when n is smaller), the bigger the IL. It’s the cost of higher capital efficiency.

Credit: Peterins Erins

Will you personally face impermanent loss on Uniswap V3? Probably. According to a 2021 report, 49.5% of V3 liquidity providers faced net negative returns when IL was taken into account, even with high APR.

How can you offset impermanent loss? One way is through yield farming. Another way is through variable swap fees that go up when volatility increases. This is implemented in Trader Joe’s Liquidity Book, which also features so-called liquidity bins instead of price ranges.

V3 Concentrated Liquidity Is Forked to BNB Chain, Coming Soon to Zksync

Uniswap V3 is already available on Ethereum, Arbitrum, and Optimism, and soon you’ll find it on major zkEVM platforms. On April 14, the Uniswap DAO voted to deploy on Polygon’s Hermez, which we  projects covered in our detailed zkEVM guide. It should also soon launch on zkSync Era.

What’s more, third-party developers can now fork V3. It was protected by a Business Source License (BSL) for two years, but on April 1, 2023 the BSL expired and the code for Uniswap V3 became open-source. PancakeSwap immediately took advantage, launching concentrated liquidity on BNB Chain, where gas fees are around 20x lower than on Ethereum.

SushiSwap also forked Uniswap V3 on Ethereum, Polygon, Arbitrum, and Optimism, and announced plans to deploy concentrated liquidity on 30 blockchains.

Here at Pontem, we chose a different approach for concentrated liquidity on Liquidswap. Our V.1.0 pools will take inspiration not from Uniswap, but from the more capital-efficient Liquidity Book CLPP, made by TraderJoe on Avalanche.

Liquidity Book: a new solution to slippage, price impact, and IL

How Liquidity Book works

  1. Liquidity Book is a concentrated liquidity AMM that powers TraderJoe, the biggest DEX on Avalanche. The new V.2.1 launched in April 2023. It’s also live on Arbitrum and BNB Chain.
  2. The TVL of V.2.1 went from 0 to $37 million just 3 weeks after launch.
Credit: DeFiLlama
  1. On Arbitrum, Liquidity Book generated over $100 million in volume on ARB trading after the Arbitrum airdrop.
  2. Instead of ranges, Liquidity Book uses liquidity bins: a sort of pool within a pool. Every bin corresponds to a specific price level, and the price difference that separates one bin from the next is called the bin step.
  3. The pool creator decides how big the bin step should be, but usually the more volatile a pair, the bigger the step.
  4. Regular users can’t create new concentrated liquidity pools.This will change in Liquidity Book V.2.1.
  5. At any point, one bin is active: the one that corresponds to the current price. The tokens for the swaps are taken from this bin, and once it’s empty, the smart contract switches to the next one, which becomes active.
  6. You earn LP rewards only when you have money in the active bin. In V.2.1, the rewards are compounded into the active bin.
  7. While trading within the same bin, there is no price impact and no slippage. This is a big advantage of Liquidity Book.
  8. When you deposit liquidity in a bin, you’ll get special fungible tokens (not NFTs like on Uniswap V3).
  9. You can choose a price range or bin radius (the number of bins to be included in a position).
  10. There are several strategies depending on the maximum bin radius and how tokens are distributed among them: Spot, Curve, and Bid-Ask.
  11. Rebalancing consists of moving funds from one set of bins to another. Luckily, Avalanche has low gas fees (less than $0.30 on average), so rebalancing is affordable.
  12. V.2.1 will introduce Autopools - dynamic strategies that are automatically rebalanced. There will also be yield farms for Autopools.
  13. Liquidity Book has only one fee tier per pool (compared to  Uniswap’s four).
  14. To compensate liquidity providers for impermanent loss, swap fees go up when volatility is high, so that LPs earn more. This is called Surge Pricing.

Advantages of Liquidity Book

  • Zero slippage or price impact in the active bin
  • Fungible LP tokens, which are cheaper and easier to transact with than NFTs
  • Fluctuating swap fees to compensate for impermanent loss
  • Autopools (coming soon) -- dynamic strategies that don’t need rebalancing
  • Better control over where your funds are deployed (thanks liquidity tobins)

Disadvantages

  • More complicated for beginners than Uniswap V3 because of the various strategies and the concept of bins
  • No Full Range option
  • Adding liquidity in a wide range requires several transactions, meaning more gas fees

Liquidity Bins in Detail

The whole pool still uses the constant product formula x*y=k, but inside each bin, a different formula is used: P*x+y=k, where P is a price constant that’s unique to each pool. Basically. you add X tokens and take out Y tokens, or vice versa, until there is just one type of token left.

All bins except for the active one contain just one type of token (X or Y), because they’ve either been depleted or are waiting to be used. For example, in the APT-USDT pool, you’ll be able to add only APT or only USDT to inactive bins. You can also deposit just one type of token to the active bin, and part of it will be automatically swapped for the other.

Only the active bin earns trading fees. Your goal as a liquidity provider is to make sure that you have funds in the active bin. You can spread the capital across a number of bins to cover the price range where you expect a pair to trade. If the price goes to a bin where you don’t have any tokens, you won’t earn any fees.

The key difference between a price range and a price bin is that the same price can be part of any number of price ranges, but only one bin. For example, the price of 11 USDT -1 APT can be included in ranges like 10-15 USDT, 8-20 USDT, etc. But there will be a single bin that contains that price.

What is Bin Radius?

  • Bin radius is the number of liquidity bins on either side of your target price. In the Add Liquidity interface, the target price is set to the current market price by default, but you can change it.
  • Your liquidity position will span 2x of the radius: if you set the radius to 20 bins, the position will cover 40.
  • Example: The current price is 11 USDT for 1 APT and the bin step is 0.03. If you set the radius to 1, the range of the position will be from 10.97 USDT to 11.03 USDT. If the radius is 10, your position will cover 10.7 USDT to 11.3 USDT.
  • To compensate liquidity providers for the high risk of impermanent loss, Liquidswap introduces special variable fees. When volatility is high, the swap fee automatically increases to ramp up liquidity providers’ earnings. And when volatility goes down, so do the fees. Liquidswap measures volatility based on how often the price moves from one liquidity bin to the next.
  • The variable fee structure is different for different pools. There is also a cap on the total fee to keep it fair for swappers.
  • Remember that even with variable fees, you can still experience impermanent loss. Even if you actively rebalance your positions, IL is a real risk.

How Much APR Can You Earn With Liquidity Book On TraderJoe?

The concentrated liquidity APR on TraderJoe reaches 180%, though this number is calculated based on the past 24 hours and can fluctuate a lot. Also, you need to always have liquidity in the active bin to earn the full APR, and even then impermanent loss can eat up some of the gains.

Here is an important rule that goes for all DEXs: the current APR is never a guarantee (or even an indication) of future gains. It’s there for information purposes only.

Innovations in Liquidity Book V.2.1

On April 12, Trader Joe announced a massive upgrade of Liquidity Book to V.2.1. Users will need to migrate liquidity to take advantage of the new features. Among the main changes:

  • Rewards for JOE stakers. Up to 25% of the fees collected by Liquidity Book pools go to users who stake their JOE in the sJOE product.
  • Autopools. These are automated “liquidity-as-a-service” strategies for those who don’t want to spend time on rebalancing. An Autopool rebalances liquidity automatically: when volatility is low, your tokens will be concentrated around the active bin. But when volatility increases, they will be spread wider. Autopools weren’t live yet as of May 4.
  • Autopool Farms. Autopools will issue special LP tokens that can be easily deposited in yield farms. Right now Trader Joe doesn’t have farms for concentrated liquidity pools - and neither does Uniswap V3, by the way.
  • Permissionless pools. Users will finally be able to create concentrated liquidity pools for any token in pairs with AVAX, USDC, and a few other whitelisted assets.

Price curve shapes and strategies

When using liquidity bins on TraderJoe, you can choose one of the three options for the price curve shape: Spot, Bid-Ask, and Curve.

Concentrated liquidity is coming soon to Liquidswap on Aptos

Pontem’s team is working hard on a concentrated liquidity solution for Liquidswap, which we’re calling V.1.0 pools. This will be the first concentrated liquidity implementation on Aptos! As we said, they will be broadly based on Liquidity Book.  We hope to release the new pools in Q2 2023, so stay tuned!

Of course, once the V.1.0 pools are ready, we will publish a detailed tutorial. For now, we invite you to explore our V0.5 and V0 pools, with APR up to 30-40%. And don’t forget to give us a follow on Twitter, Discord, and Telegram for more product updates!

About Pontem

Pontem Network is a product studio building foundational dApps for Aptos. Our products include:

Install our wallet and try DEX

Related posts

concentrated-liquidity-beginner-guide-to-uniswap-v3-liquidity-book
64650c76cee73818c447c723
amb-concentrated-liquidity-beginner-guide-to-uniswap-v3-liquidity-book