paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

allow slippage to be set when pay by swap #14680

Open gilescope opened 1 year ago

gilescope commented 1 year ago

Currently None is passed as the minimum swap return amounts when paying by swap. In a heavy MEV environment this could lead to people paying too much in fees. This PR surfaces the optional max_fee parameter so that wallets can (and ideally should) set this to a sensible value to ensure that there is a limit to how much a MEV bot could manipulate the fx rates and the transaction still succeed.