A decentralized exchange (DEX) is a peer-to-peer marketplace where users can trade cryptocurrencies in a non-custodial manner without the need for an intermediary to facilitate the transfer and custody of funds. The Decentralized exchange executes an exchange between two different tokens. Depending on the amount of tokens traded, it will calculate the price of the token desired, display the amount of tokens that will be received, and upon submitting the transaction, the DEX will swap the tokens for the new token at the agreed upon market rate.