Applies to AMM, where a contract holds assets on both sides of a trading pair. Suppose the AMM imposes a fixed exchange ratio between the two assets, and both assets appreciate in market value. The first asset appreciates by more than the second asset. Users drain the first asset and the contract is left holding only the second asset. The impermanent loss is the value of the contract if no exchange took place (value of both tokens) minus the value of the contract after it was drained (value of second token).