January 5

The main risk of liquidity pools is now behind us | LP-offset

Liquidity pools are sources of funds for swaps in decentralized finance. For example, if a user wants to exchange TON for USDT, he will go to STON.fi, select the required coins and values, and through a user interface abstraction, trigger the TON/USDT liquidity pool smart contract. To simplify, the smart contract will take the user’s TONs and put them in the liquidity pool, and then take USDT out of the liquidity pool and send them to the user.

But liquidity has to come from somewhere. This is where liquidity providers come into play: they add their coins to the pools in price equivalent. But, obviously, no one wants to block their coins just like that, so for each swap conducted in a pair, in which the liquidity was put, the providers share a percentage of the commission, thanks to which good APR values are achieved, for example, on STON.fi:

All would be fine, but due to the way liquidity pools work, there are impermanent losses.

Impermanent losses

By depositing your coins in the liquidity pool, you receive LP-tokens that confirm your share in the liquidity pool. The key word here is share. Let’s take the STON/USDT pool as an example. Let’s assume that before your liquidity delivery there were 4,000 STON and 20,000 USDT in the pool, so the price of STON is 5 USDT and the TVL of the pool is 40,000$. You decide to add 1,000 $STON and 5,000 USDT to the pool. The price remains unchanged. You, in turn, received LP-tokens, which confirm your share in the pool. It is usually calculated according to the formula:

X * Y = C

Where, X is the amount of the first token you provided, Y is the amount of the second token, C is a constant value characterizing your share in the pool. In this case it will be:

1,000 * 5,000 = 5,000,000

Now, let’s say that the STON token has increased in value 4 times, up to 20$ per coin, and you decide to get your tokens out of the pool. In classic DEX there are no order books, and the price is determined by the ratio of tokens in the pool, so now there are 2,500 STON and 50,000$ USDT in the pool. And your share in the pool is 20%, which means you get:

20% * 2,500 STON = 500 STON

20% * 50,000 USDT = 10000 USDT

The constant value C is preserved when withdrawing from the pool:

500 * 10,000 = 5,000,000

That said, the price of STON at the moment is $20, and by withdrawing from the pool you would get $20,000, but if you just left 1,000 STON and 5,000 USDT on your wallet, you would have $25,000 instead of $20,000. In this case, the impermanent losses would be:

(25,000–20,000)/25,000 = 20%

The impermanent losses can be calculated in the impermanent loss calculator.

Worry about impermanent losses among liquidity providers can lead to liquidity deficit and price instability in some pools, so the problem needs to be solved. For this purpose, impermanent loss protection has been implemented on STON.fi.

Impermanent loss protection

The STON/USDT pool has relatively recently introduced a system of protection against non-permanent losses, which automatically refunds providers’ losses related to impermanent losses. The protection covers losses up to 5.72%, which corresponds to a 2-x change in the coin price. Refunds are made in STON tokens and do not require filling out any forms, everything works fully automatically.

Limitations

  • Maximum refund per 1 wallet is $100 in STON tokens.
  • The pool is limited, a maximum of 10,000 STON can be returned.
  • To participate in LP-Offset for January, you had to put liquidity until January 1. In case the program will be extended for the next month, I think the limitation will remain, and to participate in the February refund you need to put liquidity in January.

Such a system provides Win-Win. Liquidity providers are protected from impermanent losses and STON price becomes more stable due to liquidity inflow.

Also, in order to create even more favorable conditions for liquidity providers, STON/USDT pool has farming.

Farming

In addition to the commission share, in the STON/USDT pool, liquidity providers can share additional rewards in STON tokens for adding their tokens to the smart contract. Every day, 333 STON tokens ($1,500) are shared among those who participate in farming. This provides an additional APR of 37.87%.

Farming guide

Learn more: