Comprehensive Introduction
Uniswap Exchange
Uniswap Exchange offers Uniswap V2 and Uniswap V1 products. Uniswap Exchange is a decentralized exchange, unlike centralized exchanges such as Huobi and OKEx. It automates market makers, replaces manual quotes with fixed algorithms, and eliminates not only centralized matching and settlement but also market makers in transactions. Uniswap is an Ethereum-based token exchange protocol. It is decentralized, unlike traditional cryptocurrency exchanges and typical decentralized token exchanges. Uniswap is a set of contracts deployed to the Ethereum network, and all transactions are performed on-chain.
Like other DEXs, Uniswap allows users to freely deposit tokens for exchange and withdrawal without the registration, identity verification, or withdrawal restrictions of centralized exchanges. However, it has a higher gas utilization rate than other DEXs, resulting in lower gas fees. Its counterparty is not another trader; it trades with a token pool and uses an automated market-making model to calculate transaction prices.
Uniswap V3 Introduction
Uniswap v3s main features are concentrated liquidity and multiple fee tiers.
- Concentrated liquidity - Gives individual LPs (liquidity providers) granular control over what price ranges their capital is allocated to. Individual positions are aggregated into a single pool, forming a combined curve that traders trade against.
- Multiple fee tiers - Allow LPs to be properly compensated for taking on different levels of risk.
Compared to Uniswap V2, LPs can provide liquidity with up to 4,000x capital efficiency, earning higher capital returns. Capital efficiency paves the way for low-slippage trade executions that can outperform centralized exchanges and stablecoin-focused AMMs. LPs can significantly increase their exposure to preferred assets and reduce their downside risk. LPs can sell off one asset in exchange for another by adding liquidity over a price range that is entirely above or below the market price, similar to a limit order executed along a smooth curve with fees.
Uniswap oracles can be integrated more simply and at lower cost. The V3 oracle can provide time-weighted average prices (TWAPs) for any period over the past approximately 9 days on demand. This eliminates the need for integrating projects to query historical price data.
Even with these groundbreaking design improvements, gas costs to swap on V3 on the Ethereum mainnet are marginally cheaper than V2. Trades on the Optimism deployment are likely to be significantly cheaper.
Uniswap V2 Introduction
Uniswap V2 is a DEX platform fully deployed on the Ethereum blockchain. Based on the "constant product automated market making" model [reserve pool model, on-chain matching, and on-chain clearing], it facilitates automatic exchange transactions between ETH and ERC20 token digital assets.
Uniswap V2s trading design differs from traditional limit order models. The Uniswap V2 protocol creates a single liquidity reserve for each ETH and ERC20 token trading pair.
Each tokens liquidity reserve is a trading smart contract that holds a certain amount of ETH and ERC20 tokens. The Uniswap V2 trading contract acts as an automated market maker (AMM) to determine the exchange rate between ETH and ERC20 tokens based on the relative amounts of each token in the reserve. Instead of placing buy or sell orders, users trade with the reserve pool by adding one token and removing another. In other words, by placing two specific amounts of crypto-assets into a smart contract, the transaction price of the token can be calculated automatically based on the algorithm of the automated market maker.
The key to the algorithm is that no matter what the trading volume is, the product of the number of the two assets exchanged remains a constant, i.e., a constant product market maker. In formula terms, this is x*y=k, where x and y are the number of tokens in the liquidity pool, and k is the product. To keep k constant, x and y can only change inversely to each other.
For example, suppose the DAI/ETH reserve pool is initially set to 150,000 DAI and 1,000 ETH, creating an exchange rate of 150 DAI/ETH. If a user attempts to buy 10,000 DAI from the DAI/ETH reserve pool, the amount of ETH in the reserve pool increases, and DAI is removed from the pool. This places downward pressure on the DAI/ETH ratio and increases the price of DAI. The price depends on the order size relative to the size of the DAI/ETH reserve.
Uniswap V2s automated market-making model provides continuous liquidity. Market makers do not have to specify the price at which they buy or sell ETH, as in traditional market making, nor do they have to manage multiple bids and quote orders. Users only need to commit funds to the exchanges liquidity pool, and the Uniswap V2 smart contract automatically completes the market making. Market makers receive the trading fees generated by the pool in proportion to their liquidity contribution share.
Uniswap V2 allows anyone to create a liquidity pool based on the ETH and any ERC-20 currency trading pair and earn income by contributing a share of liquidity to the liquidity pool and participating in the transaction fee split. They can also withdraw liquidity and destroy their share. Unisway allocates 0.3% of the transaction fees generated by each liquidity pool to liquidity providers in proportion to their contribution share. The Uniswap V2 platform itself does not charge transaction fees.
Uniswap V1 Introduction
Uniswap V1 provides decentralized token exchange services on the Ethereum blockchain. It provides a liquidity pool for the exchange of ETH and ERC20 tokens. It has the most attractive features of current DeFi projects, such as decentralization, permissionlessness, and non-stop.
Uniswap V1 realizes a decentralized exchange that does not need to consider the above features. It does not require users to place orders (no orders), does not require overlapping demand, and can be bought and sold as you go. It also does not require users to deposit assets into specific accounts, thanks to the characteristics of ERC20 tokens. The advantage of the Uniswap V1 model is automatic pricing based on a formula and automatic price adjustment through supply and demand.
The key to how Uniswap V1 works is the creation of a supply pool that stores two currency assets, A and B. When users exchange A for B, their A is sent to the supply pool, increasing the amount of A in the supply pool, and B from the supply pool is sent to the user. The key issue here is how to provide an exchange rate (price) for A and B.
Uniswap V1s pricing model is very simple, and its core idea is a simple formula: x * y = k, where x and y represent the amount of the two assets, respectively, and k is the product of the quantity of the two assets.
Assuming that the product k is a fixed constant, it can be determined that when the value of variable x is larger, the value of y will be smaller; conversely, the smaller the value of x, the larger the value of y. It can be concluded that when x is increased by p, y needs to be reduced by q to maintain the constancy of the equation.
To do more practical work, replace x and y with the reserves in the currency reserves, which will be stored in the smart contract.
Expand