How Decentralized Exchanges (DEX) Work
If you know about how trades work, you essentially know why DeFi is huge. Repost from May 2022
Hello Professionally Curious One!
If you’re reading this, I’m currently suffering on an Airplane to Europe on American Airlines. I consider them an airline to be just a tad above United, and I dislike United.
Today’s crypto explainer is about Decentralized Exchanges, or DEX.
Is Coinbase a DEX? No, that’s a centralized exchange.
Is Kraken a DEX? No, that’s a centralized exchange.
So what’s a DEX?
Okay, so what is a DEX really?
I explain that to you today.
As always, you can find TL;DRs and graphics as I explain what could potentially be a very absurd foreign set of concepts. Also I promise to cover other topics beyond Crypto!
In Case You Missed It
Sections You Can Skim To:
How does a Centralized Exchange Work?
How does a Decentralized Exchange Work?
How Might We Ensure Transactional Activity?
How is This Replicated in DeFi?
Closing
TL;DR: I can trade with people, and there is a central authority to settle trade issues.
Let’s start with an Central Exchange. Coinbase Exchange or New York Stock Exchange, it doesn’t matter as they all have similar models.
The way a Central Exchange works is that there is a movement of things between a buyer and a seller in a marketplace. The Central Exchange provides convenience of one location for everyone to gather. The Central Exchange itself takes a stall fee / distribution fee / platform fee, and the buyers and sellers can go on trading as they need.
Except, buyers and sellers are human, and they can take a while to make a decision. Buyers wait and find deals, sellers wait and find opportunities. You may have a lot of buyers and sellers in a marketplace, but that doesn’t necessarily mean there's a lot of transactional activity.
Thus there is a supply and demand issue.
What happens when there’s not a lot of transactional activity?
What happens when there isn’t a lot of free flowing assets?
Well the Central Exchange becomes a time intensive waiting game.
Long waits until you find a buyer/seller - if no one is buying, and no one is selling, at the times you do business, what do you do?
When there isn’t a lot of activity, there isn’t a lot of capital moving. A lot of time is burned, and the worst outcome - no trade activity, happens frequently. It’s not much of a exchange if no one is exchanging. Not enough exchanges creates an ill-liquid market, complete with very few transactional activity.
It’s a catch 22 - How do you get more people to trade if no one is trading, and how do you get more things to trade if no one is trading?
What you ultimately experience:
NO ONE IS BUYING / NO IS SELLING at the times you need it.
How does a Decentralized Exchange work?
TL;DR: I can trade directly with people using the power of only technology.
A DEX is short for Decentralized Exchange. No, it’s not short for Dexterity or Dexter.
In short, Decentralized Exchanges (DEXs) allow us to trade our assets directly with one another without the need for a broker or middle-man institution, around the clock. The trades are conducted through protocols and smart contracts that are part of a blockchain ecosystem.
I can do a trade at 2 am or I can do it at 4pm. Essentially, I can trade my digital money for other digital money or even fiat currencies - all without the presence of a middleman institution. And that’s a rather freeing concept for those of you who had to handle currency exchanges ever.
I can send massive amounts of crypto, and never have to suffer a preventive lock from a financial institution, or pay any additional handling fees, or you know, get my cash taken away at the airport for being too high.
But it also has the same fundamental problem of a Centralized Exchange.
A supply and demand issue.
What happens when there’s not a lot of transactional activity?
What happens when there isn’t a lot of free flowing assets?
TL;DR: Central Exchanges partner with Market Makers, whom provide capital to Central Exchanges so that all transactions can happen on demand.
Central Exchanges came up with this clever idea to ensure transactional activity for its buyers and sellers that are conducting trade on their platform. They partnered with Market Makers.
Money Market Makers (Banks and Large Firms) provide liquidity to a centralized exchange to ensure that there is enough trade volume so that all trades can be done seamlessly.
A Market Maker has enough capital to always buy, and always sell, at large scale, even if the Market Maker loses out on some trades - they are like a casino - they make up for it in sheer volume.
Market Makers set their prices based on calculated demand vs supply, and publish the prices for users. You can buy or sell at their rates whenever you want. Sure you might not get the best deal, but at least you can trade with someone on-demand. It’s up to you to sell/buy now, or wait for a better deal, but the trade-off here is that you get convenience.
Market Makers provide Liquidity so that an Exchange like Coinbase can function seamlessly.
Here’s how this works for Market Makers:
Whatever the market price is, Market Makers will offer slightly less to buy your asset, or offer slightly more to sell their asset to you. It’s like wholesale pricing.
You will probably be charged a trade commission as well, a convenience fee or handling fee, on top of the usually small difference in expected prices.
Market Makers are underpinned by a Liquidity Pool, or a guaranteed supply of liquid capital. The supply is contributed by individual entities who have enough liquid cash to support the trades of other people.
In return for essentially lending capital to a Central Exchange to help facilitate trades, the liquidity pool providers, or Market Makers, are earning a % cut based on each individual liquidity pool’s provided stake. So if one liquidity contributor contributes 30% of all liquid capital to support a Centralized Exchange, this individual contributor is entitled to 30% of all trade fees, less any other fees from the Central Exchange.
Currently, in order to qualify as a Market Maker, there are some requirements based on the Central Exchange of choice. For NYSE, you need $100k minimum net capital, $2,500 for each Security (Stock) you register publicly under, and a couple of other intense regulatory requirements. Basically, you need a lot of money.
Mini TL;DR: A Market Maker is basically a giant air traffic controller, or like Wilson Fisk with all trading going through him.
TL;DR: They copied the above, and lowered the barriers.
A Central Exchange is supported by Market Makers (MM). Market Makers provide the liquidity directly to the Central Exchange for it to function and facilitate trades.
A Decentralized Exchange is supported by… Automated Market Makers (AMM). Automated Market Makers provide liquidity to the Decentralized Exchange. Yep it’s the exact same thing.
Automated Market Makers utilize the embedded protocols within a blockchain to execute the necessary pricing, processing, and liquidity services that are required for a Decentralized Exchange to function.
Under DeFi, there are no barriers for you to be a liquidity provider to an Automated Market Maker program. There are also no barriers at all for you to trade on any Decentralized Exchange.
TL;DR: Lowered barriers for everyone across all areas.
Look, a technology is pointless if it isn’t solving human problems. Here’s what the technology provided by the Decentralized Finance revolution is now offering, in the context of DEX and Automated Market Makers:
Automated Decision Making: Blockchains (Ethereum) offers a unique technology backed ability: Smart Contracts. Smart Contracts are automated buy / sell conditions for your asset. I mean, there’s other stuff too, but really what you need to know is that a contract can automatically execute on a blockchain provided the criteria is met, without you having to sign or do anything. I can set it and forget it. Which means…
Systematically Less Energy: I don’t need to call anyone, nor do I need to wait for multiple institutions to clear, nor do I need to wait for business hours, to trade. I don’t actually need to talk to anyone.
Barriers of Entry: There really isn’t any barrier to entry given the low cost to execute.
Addendum:
What is the point of a Centralized Exchange if we have Decentralized Exchanges?
At this time, Centralized Exchanges serve as the best and easiest “on-ramping” and “off-ramping” option into the crypto world. They are the point of entry where you can take your fiat $USD, and buy Crypto.
You then take your crypto and go to Decentralized Exchanges, and trade with other people Crypto to Crypto - except you won’t actually know who is on the other end but suffice to say, you’ll find a decent price.