Docs
Slippage and deadline
The two checks that can revert a swap.
Slippage
The page default is 50 basis points, 0.50 percent. The API accepts slippageBps from 0 through 1000. minAmountOut is the quoted output times 10000 minus slippageBps, divided by 10000. swap reverts with InsufficientOutput when the tokens received are below minAmountOut.
Deadline
The page default is 20 minutes. The API accepts deadlineMinutes from 1 through 60. The encoded deadline is the current time plus that window, clamped between 60 and 3600 seconds. swap reverts with DeadlineExpired when block.timestamp is past the deadline.