liquity / dev

Liquity v1 monorepo containing the contracts, SDK and Dev UI frontend.
GNU General Public License v3.0
329 stars 315 forks source link

Prevent bLUSD LP withdrawal MEV sandwiching #1005

Closed edmulraney closed 1 year ago

edmulraney commented 1 year ago

Specify min out parameters for Curve liquidity withdrawals.

danielattilasimon commented 1 year ago

It looks good, although I'm not sure how precise the withdrawal prediction is (particularly those cases where we rely on calc_withdraw_one_coin()). Maybe we need to add a slight slippage tolerance (e.g. 0.1%).

Have you tried each case (bLUSD, LUSD, both)?

edmulraney commented 1 year ago

Good suggestion on fixing a min slippage. This should reduce transaction failure.

With a slippage of 0.1% I didn't receive any failed transactions on a mainnet fork, for each case: bLUSD, LUSD and both.