What is impermanent loss in the context of perpetuals AMM?

Impermanent loss (IL) is a risk that arises in all automated market making (AMM) systems. It occurs because market making involves buying when the price goes lower and selling when the price goes higher. However if the price continues in one direction -- the price continues to go lower (for instance) -- then your average buy price may become higher than the current price. In a Perpetuals market this situation would show you as long the contract with an average entry price higher than the current price, and marking-to-market would show this as an unsettled loss.

For a perpetuals market then, IL is the mark-to-market loss you experience due to the price movement from the price at the time you submitted your AMM Instruction, to the current price of the perpetuals contract (specifically, the Mark Price).

Formula for IL:

IL = abs(Entry notional – MTM notional)

where:

MTM notional = Quantity at mark price x MP

Entry notional = L x abs(sqrt(BMP) - sqrt(BIP))

and:

L = (QL + QS) x sqrt(UP x LP) / (sqrt(UP) - sqrt(LP))

Quantity at mark price = L x abs((sqrt(BIP) - sqrt(BMP)) / sqrt(BIP x BMP))

and:

UP = Upper price bound

LP = Lower price bound

IP = Initial price (at the time of AMM Instruction submission)

MP = Mark Price (at the current time)

BIP = Bounded initial price: max(min(IP, UP), LP)

BMP = Bounded mark price: max(min(MP, UP), LP)

QL = Long quantity (contracts you agreed to buy at the lower bound PL)

QS = Short quantity (contracts you agreed to sell at the upper bound PU)

Note that Bullish reports the magnitude of the IL (so that IL is a positive number ≥ 0).

You might also find the article on spot market AMM Instruction impermanent loss helpful.

Was this article helpful?
0 out of 0 found this helpful