Liquidity Pool
Abstract
Context
Setting up a pool
Example
Carl wants to deposit funds into the ETH/FVT pool. The market algorithm obligates that both values of tokens must be equal. Carl then provides 1 ETH worth 1000 USD and 1000 FVT worth 1000 USD for a total value of 2000 USD.
Carl was providing liquidity into a pool that already existed, and even though he wasn’t the one who made the initial deposit, he still had to follow the rule of providing equal token values into the pool.
Example
Let’s stay with Carl a little longer. He provided liquidity into the pool but now the market price of ETH has changed, which created an arbitrage opportunity. Because of that, arbitrage traders will buy ETH in exchange for FVT until the pool ratio reflects the current market price.
Note
Remember that the ratio of the pool changes through LP deposits or trades, and is strictly connected to the amount of tokens in the pool. Also, the pool ratio determines the price of the assets in the pool.
Liquidity Pool Tokens
Price impact
Note
It’s worth mentioning that large (or deeper) pools can handle bigger trades without significant price impacts.
Example
Imagine you want to buy 3 apples. You go to the local fruit market and there are only two farmers. Because you are a mathematic maniac, you want the product of <fruit amount> and <money farmer has on hand> to be constant. You also want to pay as little as possible.
The first farmer has 5 apples and 10$ on hand. So the constant would be 5 * 10 = 50
You take 3 apples: 5 - 3 = 2
To keep the constant: 50 = (5 - 3) * x
x = 25
So you have to add to farmer hand 15$ (he had 10$ in the beginning, 10 + 15 = 25) to keep the constant on the initial level.
second farmer has 78 apples and 100$ in the hand. So constant would be 78 * 100 = 7800
You take 3 apples: 78 - 3 = 75
To keep the constant: 7800 = (78 - 3) * x
x = 104
So you have to add to farmer hand 4$ to keep constant on the initial level.