DeFi Deep Dive — Uniswap, King Of the Ethereum Ecosystem

2021-4-25 12:30

The Uniswap protocol facilitates decentralized swaps of crypto-assets through an automated market maker (AMM) type design. The protocol has become one of the pillars of the DeFi ecosystem in Ethereum.

Unlike decentralized exchanges based on order books, in an AMM-type decentralized exchange (DEX) any user can act as a liquidity provider.

To do this, the user only has to deposit cryptocurrencies in pools that represent the different markets. In return, the user earns commissions. Therefore, the price of assets is no longer conditioned by the ask and bids placed in an order book.

At Uniswap, when a user becomes a liquidity provider by depositing their funds in a pool, they receive a token representing their stake. Every time someone executes an exchange through the protocol, they must pay a commission of 0.3%.

These commissions are distributed among the liquidity providers based on the number of crypto assets they have deposited in the pool.

So, in short, Uniswap allows users to swap both ethereum (ETH) and most compatible ERC20 tokens without the need for intermediaries. It also offers the possibility for users to contribute to the system’s liquidity with their own assets. In return, they receive the commissions generated by each swap as a reward.

A Brief History

In a post on Reddit in 2017, Vitalik Buterin, founder of Ethereum, suggested programming a decentralized exchange through smart contracts. This type of exchange called Automated Market Maker would work exclusively on a blockchain.

Inspired by this idea, Hayden Adams, a former mechanical engineer who lost his job at Siemens, decided to start working on implementing it in October 2017. The first version of it, called Uniswap, would be ready in November 2017 with a single liquidity and simple swaps provider.

How does Uniswap work?

Uniswap is a protocol that facilitates the exchange of tokens on Ethereum. Tokens are always kept in possession of the user, and since it works within a blockchain, trust in third parties is not necessary.

The protocol eliminates the order book and instead maintains liquidity reserves of various tokens in its smart contracts. In this way, transactions are executed directly against these reserves.

Prices are set automatically using the constant product market maker mechanism. This system works with a constant (x * y = k), which keeps total reserves in relative equilibrium.

The reserves group between a network of liquidity providers that supply tokens to the system. In exchange, each liquidity provider (LP) takes a proportional part of the commissions for each transaction.

For example, after adding 1,000 DAI and 10 ETH, the liquidity pool is now 10,000 DAI and 100 ETH in total. Since the quantity offered is equal to 10% of the total liquidity, the contract mints and sends to the market maker “liquidity tokens” (LP tokens) that entitle them to 10% of the total liquidity pool.

These tokens are an accounting tool to keep track of how much liquidity providers are owed. If others subsequently add or withdraw coins, the new liquidity tokens are minted or burned so that the relative percentage of everyone’s liquidity pool remains the same.

How does an automatic market maker (AMM) work?

An AMM works using liquidity pools. Pools are funds in which users deposit their assets. These assets are always deposited in pairs to create a market.

For example, if it is intended to create an exchange market between ETH and DAI, the user must deposit the same amount of the two currencies in said pool. If an ETH is worth 100 DAI, and a user deposits 10 ETH in this pool, they will also have to put 1,000 DAI.

The key formula to consider is x * y = k, where x and y are the amounts of the currencies in the liquidity pool, and k is the product. Uniswap takes these two quantities and multiplies them (1000 x 10 = 10,000). From here on, any operation carried out must keep the product constant between the two currencies.

Pros and cons of AMM

One of the main problems of AMM is what is known as slippage. Slippage is the difference between the expected price of a trade and the price at which the trade is executed.

Still using the previous example, but in the case that someone wants to buy 2 ETH. Automatically instead of 10 ETH, there would be 8. As the product between the amount of ETH and DAI must remain constant and equal 10,000, The new pool configuration should be 1,250 DAI x 8 ETH = 10,000.

Therefore, those 2 ETH will have cost 250 DAI (1250 final DAI – 1000 initial DAI) or the same 125 DAI for each ETH. In this case, the real price of each ETH is 100 DAI, but in the end, the user ends up paying 125 for each one. This is slippage.

The slippage problem will be bigger the larger the order. In this case, 2 ETH represents 20% of the total reserve, and the final slip is 25%. Obviously, no one wants to pay 25% more than the market value of a token.

One of the simplest ways to solve this is to have bigger reserves. In this way, the orders should get bigger and bigger so that the slippage is considerable.

Yet this system has a great advantage. It can provide liquidity no matter how large the order size is or how small the liquidity pool is. While larger orders tend to suffer from excess slippage, the system never has to worry about running out of liquidity. It will literally always work.

The problem of impermanent loss

Another problem with AMM is what is known as impermanent loss (IL). The IL is a consequence of the way an AMM works from the constant product mechanism. In the case of a pool containing 10 ETH and 1000 DAI (ie 1ETH = 100 DAI) the product between these two quantities (10 * 1000 = 10,000) must remain unchanged.

The problem will be greater with highly volatile and poorly correlated assets. As an example, the price of ETH goes from $100 to $150. In that case the contract will now reflect something closer to 1,224 DAI and 8.17 ETH (applying the formula explained above, 1,224 * 8.17 = 10,000 (our constant product) and 1,224 / 8.17 = 150, our new price).

If a user wanted to withdraw that amount from the liquidity pool, they would need to have 1,224 DAI and 8.17 ETH at that time. The total market value here is $ 2,450, whereas the amounts that were deposited at the beginning were withdrawn; they would get 1000+ 10 * 150 = 2500. Hence, the $50 in profit is lost to the liquidity provider.

Naturally, if the price returned to $100 again, everything would rebalance. That is why this phenomenon is known as impermanent loss. Without a doubt, it is one of the most uncomfortable problems of the Uniswap system. Nobody likes to provide liquidity in exchange for losing value.

Uniswap V2: The first iteration

In May 2020, Uniswap released its second version (V2). In Uniswap V1, ETH and any other ERC20 tokens make up all liquidity pools. Users can exchange any ERC20 for any other ERC20 but always following a route through ETH.

Since ETH is the most liquid asset, this meant less risk for the platform in its early days. This made it the best option for Uniswap V1. Uniswap V2 introduced reserves with ERC-20/ERC-20 pairs without the need to go through ETH.

Having direct ERC20 / ERC20 pairs resulted in an improvement in prices, reducing the number of commissions for each transaction. For example, to go from DAI to USDC in V1, the route would have been with the following steps:

DAI/ETHETH/USDC

With the V2 version of Uniswap it is possible for this transaction to be made directly from DAI to USDC.

Uniswap V2 implemented new functionality that allowed highly decentralized, and tamper-resistant on-chain price feeds. In contrast, Uniswap V1 could not be safely used as a price oracle because the price can move significantly in a short period of time.

UNI Token arrives

In September 2020, Uniswap finally launched its token. Every wallet that ever connected and used Uniswap was sent 400 UNI, about $12,000 today.

In addition to airdrops, Uniswap also launched a liquidity mining program to distribute its token. all those who act as liquidity providers in certain currency pairs receive 5 million UNI.

UNI is basically a governance token that allows its holders to vote on proposals to improve the protocol. For example, through governance, you can vote to allocate UNI for grants, strategic partnerships, and other programs.

Uniswap V3: The most flexible AMM ever

Finally, on March 23, Uniswap announced its latest version, Uniswap V3, release date — May 5. Perhaps the most innovative feature of Uniswap V3 is the concentrated liquidity positions, a model reminiscent of the Fed Price Reserve from Kyber Network.

In the previous version, a liquidity provider deposited its assets in the pool to be sold in any price range, from 0 to infinity. In this new version, the user has full control over the price ranges to which he wishes to provide liquidity.

Thanks to this, LPs can provide liquidity with a capital efficiency of up to 4,000 times higher than Uniswap V2, obtaining higher returns on user capital. This increases the efficiency of the system and, therefore, the slippage in prices.

Even so, this system of concentrated liquidity has the counterpart of increasing the impermanent loss.

In addition, Uniswap V3 incorporates multiple levels of commissions. This will allow LPs to be adequately compensated for assuming varying degrees of risk. Another interesting aspect users can convert LP tokens into NFTs.

Uniswap oracles are now much easier and cheaper to integrate. Thanks to these design improvements, the cost per transaction on the V3 will be slightly cheaper than on the V2.

Finally, the protocol will soon incorporate a layer 2 solution. The chosen system is Optimism’s optimistic roll-ups, which will make transactions significantly cheaper.

These features make Uniswap V3 the most flexible and efficient AMM ever designed.

Uniswap V3: A mixed reaction

The announcement of the Uniswap V3 has generated a lot of expectation among the DeFi community. It has also been met with criticism.

Firstly, with Uniswap V3 the protocol doesn’t reward the UNI token and maintains it as a simple status as a governance token.

On the other hand, the concentrated liquidity system forces liquidity providers to be more active and constantly redesign their strategies. Its operation is more complex, which gives an advantage to professional market makers while it hurts less experienced users.

The most significant criticism towards Uniswap V3 is the license under which it will operate. The code is no longer open for practical purposes. A fork of Uniswap V3 will not be legal for another 2 years. The code is accessible but not for commercial use

In the summer of 2020, the industry witnessed a dramatic episode in which Sushiswap forked Uniswap. In the process, it “vampirized” part of its liquidity deposits, absorbing billions of dollars from Uniswap.

After that event, it seems that the team wants to close any possibility of something similar happening. However, this completely breaks with the ethos of the DeFi ecosystem, leaving the source completely open and available to anyone.

The post DeFi Deep Dive — Uniswap, King Of the Ethereum Ecosystem appeared first on BeInCrypto.

Similar to Notcoin - Blum - Airdrops In 2024

origin »

Ethereum (ETH) на Currencies.ru

$ 3278.33 (-0.05%)
Объем 24H $24.686b
Изменеия 24h: -1.48 %, 7d: -15.77 %
Cегодня L: $3238.6 - H: $3302.71
Капитализация $394.892b Rank 2
Цена в час новости $ 2353.15 (39.32%)

ethereum protocol defi ecosystem uniswap type maker

ethereum protocol → Результатов: 126


Фото:

ConsenSys, Microsoft, EY Launch Privacy-Protecting Blockchain Protocol 

ConsenSys, a firm focused on solving real-world problems with the Ethereum blockchain, has joined forces with Microsoft and Ernst & Young to roll out Baseline Protocol, an innovative solution that makes it easier for enterprises to use the public Ethereum distributed ledger technology (DLT) mainnet without having to bother about privacy issues, according to aRead MoreRead More.

2020-3-6 14:00


Фото:

AMA With Origin Team Reveals Plans for Decentralized Sharing Economy

Matt Liu, Josh Fraser and former PayPal head Yu Pan want to bring the blockchain to the sharing economy. The trio is devising a platform with an emphasis on inclusive, peer-to-peer service hubs designed to decentralize the same consumer cost-friendly business models that have made companies like Airbnb, Uber and Lyft so popular in recent years.

2018-8-16 23:25


Фото:

Breeze Wallet with Breeze Privacy Protocol Mainnet Now Available for Download

The Breeze Wallet with the Breeze Privacy Protocol public mainnet has been released and is now open to the public. The wallet showcases Stratis technology — a platform built for visual basic apps and blockchain solutions — and places heavy emphasis on both privacy and security for businesses seeking to implement business-to-business (B2B) transactions on the Stratis and Bitcoin blockchain networks.

2018-8-4 00:02


Фото:

An Australian Blockchain Experiment: Tracking Global Almond Shipments

Following a successful 2016 trial of blockchain technology in an interbank open account transaction, the Commonwealth Bank of Australia (CBA) has partnered with five international and Australian companies to ship 17 tonnes of almonds from Melbourne, Australia, to Hamburg, Germany, using a new distributed ledger platform built on the Ethereum blockchain.

2018-7-31 23:13


Фото:

3 Exchanges to Support Permanent Tron (TRX) Migration as More Resume Withdrawals and Deposits

The Tron (TRX) token migration from the ERC20 token protocol to the Tron mainnet was initiated on the 21st of June. The process has taken longer than expected but the Tron HODLers are more than happy to wait for they know this is one of those projects that will go down in history as a […] The post 3 Exchanges to Support Permanent Tron (TRX) Migration as More Resume Withdrawals and Deposits appeared first on Ethereum World News.

2018-7-30 10:52


Фото:

MakerDAO and bZx Announce Partnership to Enable Decentralized Cryptocurrency Trading

bZx and MakerDAO are announcing a partnership where they plan to bring their protocols together, to enable decentralized trading using smart contracts running on the Ethereum blockchain. While bZx is a decentralized margin lending protocol and liquidation oracle marketplace on the Ethereum blockchain, MakerDAO is the firm that developed the Dai stablecoin.

2018-7-26 20:00


Фото:

Governance, Part 2: Plutocracy Is Still Bad

Coin holder voting, both for governance of technical features, and for more extensive use cases like deciding who runs validator nodes and who receives money from development bounty funds, is unfortunately continuing to be popular, and so it seems worthwhile for me to write another post explaining why I (and Vlad Zamfir and others) do not consider it wise for Ethereum (or really, any base-layer blockchain) to start adopting these kinds of mechanisms in a tightly coupled form in any significant way.

2018-7-21 23:03


Notes on Blockchain Governance

In which I argue that “tightly coupled” on-chain voting is overrated, the status quo of “informal governance” as practiced by Bitcoin, Bitcoin Cash, Ethereum, Zcash and similar systems is much less bad than commonly thought, that people who think that the purpose of blockchains is to completely expunge soft mushy human intuitions and feelings in favor of completely algorithmic governance (emphasis on “completely”) are absolutely crazy, and loosely coupled voting as done by Carbonvotes and similar systems is underrated, as well as describe what framework should be used when thinking about blockchain governance in the first place.

2018-7-21 23:03


Фото:

This Silicon Valley Supports Blockchain Organization and Wants to Develop into the Wikipedia of Goods

DIRT, a blockchain startup that plans to develop a trusted platform for structured data, has raised $3 million in a seed funding round. DIRT is looking to create a protocol for crowdsourcing information using the Ethereum blockchain to organize the world’s data and make it freely accessible to everyone. If the data is incorrect, anyone

2018-7-21 22:45