audit
audit copied to clipboard
yswap impermanent loss protection on buy/sell
How does yswap protect if the protection only happens on withdrawing liquidity and not during every buy/sell? https://github.com/yearn/audit/blob/4b07283c80fc005e899afa8b5fb2bb949fe11f28/contracts/ySwap/StableAMMv3.sol#L473
@andrecronje can you explain why yswap protect from impermanent loss? it needs to know how much of asset A i deposited originally, to compare their value today vs the value I get when withdrawing my LP. In the code I see only calculation of using current amount of asset A i'm entitled too from the pool, but if asset A relative amount in the pool has shrunk (because of drainage by arbitragers), it will not correctly calculate impermanent loss