Participating in providing liquidity in Swap, you can get real-time transaction fee dividends, but compared with holding the unchanged token (ie: compared with the initial market-making capital), participating in market-making may appear "not cost-effective" circumstances, which are called impermanent loss (also called temporary loss or value loss).
An example is explained as follows:
Suppose you add liquidity in EOS+USDT liquidity pool, the swap price is “1 EOS=3 USDT”, and you provide liquidity with “100 EOS+300 USDT”, then:
When someone pays 100 USDT to swap EOS, calculate by the Swap algorithm:
Therefore, your market-making quantity is updated to 97.0648 EOS+309.09 USDT
Estimated at the latest price: 618.1116 USDT (97.0548*3.1843+309.06)
However, your initial market-making capital is 100 EOS+300 USDT
Estimated at the latest price: 618.43 USDT (100*3.1843+300)
As a result, the value of the latest market-making quantity is 0.3184 USDT (618.43-618.1116) less than the value of the initial market-making capital, which is an impermanent loss.
During this transaction, you, as a market maker, sold EOS at an average price of 3.0969 USDT, and the price after the transaction has risen to 3.1843 USDT, which is equivalent to selling a part of EOS at a price lower than the latest price. This is the reason for the value loss.
Market-making is equivalent to as a party in the transaction uniting with others, waiting for users to trade. The transaction price is automatically calculated by the algorithm. If there is a unilateral quotation of price in a short period of time, one of the token quantity you provide for market making will inevitably reduce, and the other token quantity keeps increasing, which is equivalent to one of the token being swapped to another token at different prices several times. In this process, most of the reduced token are sold at a price lower than the latest price. It will be less valuable than holding the unchanged token purely, which is impermanent loss.
Still taking the EOS+USDT liquidity pool as an example, if the EOS price rises unilaterally, participating in market making is equivalent to continuously selling EOS in swap for USDT, which will earn some USDT less than holding the unchanged token; if the EOS price falls unilaterally, participating in market making is equivalent to continuously buying EOS with USDT, which will lose more USDT than holding the unchanged token. If it can return to the price when participating in the market making, the impermanent loss will disappear, and transaction fees will also be earned.
Impermanent loss will prevail in the early stage of market making or unilateral market. With the accumulation of fees and the price fluctuations, the impermanent loss will gradually be wiped out and market-making gains will be realized.