Submitted by Abdessamed, also found by 0x1982us, 0xAlix2, 0xRajkumar, Bauchibred, carrotsmuggler, DadeKuma, Egis_Security, honey-k12, jasonxiale, Sparrow, and Usagi
/contracts/pool-manager/src/liquidity/commands.rs#L412-L503
The withdraw_liquidity function allows users to withdraw assets from a pool in exchange for burning their LP tokens. However, the function does not provide a mechanism for users to specify the minimum amount of tokens they are willing to accept upon withdrawal. This omission exposes users to the risk of receiving fewer tokens than expected due to market conditions especially for ConstantProduct pools between the transaction initiation and execution.
As seen above, the function directly calculates the refund amounts and transfers them to the user without any check for slippage or allowing the user to specify a minimum acceptable amount.
Users withdrawing their liquidity can receive less amount than they expected.
Consider allowing users to provide minimum amount of tokens to receive.
jvr0x (MANTRA) disputed and commented:
3docSec (judge) commented:
