This plug computes a minimum received amount from an expected amount and a slippage tolerance. It asks the caller for expected_amount, the baseline quantity, and max_slippage, the tolerance fraction expressed against a WAD scale of 1e18. It runs on demand, subtracting max_slippage from 1 and multiplying expected_amount by that retained fraction divided by WAD, rounded down. Deriving this floor by hand or from a stale expected_amount risks setting a threshold that a swap cannot clear or that admits more slippage than intended.
Actions · 4
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Getconstant
Holds a well-known constant as a named value: max uint256, WAD, RAY, basis points, one, or zero.
Calculatetimesdividedbyrounded
Multiplies two values and divides by a third in one step, rounding up or down.
Bubble
Surfaces a value as an output of this plug.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.