Overview of LP Pools

Liquidity pools

Liquidity pools are an amazing feature within the Crypto space that help tokens in decentralized finance become easier to trade/ swap by increasing liquidity. It's based around Automated market makers (AMMs) which are decentralized finance protocols that allow for the swapping of assets without a centralized intermediary. Smart contracts replace trading desks and order books in "making the market."

AMM (Automated Market Maker)

Trades are executed using assets from liquidity pools. Users create pools for specific tokens and deposit assets into them. Users who supply assets to a pool are called liquidity providers (LPs).

AMM pools are permissionless, meaning a user can make a pool for any asset. Permissionless pools are key to decentralization, but they also create risks. Some users list fake tokens, hoping to trick others into buying the wrong asset. A common version of this scam is a token with a slight misspelling of a popular token (e.g., VPMD). It is especially important to make sure one is purchasing the correct asset before executing a trade.

TOKEN WEIGHTS

Liquidity pools are clusters of tokens with pre-determined weights. A token's weight is how much its value accounts for the total value within the pool. For example, VaporDEX pools involve two tokens with 50-50 weights. The total value of Asset A must remain equal to the total value of Asset B.

PRICING

Fixed token weights allow AMMs to achieve deterministic pricing. Tokens in liquidity pools maintain their weight (value relative to one another) even as the quantity of tokens within the pool changes. Prices adjust so that the relative value between tokens remains equal.

For example, in a pool with 50-50 weights between Asset A and Asset B, a large buy of Asset A results in fewer Asset A tokens in the pool. There are now more Asset B tokens in the pool than before. The price of Asset A increases so that the remaining Asset A tokens remain equal in value to the total number of Asset B tokens in the pool.

Deterministic pricing is the reason liquidity is so important to AMMs. The cost of each trade is based on how much it disrupts the ratio of assets within the pool. Traders prefer deep liquid pools because each order tends to involve only a small percentage of assets within the pool. In small pools, a single order can cause dramatic price swings. It is much more difficult to purchase 1,000 VPND from a liquidity pool with 2,000 VPND, than a pool with 2,000,000 VPND.

Low-liquidity pools result in a phenomenon called slippage, in which the cost of a trade is either much higher or lower than the trader expects. (Slippage can either be positive or negative. Positive slippage works in the trader’s favor.)

Arbitrage between liquidity pools keeps the asset prices in line with what one sees on centralized platforms. Imagine a scenario in which a trader buys nearly all of Asset A within a pool. The pool now contains very few units of Asset A and a plethora of Asset B. Since the total value of Asset, A must equal Asset B’s total value, the price of Asset B in the pool is now extremely low!

Seeing this opportunity, arbitrage bots swoop in to buy the underpriced Asset B for selling in other markets. Eventually, this arbitrage is no longer profitable, meaning the prices of Asset A and Asset B are virtually equal to their “true” market price as reflected by other platforms.

MARKET MAKER FUNCTIONS

Many AMMs utilize the Constant Product Market Maker model (x * y = k). This design requires that the total amount of liquidity (k) within the pool remains constant. Liquidity equals the total value of Asset A multiplied by the value of Asset B.

Prices in the pool are determined by this function (shown in the curve below). The cost of each trade is based on how much it shifts the curve. Each additional unit of Asset B that the trader purchases shifts the curve even further right, meaning each unit of Asset B is more expensive than the previous one.

LP TOKENS

When users deposit assets into a liquidity pool, they receive LP tokens. These tokens represent their share of the total pool.

For example, if Pool #1 is the VPND<>AVAX pool, users can deposit VPND and AVAX tokens into the pool and receive back Pool 1 share tokens (VLP). These tokens do not correspond to an exact quantity of tokens, but rather the proportional ownership of the pool.

When users remove their liquidity from the pool, they get back the percentage of liquidity that their LP tokens represent.

Since buying and selling from the pool changes the quantities of assets within a pool, users are highly unlikely to withdraw the same amount of each token that they initially deposited. They usually receive more of one and less of another, based on the trades executed from the pool.

Impermanent Loss

Liquidity providers earn through fees and special pool rewards. However, they are also risking a scenario in which they would have been better off holding the assets rather than supplying them. This outcome is called impermanent loss.

Impermanent loss is the difference in net worth between HODLing and LPing. Liquidity mining helps to offset impermanent loss for LPs.

When the price of the assets in the pool changes at different rates, LPs end up owning larger amounts of the assets that increased less in price (or decreased more in price). For example, if the price of AVAX moons relative to VPND, LPs in the AVAX-VPND pool end up with larger portions of the less valuable asset (VPND).

Impermanent loss is mitigated in part by the transaction fees earned by LPs. When the profits made from swap fees outweigh an LP’s impermanent loss, the pool is self-sustainable.

Rewards Rewards for providing Liquidity pairs are distributed each time a new LP is made or broken up. This results in the shares changing for all involved. So, the rewards are distributed and placed into your Liquidity pair balance. The ability to show your rewards made in a pair gets extremely complicated due to many factors. 1.) The balance would adjust each time someone made or removed a pair 2.) Impermanent loss

3.) Token Value of asset A 4.) Token Value of Asset B

Last updated