![](https://cursa-json-routes.s3.amazonaws.com/texts/byId/1000255/imgs/62.jpg)
How decentralized exchanges work
Página 62
Decentralized exchanges, also known as DEXs (Decentralized Exchanges), are platforms that allow the exchange of cryptocurrencies directly between users (peer-to-peer), without the need for a centralized intermediary, such as a cryptocurrency exchange. traditional exchange. This is possible thanks to blockchain technology and smart contracts.
Unlike centralized exchanges, which maintain control over users' private keys, in DEXs, users retain control of their private keys and therefore their funds. This provides a much higher level of security as even if the platform is hacked, users' funds are not at risk.
DEXs operate with the help of smart contracts, which are autonomous programs that automatically execute the conditions of a contract when certain conditions are met. In the case of DEXs, smart contracts are used to create and manage buy and sell orders, as well as to carry out transactions when order conditions are met.
Let's take a deeper look at how DEXs work, step by step.
1. Creation of a portfolio
To use a DEX, the first step is to create a digital cryptocurrency wallet. There are many wallets available, some of which are directly integrated with DEX. The wallet is where you store your private keys, which are essentially the password to your funds.
2. Connecting the wallet to the DEX
After creating a wallet, you need to connect it to the DEX. This is done by providing DEX with your public wallet address. This allows DEX to recognize your wallet and associate it with your account.
3. Depositing funds
Before you can start trading, you need to deposit funds into your wallet. This is done by sending cryptocurrencies from your wallet address to the DEX wallet address. DEX records the deposit and credits the funds to your account.
4. Creating an order
Once the funds are in your account, you can create a buy or sell order. You specify the cryptocurrency you want to buy or sell, the price you are willing to accept and the amount you want to trade. The order is then added to the DEX order book.
5. Executing the order
When an order matching your order conditions is created, the DEX smart contract will automatically execute the transaction. Funds will be transferred directly from one wallet to another, without going through an intermediary. The DEX then updates the account balance accordingly.
6. Withdrawing funds
Once you have completed your trades, you can withdraw your funds. This is done by sending a withdrawal request to DEX, which then sends the funds back to your wallet.
DEXs offer many benefits over centralized exchanges, including greater security, privacy and control over your funds. However, they also have their disadvantages, such as lack of liquidity and difficulty for beginners to use. Despite this, DEXs are becoming more and more popular and are playing an increasingly important role in the cryptocurrency ecosystem.
Now answer the exercise about the content:
_Which of the following statements is true about decentralized exchanges (DEXs)?
You are right! Congratulations, now go to the next page
You missed! Try again.
![](https://cursa-json-routes.s3.amazonaws.com/texts/byId/1000255/imgs/63.jpg)
Next page of the Free Ebook: