CoinRebate
Back to Guides
OKX

Introductory Guide to Uniswap: Old Leek teaches you how to play AMM and avoid the pit of impermanent losses

Want to understand how to play Uniswap? This article uses vernacular to dismantle the AMM mechanism, liquidity pools and impermanent losses, help you safely participate in DeFi, and also recommend regular exchanges to harvest wool!

Introductory Guide to Uniswap: Old Leek teaches you how to play AMM and avoid the pit of impermanent losses

Getting Started with Uniswap: Understand the AMM mechanism of decentralized exchanges in one article

The old leek digs out his heart: DeFi is very deep, understand it first before jumping into the water! This article is purely informative and does not constitute investment advice. There are risks in the currency circle, so you need to be cautious.

Anyone who has played Binance or OKX knows that traditional spot trading involves placing orders between buyers and sellers, with the exchange acting as the middleman. Simple and direct, no problem.

But after the rise of DeFi, the question arises: How to conduct transactions on a decentralized chain like Ethereum?

The stupidest way is to move the order book onto the chain. The result? A dead end! The reason is very realistic:

  • Gas fees are so expensive: Gas is burned for every order uploaded to the chain. If the cost is 0.1 dollars, 1 million orders is 100,000 dollars! Who can bear it?
  • Slow as hell: Ethereum’s TPS can support hundreds of people, while traditional exchanges can order millions of orders per second, which is completely different.
  • Functions are castrated: Smart contracts will not take the initiative to work, and conditional orders such as "automatically sell when the price reaches a certain point" cannot be used on a pure chain.

How to fix it? Here’s the answer: **Stop trading with others, just do it with a “program pool”! ** This pool is the Automated Market Maker (AMM), the nuclear weapon of Uniswap.

Uniswap’s underwear: What are AMM and liquidity pools?

At the end of 2018, Uniswap was born, completely subverting on-chain transactions. It does not engage in order books, but directly adopts the Swap (exchange) mode.

To put it plainly: Get a smart contract to act as a banker (market maker), deposit two currencies (such as ETH and UNI) in advance in the contract, and set up a Liquidity Pool. Do you want to exchange coins? Exchange directly with the pool!

Give me a chestnut: Assume that there are 100 ETH and 2000 UNI in the UNI/ETH pool. *Initial price: 1 ETH = 20 UNI, or 1 UNI = 0.05 ETH.

  • You want to exchange 1 ETH for UNI, how much can you exchange? This depends on a mathematical formula.

Uniswap’s pricing magic: constant product formula x * y = k

Uniswap relies on a very simple formula to price: x * y = k.

  • x = the number of the first asset in the pool (such as ETH)
  • y = the number of the second asset in the pool (such as UNI)
  • k = fixed constant

Following the chestnut above, initial k = 100 * 2000 = 200,000. After you throw in 1 ETH, the pool becomes (100 + 1) = 101 ETH. Suppose you can get N UNIs, then the remaining UNIs in the pool are (2000 - N). Set of formulas: 101 * (2000 - N) = 200,000 One calculation: N ≈ 19.802 UNI.

**Note, prices have changed! **

  • After the exchange, the pool has 101 ETH and 1980.198 UNI.
  • New price: 1 ETH ≈ 19.802 UNI. UNI has increased slightly relative to ETH.

This is the cool thing about AMM: The pool ratio changes with every exchange, and the price changes in real time. The bigger you shuttle, the scarier the slippage will be!

Where does liquidity come from? The pitfalls of LP and impermanent loss

The money (liquidity) in the pool is not brought by strong winds, but is deposited by Liquidity Provider (LP) with real money. In order to fool everyone into saving money, LP can share transaction fees as a sweetener.

**However, there are pitfalls in doing LP! ** The biggest thunder cry Impermanent Loss.

Speaking in human terms: You have deposited two coins, and when the market price ratio of the two coins changes, if you keep putting them in the pool to make markets, you may make less than if you simply hold the coins (or even lose a lot).

Another example:

  • When you deposit: 1 ETH = 20 UNI, you deposit 1 ETH + 20 UNI.
  • Later, ETH took off and the market price changed to 1 ETH = 40 UNI.
  • Assets are worth more if you hold on to them.
  • But in the Uniswap pool, the asset ratio must be adjusted according to the formula. When you withdraw it, you may get 0.707 ETH + 28.28 UNI (calculated by the formula). Although the total value may be higher than when you deposited it, it is lower than the book value of simply holding 1 ETH and 20 UNI. This difference is an impermanent loss.

**So, market making is not about making a guaranteed profit, the essence is to earn handling fees, and at the same time, bet on prices not to jump randomly! **

How to play Uniswap? Advice for trading veterans and LP newbies

For traders:

  1. Keep an eye on slippage: Check the estimated slippage before exchanging. The larger the total locked volume (TVL) of the pool, the smaller the proportion of your trading volume and the lower the slippage.
  2. The path needs to be cool: Want to trade A/B but there is no direct pair or the pool is too small? Find an intermediary currency (usually mainstream currencies such as ETH and USDC). For example, if you trade one lot through A/ETH and B/ETH pools, although you have to pay an extra handling fee, the transaction price may be better.
  3. Only use regular front-end: Be sure to trade through the Uniswap official website or a reliable aggregator, don’t be cut off by phishing websites!

For those who want to be LP:

  1. Understand impermanent loss: Before providing liquidity, you must understand what impermanent loss is. For currency pairs with large price fluctuations, the risks are terrifyingly high!
  2. Choose a stablecoin pair: For example, USDC/USDT, both of which are anchored to 1 US dollar, the price almost does not move, the risk of impermanent losses is extremely low, and the main purpose is to collect fees.
  3. Research Uniswap V3: V3 allows LPs to concentrate liquidity in specific price ranges, and capital efficiency increases dramatically. But this requires active management and the ability to monitor market trends.

In addition to Uniswap, what other AMM DEX can I play?

Uniswap has pioneered AMM, but it is not the only one. Other mainstream DEXs also have unique skills:

  • Balancer: Can create a liquidity pool containing multiple assets (for example, one pool holds three currencies, ETH, WBTC, and LINK), and the weights can be determined by yourself.
  • Curve: Specially optimized for stablecoin (such as USDC, DAI, USDT) exchange, using different formulas, the slippage on stablecoin trading pairs is so low that it has no friends.

Playing in DeFi and on-chain trading is exciting, but Centralized Exchange (CEX) is still the main battlefield for most veterans due to its high liquidity and rich trading pairs and products (such as contracts and financial management).

Whether you play CEX or DEX, safety is always the lifeblood:

  • Only choose the world’s top, licensed and compliant formal exchanges, stay away from pheasants, be careful and lose your pants when you run away!
  • Don't believe in the nonsense of "leading a single teacher" and "guaranteed capital and high returns", they are all tricks of cutting leeks.
  • The private key and mnemonic phrase are tightly guarded, don’t give it to anyone who wants it!

If you don’t have a reliable exchange account to play spot or deposit money to engage in DeFi, it is strongly recommended that you register through the following regular channels, and you can also save permanent discounts on handling fees:

  • Binance: The world's largest exchange, the old leek base.
  • Exclusive registration link: https://www.maxweb.black/join?ref=LULALA
  • Recommendation code: LULALA (Fill it in when registering, and you will get a 20% discount on the handling fee!)
  • OKX: All products, especially suitable for ruthless people who play contracts.
  • Exclusive registration link: https://www.lywebuuz.com/join/LULALA
  • Recommendation code: LULALA (Fill it in when registering, and you will get a 20% discount on the handling fee!)
  • Bybit: Contract transactions are smooth, and the interface is friendly to novices.
  • Exclusive registration link: https://www.bybitglobal.com/invite?ref=ODXBWMN
  • Recommendation code: ODXBWMN (Fill it in when registering, and you will get a 20% discount on the handling fee!)

Two final words

Uniswap relies on the Automated Market Maker (AMM) mechanism to cleverly solve the performance and cost problems of on-chain transactions, directly detonating DeFi Summer. It allows anyone to be a banker, but it also brings about the new pitfall of "impermanent loss".

Understanding the principles of AMM is the first step to play DeFi safely. Remember, learn first before working, start with spare money, and strictly stop losses**. Before embracing innovation, make sure your base camp is on regular exchanges like Binance and OKX that are as stable as old dogs.

Share:𝕏✈️R

Comments (0)