Uniswap v3: triple optimization of GAS fee + throughput + AMM
SoulLand
2021-03-24 05:42
本文约1673字,阅读全文需要约7分钟
Can the advent of Uniswap v3 create a new situation for AMM?

Uniswap is an automated liquidity protocol powered by a constant product formula, protocol code running on the Ethereum blockchain. It emerged to prioritize decentralization, censorship resistance, and security by eliminating our need for intermediaries.

Each Uniswap smart contract or pair of smart contracts manages a liquidity pool of two ERC-20 tokens. Anyone can provide liquidity to the pool by depositing the equivalent value of the base token in the pool in exchange for pool tokens, that is, to become an LP (liquidity provider). These tokens are the LP's pro rata share of the total reserve and can be redeemed for the underlying assets at any time.

Uniswap v1, the first version of the protocol, was launched at Devcon 4 in November 2018.

Uniswap v2 is the second iteration of Uniswap, which was launched in May 2020. Compared with v1 version, v2 introduces:

1. ERC20/ERC20 trading pairs

This transaction is very useful for liquidity providers, because they can maintain more types of ERC20 token position pricing, so that liquidity providers do not have to bear the risk of ETH.

2. Price Oracle

Uniswap v2 implements new features that enable highly decentralized and manipulation-resistant on-chain price feeds. This is achieved by taking price measurements when they are expensive and accumulating historical data. This enables an external smart contract to create a gas-efficient time-weighted average over any time interval.

3. Lightning exchange

Uniswap v2 Lightning Swap allows free withdrawal of any number of ERC20 tokens on Uniswap and any operation on them. Lightning swaps are very useful because they eliminate the upfront capital requirements and unnecessary sequence of operations of using Uniswap.

Of course, in addition to these functions, the V2 version has other optimizations, so I won’t go into details here. Less than a year since its launch, Uniswap v2 has facilitated over $135 billion in trading volume and is one of the largest cryptocurrency spot exchanges in the world.

Yesterday, the official announcement of Uniswap v3, the v3 version will launch the L1 Ethereum mainnet on May 5, and L2 deployment will be carried out on Optimism soon.

The optimization of Uniswap v3 compared with Uniswap v2:

1. Aggregated liquidity

In Uniswap v3, liquidity providers can exercise fine-grained control over the price range of their capital allocation, providing greater liquidity at desired prices. In this way, users can concentrate their capital efficiency in the most frequent trading range to obtain maximum returns. In this case, liquidity providers construct personalized price curves that reflect their own preferences. This curve will further optimize the impermanence loss. If the user's investment deviates, the curve will be controlled, and the user will automatically stop the loss and not participate in transactions outside the range.

2. More advanced oracles

v2 introduced time-weighted average price, and Uniswap v3 further improved it. v3 can be invoked on a single chain and calculate any latest time-weighted average price over the past 9 days. This series of historical price accumulations makes it easier and cheaper to create more advanced oracles. For example, compared to the v2 version, Uniswap v3 traders can save about 50% of the gas fee in keeping the oracle machine up to date. Also, the cost of computing a time-weighted average in an external smart contract is much cheaper.

3. Multiple fee levels

Uniswap v3 provides three levels of fee rates for LPs, namely 0.05%, 0.30% and 1.00%. Through these settings, you can set higher rates on trading pairs with higher risks (ETH/DAI), and set lower rates on trading pairs with lower risks (USDC/DAI). This allows liquidity providers to be properly compensated for taking varying degrees of risk.

Of course, these are not the only things that are updated in Uniswap v3, but judging from the optimization functions listed in v2 and v3, the problems that Uniswap wants to solve are also the main problems that exist in Ethereum, automatic market makers, and liquidity mining: AMM Free loss, accurate price feed of the oracle machine, and high consumption of gas fees.

At present, Uniswap has become the key infrastructure of decentralized finance. Many decentralized exchanges are improved and developed on the basis of Uniswap. Due to the current consensus problems and problems in the industry, many developers and investors are looking forward to With the advent of Ethereum 2.0, they are also seeking the changes brought about by L2, and actively iterating and seeking cooperation. Uniswap pioneered the AMM mechanism and contributed a lot to the prosperity of DeFi. Now it is also actively engaged in solving industry problems. Work hard for developers, traders and liquidity providers to participate in safe and sound financial markets. With the release of the uniswap V3 mainnet on May 5 and the launch on Optimism in mid-May, can the advent of Uniswap v3 create a new situation for AMM? Let us wait and see!

SoulLand
作者文库