Decentralized Liquidity Pools and Automated Market Making with Uniswap

in #blog4 years ago (edited)


uniswap.org is a decentralized constant product liquidity protocol, which is secure and creates liquidlity pools of ERC-20 token. given the recencey of uniswap, the protocol almost has 2 billion dollars worth of ERC-20 tokens locked up and faciliates close to 400 million dollars of decentralized trade every day (sometimes even more).

How does it work? - The basics.

Automated market making is defined as a smart contract mechanism by which liquidity pools such as the one we will describe below, automatically execute trades on the ethereum blockchain. What this means is that both the ETH and DAI would have an equal $ worth of tokens in the system. As a example, consider 1 ETH = 346$. Consider an ERC token DAI which trades at 1 DAI = 1$. In a liquidlity pool, one would ideally invest both tokens in the ratio of 1:1 to keep the product constant. This means that for every 500$ of ETH invested, the total DAI value should be 500$ worth. Now consider a system where a user would invest 1 ETH and 346 DAI since 1 ETH = 346 DAI.

A constant product curve would look like the following where we would have 1000 ETH and 34600000 DAI.

Curve x * y = K

Whom does UNISWAP.org facilitate help to:

  1. Arbitraguers: Due to the decentralized nature of these exchanges, a liquidity pool facilitates mass arbitrage opportunities. For example, on coinbase or on hitbtc if 1 ETH is trading for 380 DAI. An arbitrageur can quickly come to uniswap and purchase say 10 ETH paying 3460 DAI from his wallet. This would incur a 0.3% fee to uniswap, which is distributed to all liquidity providers of the pool, and is accumulated over a period of time. Then, the arbitrageur can simultaneously trade these 10 ETH for 380 DAI on hitBTC.org for a total of $3800 making a cool 340$ profit - 0.3% commission of about 0.3X3460 = 10.38$. This kind of simultaneous no risk swapping of ETH to DAI on public markets is an extremely robust mechanism.
  2. ERC-20 token purchases and ERC-20 listings: One the largest challenges with centralized exchanges is their lack of visibility into new token listings, ICOs or IEOs. It becomes almost impossible to purchase these types of tokens especially when legal controls are in place. uniswap pretty much allows anyone in the world to list their tokens and to set their own private pools using their User Interface.
  3. HODLErs : This community is responsible for adding and creating the Liquidity pools on the uniswap network. What is interesting here is that HODLers do not really need to identify themselves on the network or to create an account or to register with a bank or anyone here. They can directly login to the uniswap by authenticating or connecting to one of their wallets e.g., metamask or coinbase, and can participate in the uniswap.org economy.
  4. Pool creators: Individuals can also create pools for all kinds of tokens on uniswap. for example, WBTC is the wrapped version of BITCOIN. One can actually purchase or list any cryptocurrencies that they create onto these pools themselves.
  5. Ordinary traders: Globally the trader pool of users cannot access the cryptocurrency token if it were not for centralized exchanges or other secondary peer to peer markets. Uniswap facilitates ordinary traders access to cryptotokens.
In a future article I shall write about minting, and yeild farming in the context of uniswap. I shall also write about some of the risks of investing in Liquidity providers.

references:

  1. uniswap whitepaper - https://uniswap.org/whitepaper.pdf


Posted from my blog with SteemPress : https://www.cryptonewtech.com/2020/09/25/decentralized-liquidity-pools-and-automated-market-making-with-uniswap/