Cover photo

Curve x Uniswap V3

Centralized cryptocurrency exchanges emerged shortly after Bitcoin was introduced. At that time, people began trading Bitcoins on forums and IRC, which required a high level of trust between the parties to hold up their end of the bargain. With centralized exchanges, much of the trust is in the hands of managers and shareholders. Recent events have shown that centralized services can go bust, resulting in immense losses for asset holders. With the rapid development of blockchain and dApps, decentralized exchanges became one of the first use cases. The DeFi ecosystem became the biggest disruptor in traditional financial world, redirecting profits from managers and shareholders to DeFi users through new and decentralized entities that never existed before.

Today, we are well acquainted of two decentralised exchanges that play a crucial role in the DeFi ecosystem - Uniswap and Curve Finance. Uniswap is the oldest of them and has successfully validated product-market fit. Both Sushiswap and Pancakeswap are a fork of Uniswap. Curve Finance was founded in 2020 with the intention of improving the AMM used by Uniswap in order to achieve lower fees and minimal slippage in token trading.

Networks & TVL

Both Uniswap and Curve are dApps that interact with numerous L1 protocols (e.g. Ethereum, Avalanche, Polygon), and L2 rollups (e.g. Arbitrum, Optimism). Users can connect to them via wallets (e.g. Metamask). However, not both DEXs are connected to the same chains. Uniswap is available on Ethereum, Polygon, Optimism, and Arbitrum - the latter two are still in beta, which means downtime is possible. Curve Finance can be accessed on Ethereum, Arbitrum, Avalanche, Fantom, Harmony, Optimism, Polygon, xDai, and MoonBeam. Both DEXs have gained a lot of traction since their launch and have been forked into new projects (e.g. SushiSwap is a Uniswap fork, Ellipsis is a Curve fork).

Uniswap's total locked value is $5.14 billion, with 97% of its assets locked on the Ethereum chain. Curve has a total locked value of $5.17 billion, with 88% of assets locked on the Ethereum chain.

Purpose of existence

At first glance, Curve and Uniswap might appear to be the same product, but in reality there are several differences that make them unique for different types of DeFi activities. Uniswap liquidity providers can create and participate in liquidity pools with ERC-20 tokens, while Curve's liquidity pools are reserved more for stablecoins (e.g. USDT - USDC) and pegged coins of equal value (e.g. ETH - stETH). Both Uniswap and Curve are AMM-based decentralised exchanges that allow assets to be traded through liquidity pools. In this way, Uniswap and Curve diverge from centralised exchanges that use traditional order books that link buyer to a seller. However, the two DEXs differ in their AMM (constant product function) implementation to achieve different degrees of flexibility.

Automated Market Makers (AMM)

We know that a market exists only if there are people who want to buy products and people who are willing to sell them. Uniswap and Curve, which are both AMM-based decentralised exchanges, create markets by incentivizing the provision of assets into liquidity pools in exchange for capital gains. Liquidity pools enable permissionelness asset trading in exchange for a certain fee, which is later distributed among liquidity providers.

To fully understand how AMM differs between Uniswap and Curve, we need to look at the underlying mathematics. Both Uniswap's and Curve's AMM can be represented by the following formula:

X • Y = k

X = quantity of A tokens in pool Y = quantity of B tokens in pool k = constant

The above formula determines the ratio between asset A and asset B. Whenever a trade occurs, this formula performs a price adjustment, which means that whenever a trader withdraws asset A and deposits asset B, the price of asset A becomes higher and the price of asset B becomes lower, due to constant, which always reaches the equilibrium. Price adjustments can create arbitrage opportunities, i.e., assets in liquidity pools can have a lower price than the same asset on other exchanges. This gives traders an incentive to buy assets at a lower price and sell them on exchanges where the price is higher, leading to the creation of a new equilibrium within the liquidity pool that matches prices on other exchanges. When we talk about AMMs and liquidity pools, we need to consider both impermenent loss and slippage. The liquidity provider incurs impermenent loss when the price of the deposited assets falls below the price at which he deposited. This is quite common for liquidity pools with highly volatile assets, but less so for liquidity pools with stablecoins. Note that the loss is impermenant because there is a probability that the price will return to the original deposit price. This loss becomes permanent only if the liquidity provider removes assets from the liquidity pool before the price returns to the same level. In addition, slippage can occur when trading in liquidity pools if the price of the executed trade deviates from the target price. This is particularly common for trades in liquidity pools where whales (e.g. large/institutional investors) execute their trades that strongly influence the determined price within the pool. Impermanent loss and slippage are most substantial in decentralised AMM exchanges such as Uniswap. Let us now take a look at how Curve has decided to combat all of these issues.

By tweaking their AMM formula (flattening of function), Curve aims to eliminate or at least minimise the impact of impermenant loss, slippage, and fees. Curve has developed AMM that focuses on stablecoins (e.g. DAI-USDT) and pegged coins of equal value (ETH -wETH). In this way, Curve has created several advantages for its users. Because the prices of the assets in the pool are less likely to change or diverge from one another, the risk of impermenant loss is significantly lower, but not completely eliminated - small price adjustments or outright collapse are possible if a particular provided stablecoin were to lose its dollar-pegged value due to insufficient collateral. In addition, Curve enables interest to be paid on staked LP tokens which in reality fights back the impermenant loss if it were to occur. With a similar price and a large number of assets deposited in the liquidity pools, the price volatility remains minimal. This makes the Curve decentralised exchanges substantially more attractive to large traders, as the low price volatility makes them less prone to slippage.

Providing liquidity and liquidity pools

As noted above, AMM-based decentralised exchanges depend on the liquidity of assets provided by LPs in pools. Both Uniswap and Curve use liquidity pools to facilitate trading, but there are several differences between the two.

Anyone using Uniswap can create liquidity pools or add liquidity to existing pools. Liquidity providers on Uniswap can offer only a single pair (2 tokens) within the pool (e.g. DAI-USDC) or a single token. Uniswap V2 allowed liquidity to be provided in a 50/50 value ratio (e.g. $1000 of ETH & $1000 of DAI) across the entire price curve (from 0 to infinity). This is particularly impractical when providing stablecoins to the pool, whose price typically fluctuates between $0.99 and $1.01. This means that most of the liquidity provided was allocated inefficiently, with the natural exposure to risks of such coins (e.g. stablecoins depegging, impermenant loss). Uniswap V3 brought an impressive improvement with concentrated liquidity to improve overall capital efficiency.

But what is concentrated liquidity? When providing liquidity, providers set their position (price range) by determining the minimum and maximum price at which they are willing to provide the liquidity. Liquidity providers can create multiple positions within a pool and create individual price curves. For example:

Alex decides to provide liquidity to ETH-DAI pool. Based on the historical price movements, he decides to provide liquidity in two different positions:

  • Provide 0.1 ETH and 100 DAI in the price range $1,000 - $2,200, and

  • Provide 0.5 ETH and 50 DAI  in the price range $1,400 - $1,800.

Uniswap V3 combines the liquidity from individual positions and do not charge anything extra to traders as all asset come out from the same pool.

Provided liquidity through whole price curve VS provided liquidity in position
Provided liquidity through whole price curve VS provided liquidity in position

But where does Uniswap actually improve capital efficiency? Let’s look at the example.

Lara wants to provide 20x higher liquidity than Marko in ETH-DAI pool. Lara chooses to provide liquidity across the entire price range, while Marko chooses to provide liquidity between the price 2,000 DAI and 2,900 DAI. The two earn the same fees as long as the price of ETH stays between 2,000 DAI and 2,900 DAI despite Marko providing substantially less liquidity*. This means that Marko has 20 times more efficient working capital than Lara. Let's also consider the risk. If ETH was to fall to 0, Lara would lose substantially more capital than Marko.*

Price moved outside the set position
Price moved outside the set position

In case the price moves outside the set position, two things usually happen. First, the liquidity is removed from the pool thus the liquidity provider receives no trading fees. Second, the liquidity provider remains entirely with the less valuable of the two coins (remember ETH, which goes to 0 in the example above?) until the market price moves back into the specified range/position.

But how does Uniswap actually determine the ratio of the two coins in providing liquidity? That depends on three things:

  • Current market price,

  • Determined maximum price, and

  • Determined minimum price.

The farther the fixed minimum or maximum price is from the current market price, the more liquidity of the token we have to provide. If the liquidity provider sets his position completely below or above the current market price, we discuss about range order. This means that he sells one coin for another along the curve and receives fees for doing so. In such case, liquidity provider deposits only one token of the pair. This is comparable to a limit order on centralized exchanges.

As we mentioned earlier, liquidity providers earn interest on the liquidity provided in liquidity pools. Uniswap has a 4-tier fee system.

Uniswap Trading Fees
Uniswap Trading Fees

As liquidity providers provide assets to which they are exposed to (e.g. price change), they must be compensated for the underlying risk, and therefore different fees are incurred when trading different pairs. The fees collected are distributed among liquidity providers in proportion to their share of the liquidity provided. Uniswap does not charge any protocol fees by default, but they can be enabled and a portion of the trading fees is redirected from the liquidity providers. The protocol fee can be enabled through a protocol governance vote with UNI tokens and set between 10% and 25%.

Now let's take a sharp turn to Curve, which seems difficult to navigate through due to the UI that reminds us of the 90s, but is actually more straightforward than Uniswap. As mentioned earlier, there are similarities between the two DEXs, but there are also certain differences when comparing them. Similar to Uniswap liquidity providers, Curve liquidity providers can choose between existing pools or create a new pool with the introduction of the Pool Factory (some requirements apply).

Unlike Uniswap, Curve allows liquidity providers to bundle up to 4 tokens in a liquidity pool. Curve contains 3 types of pools:

  • Plain pools - bundling up to four ordinary ERC20 tokens in one pool. Part of these pools are also TriPools (or 3Pools), the largest of which contains DAI/USDC/USDT,

  • Meta pools - pools with underlying 3Pool that allow adding a token with low liquidity (small-cap token) to be traded with stablecoins without heavily affectingthe prices of the stablecoins, and,

  • Lending pools - these pools are connected with completely separate protocols that allow users to borrow and lend tokens through Compound, Yearn, Aave, and dYdX. Those providing liquidity in such pools earn interest from these DeFi protocols. Curve is able to redirect lent tokens from one protocol to another with better rates.

It does not matter if the liquidity provider deposits only one of three tokens, he is still exposed to all three tokens allocated within the pool. Liquidity providers should only deposit funds if they are comfortable with all underlying assets.

Compared to Uniswap, Curve's trading fees are lower, but liquidity providers are compensated by low volatility and high-interest rates from lending protocols. Before we get into specific numbers, let us understand why Curve DEX operates with lower fees. Curve liquidity providers are not exposed to the same risk as Uniswap liquidity providers. Of course, a smart contract may not work or a stablecoin can depeg, but the general price volatility of stablecoins is not something we consider in Curve pools. Therefore, liquidity providers are compensated with a maximum fee of 0.04% on each trade. The trading fee includes Curve protocol fee and cannot be excluded. 50% of the trading fees go to the Curve protocol (Curve DAO) and the remaining 50% goes to the liquidity providers. In addition to the trading fees, there are also deposit and withdrawal fees paid by the liquidity providers when deposits or withdrawals do not balance. These fees are usually set between 0% and 0.02% to protect the protocol from trading tokens through liquidity providing. Uniswap does not incur such fees.

Previously, we discussed how pools lose their equilibrium when the ratio of assets in the pool changes - creating an arbitrage opportunity. Curve not only solves this problem by adding more tokens with a lower ratio through liquidity providers but also incentivizes traders to deposit such tokens in exchange for a deposit bonus.

LP Token

When liquidity providers deposit tokens into a pool on Uniswap or Curve, they receive a LP token. These LP tokens represent a portion of the liquidity they provide in the pool and are stored in wallets. Whenever providers want to withdraw the deposited liquidity, they have to redeem (burn) the LP token. However, a key difference between Uniswap and Curve is what providers can do with their LP tokens.

Prior to the launch of Uniswap V3, Uniswap liquidity providers received an ERC-20 LP token minted by the protocol. They redeemed it to withdraw liquidity plus fees. The trading fees were directly deposited back into the liquidity pool and remained there until the provider decided to proceed with the withdrawal. This was an appropriate solution because liquidity providers were depositing liquidity across the whole price curve. Remember we discussed about the new feature of Uniswap V3 where liquidity providers can set their own position (minimum and maximum price) at which they are willing to provide liquidity? This is why ERC-20 tokens are no longer suitable due to the non-fungible nature of the positions. With Uniswap V3, liquidity providers will receive an NFT.

LP NFT minted by Uniswap
LP NFT minted by Uniswap

In addition to the switch to non-fungible (ERC-721) tokens, the protocol has also changed how fees are distributed. Fees are now collected and held by the protocol pool as individual tokens instead of being automatically reinvested as liquidity.  With Uniswap’s LP token, liquidity providers are not able to earn additional profits other than redeeming the LP and withdrawing.

Before we focus on how Curve's liquidity providers benefit compared to Uniswap, let's take a look at the following two photos.

Uniswap confirm deposit
Uniswap confirm deposit
Curve confirm deposit
Curve confirm deposit

While you can deposit tokens at Uniswap, you have two options at Curve: Either you do a regular deposit (as with Uniswap) or Deposit & stake in gauge which is Curve's specialty, which we will look at next.

If a liquidity provider chooses Deposit, he receives ERC20 LP tokens. He can use this to redeem the liquidity plus fees. If he chooses Deposit & stake in gauge, the protocol takes the LP token away from the provider and puts it in the pool's liquidity gauge to earn CRV token rewards (CRV is Curve's governance token). Earned CRV tokens can be withdrawn at any time without removing the provided liquidity from the pool. You can sell CRV on exchanges or proceed as follows.

Curve allows you to boost your rewards from providing liquidity when you lock CRV tokens. Let us see the example.

Curve pool 3pool USDT + wBTC + WETH
Curve pool 3pool USDT + wBTC + WETH

We are looking at 3pool, which facilitates the exchange of USDT, wBTC and WETH. The Base vAPY (variable) comes from the trading fees, and the Rewards tAPR indicates how many CRV tokens you can expect with or without boost - users can boost it by a factor of 2.5. The boost factor depends on both the amount and the time for which the CRV tokens are locked. In the above case, boosted rewards return 13.7% of CRVs. When CRV tokens are locked, the holder receives veCRV (voting escrow CRV) and the longer he locks them, the more veCRV he receives. Each CRV that is locked for four years is equal to 1 veCRV. In summary, veCRV allows the holder to vote in governance (Curve DAO), boost CRV rewards, and receive trading fees.

Governance

Both DEXs follow their own governance strategy via DAO (decentralised autonomous organisation) with native tokens minted and distributed in very different ways. DAO is the backend system supported by apps such as Discord, Twitter, Telegram, Medium, and others.

The governance token of the Uniswap is UNI, which was released in September 2020. There will be a total of 1 billion UNI tokens distributed in four years since launch, which means that UNI holders will face inflation that can be fought with the appropriate utility of the token & total trading volume on Uniswap DEX. To date, there are over 734 million tokens in circulation. Since its all-time high in September 2021 ($44.97), the value of the token has dropped significantly, matching this bear market we are living through. At the time of writing this blog post, the price of the UNI token is $5.04. Uniswap DAO members (UNI holders) can vote casting their vote for proposals created by the Uniswap community. Any UNI holder can submit a proposal, but it must receive at least 25,000 YES votes for the Uniswap DAO community to make a final decision. Traders can purchase UNI tokens on all major centralised and decentralised exchanges.

Curve protocol governance token is CRV, which was released in August 2020 with the launch of Curve DAO and has a higher level of perfection compared to UNI token, considering CRV tokenomics. The logic behind this token is different from UNI token. The CRV token is used for governance, incentive structure, and fee payments, and enables a long-term earnings method for liquidity providers. Overall, the Curve DAO will have a maximum supply of 3.3 billion tokens, with 53% already in circulation. The CRV token had its all-time high at launch when it was worth $60.50, but since then it has dropped significantly to today's value of $0.83. CRV token holders can make proposals on Curve DAO with at least 2,500 veCRV tokens in their wallet.

Conclusion

So, where do you want to go next? Depending on how familiar you are with decentralised exchanges, I suggest you start with Uniswap. Uniswap's UI is really a no-brainer compared to Curve. Take a look around the site and familiarise yourself with the terms I talked about in this article. Buy some ETH and send it to your wallet - you will have some costs, but nothing dramatic. Whatever you do, avoid using the Ethereum network to learn how to use the interface as the fees are extremely high - you do not want to pay $100 for a single transaction, do you? Use ALT L1 like Poygon or L2 rollups like Arbitrum. Whatever questions you have - Google and YouTube are your best friends to get answers.

Since you need to be careful not to overspend on gas fees, you should be careful when choosing where to invest your assets. Neither Uniswap nor Curve have a KYC process in place, so you may be dealing with scammers on the other side of the chain. Pay particular attention to pools at Uniswap, as they may offer you very attractive APYs for some exotic pairs that could turn out to be scams. This is less likely with Curve.

Liquidity providers usually compare the APYs of pools on different DEXs to determine which pool is best to invest in. Usually, the answer is not simple, especially with sophisticated tokenomics like Curve has. Take everything into consideration, think it through, and avoid investing your for-the-rainy-days money.