Skip to content
Crypto Bulletin

Markets, protocols and policy news

ID 3a149f

DEX Swap Deadlines: Router Timing and Slippage

The DEX swap deadline sets the last valid time: the router checks the included block timestamp, while slippage tolerance sets the lowest acceptable output.

Crypto Bulletin Newsroom 2 min read

DEX Swap Deadlines: Router Timing and Slippage

A DEX swap transaction deadline sets the latest time a router may execute the swap; after that time, the router reverts it instead of trading at a stale price.

Take a swap with a 20-minute deadline that gets stuck because its gas fee is too low. If it is included in a block 25 minutes later, Uniswap V2 Router02 checks the block timestamp, sees that the deadline has passed, and reverts the swap.

The tokens stay in the wallet, but the failed transaction still uses gas, so the sender pays for the work it consumed. Ethereum.org explains that transactions can remain pending when their gas fee is below what the network currently requires.

How deadline and slippage work together

Router02’s swap functions take a deadline parameter, and its contract requires the deadline to be at least the current block.timestamp. The timestamp comes from the block proposer, so the check happens when the transaction is included—not when it is submitted.

Slippage tolerance sets the price limit; the deadline sets the time limit. In a swap, the slippage setting translates into a minimum acceptable output, while the deadline stops the router from executing after the chosen time. Together, they limit the risk of a delayed fill.

For TeleSwap, this timing rule applies to its EVM swap leg. The linked explanation of teleswap how it works helps place that leg in the wider transaction flow.

A very long deadline leaves a low-fee transaction eligible for longer. If the market moves during that wait, the swap could still execute at a worse price, provided the output remains within the slippage tolerance.

Uniswap’s interface settings let users adjust the transaction deadline. Choose a window that gives the transaction time to confirm, while keeping the price limit in mind; if a pending swap has expired, replace it with a cancellation transaction using the same nonce instead of simply waiting. Ethereum.org describes that same-nonce cancellation approach for pending Ethereum transactions.