In my previous article on Uniswap, I provided a detailed guide on how to use the Decentralized Exchange. Uniswap brings with it many benefits when compared to other Centralized Exchanges. It has triggered the growth of an entire Ethereum De-Fi ecosystem.
Uniswap has 2 versions (v1 and v2). It is obvious that Uniswap v2 is an upgrade over v1, however, being a decentralized exchange, v1 is still active (V1 and v2 are running at the same time!). We take a detailed look at what benefits does v2 bring in, and why the complete weightage will slowly shift towards v2.
Uniswap V1 was a Proof of Concept. The success of v1 led to the development of v2. v2 encompasses multiple new features which include:
- ERC20 / ERC20 Pairs
- Price Oracles
- Flash Swaps
- Core/Helper Architecture
- Technical Improvements
- Path to Sustainability
- Testnet and Launch Details
ERC20 / ERC20 Pairs
In Uniswap v1 you can only swap between ETH and a single ERC20 token.
Uniswap V2 uses Wrapped Ether (WETH) in core contracts. This enables to pool of any ERC20 token directly with any other ERC20 token.
Uniswap V1 price feeds are not decentralized and can be manipulated. It is not safe to use.
The Oracle system in Uniswap V2 is highly decentralized and manipulation-resistant. The oracle measures prices when they are expensive to manipulate.
In Uniswap v2, a user can withdraw any amount of any ERC20 token at no upfront cost. This is known as a flash swap. The prerequisites for this include any of the below:
- Pay for the entire withdrawn ERC20 tokens
- Pay partially for the ERC20 tokens and return the rest
- Return all of the ERC20 tokens withdrawn
The Uniswap v2 smart contracts are called Uniswap v2 Core. This consists of interesting features like:
- v2 introduces WETH instead of ETH. Users can use ETH directly, the Routers convert between ETH and WETH.
- These routers handle the logic around slippage safety checks and multihop trades.
- v1 stored ERC20 Balances in ERC 20 token contract. In v2, the Core stores the ERC20 token balances internally.
Uniswap v2 brings in several technical improvements that include:
- v2 is written in Solidity instead of Vyper
- Fixes the “missing return” ERC20 tokens problem of Uniswap v1
- Compatible with ERC777 and other non-standard ERC20 tokens
- Uniswap v1 used all remaining gas on failing transactions. v2 fixes this bug
Path to Sustainability
Uniswap v2 introduces a liquidity provider fee of 0.30%. If the protocol charge is switched on, it will become 0.05% and the liquidity provider fee will be 0.25%. This feature is important to ensure self-governance and sustainability.
Testnet and Launch Details
Uniswap v2 is still in Beta and posses risks. The smart contracts are currently going through formal verification and security auditing. v2 will be a big improvement in UX. API, developer SDK, documentation are also getting updated.
We are lucky to be in a generation of the crypto revolution. To see Uniswap grow and develop is a pleasure. v1 created the fundamentals of the next generation DEX. v2 will ensure self-sustainability