Slippage tolerance picker for trade UIs. Renders a row of preset chips
(0.1% / 0.5% / 1%) plus a custom input. Returns the chosen value as basis
points so the caller can compute minTokensOut / minPlsOut.
Web3.Ui.SlippageInput.view
{ valueBps = model.slippageBps
, onChange = SlippageChanged
, presetsBps = [ 10, 50, 100 ] -- 0.1%, 0.5%, 1%
}
-- Helper: derive the minOut value given an expected amount and slippage.
let
minOut =
Web3.Ui.SlippageInput.minOutFromBps model.slippageBps expectedAmount
in
contractCall { ..., minOut = minOut }Style classes: web3-slippage, web3-slippage__chip, web3-slippage__chip--active,
web3-slippage__custom.
Compute expected * (10000 - slippageBps) / 10000 in BigInt arithmetic.
Returns BigInt.zero if the slippage exceeds 100%.
Render the picker.