Liquidity pools

Liquidity pools

Right now, the topic of liquidity pools is getting more and more traction. Not surprising, considering DeFi markets are trending. In this article, we’ll try to simplify it as much as possible and provide examples.

“DeFi” stands for decentralized finance; specifically, non-custodial borrowing & lending platforms, decentralized exchanges (DEX), synthetic assets and derivatives protocols. But the most popular kind of DeFi is liquidity pools.

Imagine a bank, a decentralized organization. The bank has currency exchange points. There you can perform an exchange between the currencies the bank operates with. For example, it’s four currency pairs: USD-RUB, USD-EUR, USD-GBP, USD-CHF. Liquidity is provided by the bank. You can exchange both ways (dollars to euros, euros to dollars). The exchange rates are determined in advance, they may be updated every day or every other day. Banks, of course, make money off these operations. And their profit is based on the differences between the buy/sell exchange rates, or margins.

Now imagine a similar “exchange” where there are dozens, hundreds, possibly thousands of currency pairs and the exchange operations are saved on the blockchain, providing reliability and security. This is exactly what decentralized finance, or DeFi, is. The most popular of these platforms are Uniswap and PancakeSwap. Exchange rates don’t change every day or every other day, they update after every single trade with this currency pair. This pair is called a liquidity pool, for example, HUB-USDT on Uniswap. The liquidity here is not provided by an organization, but by any user that can provide liquidity to a pair at a 1:1 ratio.

image

For example, HUB = $100 (~100 USDT). To add liquidity to the HUB-USDT pool, you need to add 1 HUB and 100 USDT. If you want to add 5 HUB, you have to add 500 USDT along with it.

Still, DeFi has one thing in common with banks — the one providing liquidity is the one who makes money off trades. Banks individually provide the liquidity, so they are the only ones profiting off exchanges. In DeFi, liquidity is provided by users who are all the ones to profit. The profits are distributed proportionally to the provided liquidity. If your share in a pool is 5%, then you’ll receive 5% of all fees taken on trades. The volume of the fee varies from platform to platform; on Uniswap, it’s 0.3%, and on Minter, 0.2%.

Liquidity provider profitability

A liquidity provider is someone who provides liquidity for a pool.

Example

Input data:

  • Pool HUB-USDC
  • Amount of HUB in the pool: 100
  • Amount of USDC in the pool: 5 000
  • Number of liquidity providers: 2
  • The first liquidity provider brought in: 70 HUB and 3 500 USDC
  • The second liquidity provider brought in: 30 HUB and 1 500 USDC
  • Exchange fee: 1% (for convenience, the real rate is lower)

This means that 1 HUB = 50 USDC. The providers’ shares stand at 70% and 30%, respectively.

A user makes a swap: purchases 10 HUB for 500 USDC. They pay a fee of 5 USDC (1%). The correlation of the coins changes in the pool, and so does the exchange rate:

  • Amount of HUB: 90
  • Amount of USDC: 5500
  • Current HUB exchange rate: 61.11 USDC

The liquidity providers received a profit according to their share: the first provider got 3.5 USDC (70%), the second provider got 1.5 USDC (30%).

Impermanent loss

Impermanent loss means partial loss of profit.

Example

Input data:

Pool HUB-USDC

1 HUB = 100 USDC

Alice adds liquidity to the pool: 1 HUB and 100 USDC. The pool’s total liquidity now stands at 10 HUB and 1 000 USDC. That means Alice’s share is 10%.

After some time, during which users have been swapping USDC for HUB within the pool, the price of HUB rose to 400 USDC. Now there’s 5 HUB and 2 000 USDC in the pool.

Alice decides to take her money out. Since her share is 10%, she takes 0.5 HUB and 200 USDC. Translated into dollars, Alice should now have $400, right (0.5 HUB x 400 USDC + 200 USDC)?

But if Alice hadn’t provided liquidity to the pool and simply held 1 HUB and 100 USDC instead, she would’ve had $500 (1 HUB x 400 USDC + 100 USDC). There’s a $100 difference, and that’s called impermanent loss.

Here are the impermanent loss values depending on coin price fluctuation:

  • 25% price change (1.25x) = 0.6% impermanent loss
  • 50% price change (1.5x) = 2%
  • 75% price change (1.75x) = 3.8%
  • 100% price change (2x) = 5.7%
  • 200% price change (3x) = 13.4%
  • 300% price change (4x) = 20%
  • 400% price change (5x) = 25.5%

Always keep this factor in mind when you’re accounting for the profitability of becoming an LP. This loss can be compensated with fees that the provider receives for supplying liquidity, as well as farming.

Farming

Farming is a project’s system of bonuses for providing liquidity. For example, in the HUB-USDT pool, the bonuses (farming) are provided by the Minter team who rewards providers for supporting the liquidity of one of the project’s tokens (in this case, the coin of the Minter Hub sidechain).

This way, thanks to the profitability of fees and farming, LPs may expect two-, sometimes three-figure APYs.

Liquidity pools with HUB

HUB liquidity pool on PancakeSwap (BSC)
HUB liquidity pool on PancakeSwap (BSC)

⬅️ Previous section

© 2021 BTC.Secure Inc.