DEXs rely on smart contracts instead of middlemen to provide financial services, such as trading, lending, or borrowing, to users. Users deposit their tokens to pools to provide liquidity to the platform for rewards – typically a cut of fees paid by traders who use these services.