Glossary

Router

A router is the smart contract in a decentralized exchange that receives a user's swap request and directs it through the right liquidity pool or sequence of pools to complete the trade. Users and interfaces rarely interact with individual pools directly; they call the router, which handles path-finding, executes multi-hop trades, and enforces the user's protections such as minimum output and transaction deadlines.

A concrete example: you want to swap a smaller token, say token A, for token B, but no direct A/B pool exists. Uniswap's router builds a path — A to WETH, then WETH to B — and executes both hops atomically in one transaction. If any hop fails or the final output falls below your slippage tolerance, the whole trade reverts and you keep your original tokens. The router also wraps and unwraps ETH automatically, since pools hold WETH rather than native ETH.

Because routers are the contract you grant token approvals to, they are security-critical: approving a malicious contract that mimics a router is a common way wallets get drained, so users should verify contract addresses through official interfaces. A common misconception is that the router sets prices — prices come from the pools themselves; the router simply finds and executes the path. DEX aggregators extend the same idea across many exchanges at once, competing to find better routes than any single protocol's router.