If you have already read the post called “DeFi – Decentralized Finance” on our Blog site at Compumatrix.ph, you are somewhat familiar with the following already.
Liquidity chiefly affects the fluctuation price of an asset. Liquidity is the “readily available” amount of assets in a given market. Due to the high volatile quality of Cryptocurrencies, liquidity does have a distinct effect on the crypto markets and traditional markets.
As it is explained in the Compumatrix Newsletter https://compumatrix.substack.com/p/compumatrix-automated-liquidity-pool
What is a liquidity pool?
“A liquidity pool is a vault where market participants place their assets together to provide a large pool of liquidity for anyone looking to swap an asset in a trading pair. The pool makers become liquidity miners and receive passive income in proportion to their contribution to the pool. Automated Market Maker AMM is used instead of order book and market maker services, distributing income from trading activity among all pool makers.”
What is Automated Market Maker (AMM)?
(definition from Wikipedia) “Algorithmic trading is a method of executing orders using automated pre-programmed trading instructions accounting for variables such as time, price, and volume. This type of trading was developed to make use of the speed and data processing advantages that computers have over human traders.”
Understanding concepts of DEFI and how liquidity pools in DEFI are envisioned to perform.
In Decentralized Finance (DeFi), Liquidity pools are an assembled group of tokens (assets) secured in smart contracts. They promote simple trading of assets in the pool, which obliges the pool assets owners to earn a yield depending on the number of assets they pool. Simply put, a liquidity pool is an Automated Market Maker that provides liquidity. This, in turn, cuts down on huge price swings of an asset.
Why does DeFi need liquidity pools in the first place? The typical order-book system used on the standard crypto trading sites won’t typically work for DEFI. WHY? The old order-book model depends largely on the individual market-makers to keep the liquidity up. When no one is trading in the market, the exchange becomes “illiquid” or stale.
Yes, the old order-book system model works well IF enough buyers and sellers continuously utilize the market. When there is not enough activity in a market (causing little to no liquidity), the asset becomes illiquid and difficult to buy and sell. This can cause some extreme price fluctuations and sell-offs of large individual transactions. Resulting in an asset’s unlikeliness of being adopted.
How do Liquidity Pools Work?
Algorithms called Automated Market Makers (AMM) dispense continuous liquidity from the pools for market trading.
- The pool’s creator sets the initial price of the assets in the pool.
- A liquidity pool holds a pair of assets, and the pool creator initiates a new market for that pair of assets.
- Liquidity Pool contributors are incentivized to render equal amounts of both assets to the pool. EXAMPLE – equal amounts of BTS and CBTC, depending on current market values for each asset.
- Liquidity Pool contributors receive tokens (called LP tokens) to show ownership equal to the amounts of assets they contribute.
- A 0.3% fee is levied and divided equally depending on the number of LP tokens a contributor holds. (example)
What Happens When a Swap Takes Place in a Pool?
When one of the assets in a liquidity Pool is traded or swapped, the supply of one decreases while the other increases. Therefore, the algorithm adjusts the price changes, and this is called Automated Market Making (AMM.)
This is where Liquidity Pools exhibit their best roles as no professional third party (centralized market maker) is needed to manage the prices of the assets. Liquidity Pool contributors deposit their assets into the pool, and the smart contract sets the prices.
Information on Compumatrix Newsletter regarding the DEFI Project:
How does it work?
Each swap of assets that pass through the Automated Market Maker (AMM) of liquidity pool leads to a movement in the asset price. The AMM uses a constant product model to automatically calculate the price and the user only needs to enter the amount. The exchange operation can be performed by the user at any time. Also, it requires 5 BTS as a fee to output an asset.
After sending tokens to the pool, the makers receive special tokens (LP tokens) – in proportion to how much of the liquidity they provided. When a swap takes place in which the pool participates, AMM collects a fee and distributes it among all the participants in the pool, in proportion to their share. Also, during transactions, an asset market fee is charged. Distribution formula: liquidity pool fee 0.2% + 0.1% asset market fee = 0.3%, excluding slippage. Fee 0.2% is allocated according to the share of each liquidity maker in the pool.
If you have spare assets, you can provide liquidity to earn interest. The constant (A x B = K) works as the product of the number of both assets in the pool. Thus, the pool can always provide liquidity. The less A tokens remain, the more expensive they become, and the cheaper the B tokens become. If someone buys a lot of CBTC in a CBTC / BTS pair, he decreases the BTS pool and increases the CBTC pool, which immediately affects the exchange rate. The larger the pool volume in relation to the size of the swap, the less this swap affects the price.
Additional Information from https://finematics.com/
The main takeaway here is that the ratio of the tokens in the pool dictates the price, so if someone, let’s say, buys ETH from a DAI/ETH pool they reduce the supply of ETH and add the supply of DAI which results in an increase in the price of ETH and a decrease in the price of DAI. How much the price moves depends on the size of the trade, in proportion to the size of the pool. The bigger the pool is in comparison to trade, the lesser the price impact a.k.a slippage occurs, so large pools can accommodate bigger trades without moving the price too much.
Because larger liquidity pools create less slippage and result in a better trading experience, some protocols like Balancer started incentivising liquidity providers with extra tokens for supplying liquidity to certain pools. This process is called liquidity mining…
The concepts behind liquidity pools and automated market-making are quite simple yet extremely powerful as we don’t have to have a centralized order book anymore and we don’t have to rely on external market makers to constantly keep providing liquidity to an exchange.
And of course, like with everything in DeFi we have to remember about potential risks. Besides our standard DeFi risks like smart contract bugs, admin keys and systemic risks, we have to add 2 new ones – impairment loss and liquidity pool hacks.
Freestartupkits.com had this to add to Risks:
The downside to AMMs is that the price adjustment model has to be carefully set. If this price-adjustment model is not sensitive enough, the AMMs cash can easily run out, and if this price-adjustment model is over-sensitive, minor trades can create large undulations at the price.
These automated market makers are incentive to the liquidity (or lacking liquidity) of a market because of its “deterministic nature of price-adjustment models”. This is key because it means that trades cause prices to move the same amount in both busy and spare markets.
The benefits of the AMM are that there is always availability. AMMs makes it possible to always act as a counterparty (although the price the AMM offers could be more expensive than other exchange methods). Automated market maker smart-contracts also can easily integrate with external smart contracts.
Consider everything before taking part, as there are no guarantees.