How Is Impermanent Loss Calculated?
Impermanent loss is calculated by comparing the value of the assets if they had been held outside the pool versus their current value within the pool. The calculation is based on the ratio of the two assets' prices at the time of deposit versus the time of withdrawal.
The common formula is derived from the constant product formula.