So, you just used a Dex for the first time…well probably not your first time but you just began to wonder how exactly this works. Unlike the rampant centralized exchanges, DeFi exchange platforms do not have buy walls and sell walls, yet exchange of assets is unrestricted. Even a cryptocurrency veteran would wonder how this works exactly.
Decentralized exchanges are powered by Automated Market Maker (AMM) protocols which leverage liquidity pools to ensure seamless exchange of assets while retaining blockchain-level security. AMMs? We will learn about these in my next article. Understanding liquidity pools – the underlying technology which powers automated market markers is our current objective.
So, what are liquidity pools?
Imagine a basket containing two kinds of fruits in a barter trading system; taking one of these fruits requires you to replace them with an equal value of the other fruit. Now this is basically how DeFi exchanges works. The basket here is the liquidity pool.
Liquidity pools are collections of tokens locked in a smart contract which allows borderless exchange of tokens in the pool. Contributors who provide these tokens and lock them in the pool are known as Liquidity providers.
To provide liquidity, a liquidity provider locks up equal values of the two tokens in the pool. The liquidity pool is hence a collection of tokens locked up by the liquidity providers, this pool is available for traders who wish to exchange any of these assets.
Liquidity providers receive liquidity pool tokens (LP tokens). LP tokens are cryptographic representation of the percentage of the total liquidity pool owned by the individual liquidity provider. Trading fees are distributed amongst liquidity providers according to the percentage of the pool they own.
To further incentivize liquidity provision, certain projects launch liquidity farming programs on their platform to reward liquidity providers according to the amount of liquidity they supply. This is popularly known as liquidity farming. To earn tokens in a liquidity farming program, liquidity providers stake their Liquidity pool tokens on the platform and earn according to the APR and amount of Lp tokens they stake.
However, liquidity provision comes with its own little disadvantage, this is known as Impermanent loss. Impermanent loss is a ‘temporal’ and ‘illusional’ loss incurred by liquidity providers due to variation in demand and values of the tokens they supplied to the liquidity pools.
This is due to a protocol programmed to retain the total value of tokens supplied to the pool. If one of the assets supplied to the pool continues to rise in demand and value against the other, liquidity providers receive the other asset as the supply is increased by traders depositing more of it to the pool
Assuming you supplied 100USD worth of ethereum and 100USDT, the total value of your Liquidity is 200USD. As the value of ethereum increases, the amount of ethereum you supplied continues to decrease while you receive more USDT, this is essentially designed to retain the 200USD you added to the liquidity pool.
The ‘loss’ comes from the fact that the gains which would have supposedly come from the increase in value of ethereum will be lost. It’s illusional because there is in fact no loss; your 200USD is sustained, only difference is that you have more USDT now. It is temporal because if the liquidity provider can wait until price returns to what it was when this liquidity was provided, they will receive the same amount of tokens they supplied when they withdraw the liquidity.
Liquidity pool is a clever technology, not only does it solve the fake liquidity issues, they simplify asset exchange. Liquidity providers also get to earn passive rewards from liquidity provider fees.
We’ll get to talk about Automated Market Markers in our next article. Follow us and stay tuned!.