What is a DEX? How A Decentralized Exchange Works
By Whiteboard Crypto
Summary
## Key takeaways - **DEX Replaces Central Authority with Smart Contracts**: A DEX is a decentralized exchange that allows you to trade your crypto coins and tokens in a decentralized way. They work without a central authority, instead replacing it with a smart contract, which is code that allows two people to enter into an agreement and prevents fishy behavior. [01:04], [01:22] - **No KYC: Full Anonymity on DEXs**: One of the major benefits of DEXs is that you don't need to submit your KYC info, meaning no social security number, profile pictures, fingerprinting, or even your name. This is a huge part of decentralized finance, being anonymous. [02:07], [02:29] - **DEXs Faster, Cheaper, Trustless**: DEXs are usually much faster than centralized exchanges, allowing you to transfer tokens in mere seconds, and they require a very small fee, pennies on the dollar. They are trustless since you trust the open-source smart contract code audited by hundreds of developers, not humans like at Coinbase or Binance. [02:45], [03:08] - **AMM: Trade Pools, Not People**: Most DEXs use an automated market maker or AMM, where you trade with a pool of funds instead of waiting for a person to match your price. The pool charges more as you buy and gives less as you sell, using liquidity pools and algorithms that dynamically price tokens. [05:49], [06:13] - **Order Book: Traditional but Slow for DeFi**: The order book method, used by the US stock market, requires you to place an order at a specific price and wait for someone to match it exactly, locking your funds until then. It has drawbacks in DeFi like waiting for agreement, so few DEXs use it compared to AMMs. [04:34], [05:24] - **DEX Limits: Same Blockchain Only**: DEXs only allow you to swap crypto for crypto on the same blockchain, for example Uniswap only swaps Ethereum and Ethereum tokens. You cannot swap between blockchains without bridges. [01:44], [02:07]
Topics Covered
- Arcade Tokens Mirror DEX Wrappers
- Smart Contracts Trump Human Trust
- Code Reliability Beats Human Flaws
- AMMs Replace Waiting with Pools
Full Transcript
Have you ever been in an arcade? I've actually been to a lot of arcades, and they're usually a lot of fun, especially if you have a cute girl or a beautiful woman with you. Nevertheless, to play the games at an arcade, you usually need to bring a backpack of quarters. Now, these quarters are heavy, but they are the fee to play the games. At least, this is the case at many arcades.
A few weekends ago, I went to an arcade that didn't let me use quarters.
In fact, I had to trade my quarters for a special arcade token in order to play their games. Now, there's probably psychological and economical factors for this that probably led to me giving them more money, but I had to exchange my quarters for their version of a quarter. Did you know that you can actually do this in crypto? Welcome to Whiteboard Crypto, the number one YouTube channel for crypto education, and here
crypto? Welcome to Whiteboard Crypto, the number one YouTube channel for crypto education, and here we explain topics of the cryptocurrency world using analogies, stories, and examples so that you can easily understand them. In this video, we are going to explain what a decentralized exchange is, or a DEX, and some of the benefits that they have over a
centralized exchange, or a SEX, and also two methods of how they work. A DEX
is a decentralized exchange, meaning that it allows you to trade your crypto coins and tokens in a decentralized way. First off, you need to understand that they work without a central authority. Instead, they replace a central authority with a smart contract. Smart contracts
are pieces of code that allow two people to enter into an agreement. It's basically
like a legal agreement, instead, it's written in code. So if both parties do what they agreed to, the smart contract will work like it should. But if one person wants to try something fishy, the smart contract won't let them, or they'll give the other person their money back. So DEXs do have limitations though. They only allow you to swap crypto for crypto. And those cryptocurrencies do have to be on the same
blockchain. For example, if you used Uniswap, you can only swap Ethereum and Ethereum tokens.
blockchain. For example, if you used Uniswap, you can only swap Ethereum and Ethereum tokens.
Sushiswap though, which we have a video over, has expanded to many other blockchains, but you still cannot swap in between those blockchains. As of right now, you must stay within the realm of the blockchain of the token that you have. If you'd like to do inter -blockchain token switching, you'd need to watch our video on blockchain bridges.
But moving on, let's go over some benefits and drawbacks of a DEX first, then we'll get into how they work. First off, one of the major benefits of DEXs is that you don't need to submit your KYC info. KYC stands for Know Your Customer, and this means you don't need to submit your social security number, your profile pictures, there's no fingerprinting, you don't even need to share your name. Now this is
a huge part of decentralized finance, being anonymous. Secondly, there is no centralized authority. Instead of trusting Coinbase or Binance, you just have to trust the smart contract,
authority. Instead of trusting Coinbase or Binance, you just have to trust the smart contract, which is essentially code. Code, in fact, is much more reliable than humans. This code
is what we call open source, which means you can take a look at it if you want and find bugs or errors. Usually, this means hundreds of great developers are going to check it out before using it. Now another thing is that these DEXs are usually much faster than centralized exchanges, allowing you to transfer tokens in mere seconds, and they usually require a very small fee, pennies on the dollar compared to
centralized exchanges. So DEXs are faster, cheaper, trustless, and they don't require any
centralized exchanges. So DEXs are faster, cheaper, trustless, and they don't require any personal info. Already, it sounds like great technology waiting to blow up. But they don't
personal info. Already, it sounds like great technology waiting to blow up. But they don't come without downsides, though. DEXs don't come with support. This means if you have an issue, there's nobody to call, nobody to message about your issue. Sometimes they do have community forums, but those are just other people generously helping out, not someone required to offer you help. This means if you do something wrong and you send your coins
to a different address, or maybe you buy a scam coin that looks similar to a true coin, it's going to be your fault, and you'll probably never get them back. So you've got to be very careful what you do on a DEX. Another
back. So you've got to be very careful what you do on a DEX. Another
drawback is that you must use a hot storage device. This means your wallet must be connected to the internet. On a centralized exchange, your tokens sit on their exchange, waiting to be moved around at your beck and call. But using a decentralized exchange, you must connect a wallet, either through your computer physically, or through using an extension
like Metamask. Another drawback is that sometimes these DEXs have low liquidity, meaning that if
like Metamask. Another drawback is that sometimes these DEXs have low liquidity, meaning that if you buy a lot of a token, the price's coin should shoot up. Vice versa
too, if you sell a ton of tokens, you could crash the price. Lastly, as
we mentioned before, the code is open for anyone to see. And this is a double -sided sword. If a hacker wants to, they can experiment with the code, find a bug, and then if they find a vulnerability, they could simply exploit it. Now,
let's get on to how they actually work. First off, we want to explain to you the order book method. So the order book method is the exact method that the United States stock market uses. In fact, it works and it has worked for ages, but it does have some drawbacks when it comes to decentralized finance. So how
it works is if you want to buy or sell something, you simply pick a price you want to buy that asset for, and then you put in an order.
So if you want to buy something, you give the third party, either the stock market exchange or a smart contract, your money. When it finds someone who wants to perform the exact trade that you're offering, it swaps the two and gives you what you want. When you sell something, on the other hand, you just give it the
you want. When you sell something, on the other hand, you just give it the asset that you want to sell and wait for someone to come along who wants to buy it. Otherwise, you can look at the whole order book and find someone who has already put an order in. Then you can agree to their terms and complete the transaction. We're working on a video about limit orders and market orders, so
maybe it'll clear some of this up. But this is traditional finance. And the big downside of this is that you have to wait around for someone else to completely agree to your transaction terms. You'll also have to have your funds or your assets locked up until a third party comes along and agrees. There aren't very many DEXs that use this method, but it's because there's a much better method when it comes
to DeFi. And that is using an automated market maker, otherwise known as an AMM.
to DeFi. And that is using an automated market maker, otherwise known as an AMM.
An automated market maker is the algorithm that most DEXs use. Now there's many benefits for this. For one, you don't have to wait around for a person to match
for this. For one, you don't have to wait around for a person to match with the price that you want to trade with. Instead, you're trading with a pool of funds instead of a person. Each token that you buy, the pool of funds gradually charges you more and more. And each token that you sell to it, it gradually gives you less and less. Now these pools are actually called liquidity pools. And
we have two great videos on how they work. Liquidity pools and automated market makers.
Our liquidity pool video explains how investors can make money. And our AMM video explains exactly how the algorithm works. Now these algorithms use a special formula to make sure that they can always sell more and more tokens, even if they have barely any left. The less they have, the more they charge. This incentivizes some traders to come
left. The less they have, the more they charge. This incentivizes some traders to come along and balance the pool back out by making a profit off of the opposite trade. These algorithms work amazingly well to set prices and allow traders to trade, which
trade. These algorithms work amazingly well to set prices and allow traders to trade, which is probably why most DEXs use them. So that's actually all we have for this video. There wasn't too much to cover about a DEX, but we hope that we've
video. There wasn't too much to cover about a DEX, but we hope that we've covered the important parts. Thank you guys so much for watching this video. We hope
that you've enjoyed it. We really hope you've learned something. And most of all, we hope to see you in the next video.
Loading video analysis...