Uniswap V2 is the second version of the decentralized exchange Uniswap, which was launched in May 2020. Uniswap V2 builds on the success of its predecessor and introduces several new features and improvements to enhance the overall trading experience.
One of the main improvements of Uniswap V2 is the introduction of "liquidity pools," which are pairs of tokens that users can add to or remove liquidity from, in order to facilitate trades between them. In contrast to traditional order book exchanges, Uniswap V2 uses an automated market maker (AMM) system, which means that the price of the tokens in a liquidity pool is determined by a mathematical formula that automatically adjusts based on supply and demand.
Another key feature of Uniswap V2 is its ability to support a wider range of tokens, including those with lower liquidity. This is achieved through the use of a "flash swap" feature, which allows users to temporarily borrow any token from a liquidity pool without needing to provide collateral, as long as the token is returned within the same transaction.
Uniswap V2 also introduces a more efficient fee structure compared to the original Uniswap, with lower fees for larger trades. This incentivizes users to make larger trades and increases the liquidity in the pools, resulting in better prices for traders.
Uniswap charges a 0.3% fee on every trade made on the platform. Out of the 0.3% fee, 0.25% goes to liquidity providers, while the remaining 0.05% goes to the Uniswap protocol. Therefore, liquidity providers receive 5/6 (or 83.3%) of the fee, while the protocol receives 1/6 (or 16.7%) of the fee.
It's worth noting that the distribution of fees on Uniswap is subject to change based on the decisions of the Uniswap community and governance processes.
Overall, Uniswap V2 offers a more flexible, efficient, and user-friendly decentralized trading experience, with improved liquidity and fee structures, making it a popular choice for traders looking for a decentralized alternative to traditional exchanges.
Uniswap v2 is divided into two components: a core and a periphery.
The core component of Uniswap v2 includes the smart contracts that handle the exchange of tokens between liquidity pools. These contracts use a mathematical formula to determine the price of tokens in the pool, based on the ratio of the supply of each token. The core contracts also handle the swapping of tokens between liquidity pools and the collection of trading fees. The breakdown of the core contract can be found in UniswapV2Core.md file.
The periphery component of Uniswap v2 includes the user interface (UI) and other external components that interact with the core contracts. The periphery components provide a user-friendly interface for traders to interact with the core contracts and perform trades on the platform. The breakdown of the core contract can be found in UniswapV2Periphery.md file.
The core and periphery components of Uniswap v2 work together to provide a decentralized trading experience that is efficient, secure, and user-friendly.