Most DEXs earn money by charging fees to process transactions. For instance, if a trader wishes to swap between two assets, they will pay a fee which is a percentage of the value of the trade, say 0.5%.