Sometimes you can’t buy hot new tokens because your usual cryptocurrency exchange doesn’t have them yet. To fix this, try using a decentralized exchange (DEX). In this quest, you’ll learn how to use PancakeSwap, the biggest DEX, and then how it works.
Ingredients
A Metamask wallet with BNB in it.
Instructions
1. Head over to PancakeSwap.
2. Connect your metamask wallet.
3. Back in PancakeSwap, hover over Trade and then click on Swap to find the available coins.
4. Use BNB as the coin you’ll swap at the top, and then CAKE for the coin you’ll swap at the bottom.
5. Select how much you’d like to trade, click Swap, and then click Confirm Swap!
6. This will open up metamask, where you’ll have to pay a small exchange fee. Once the fee goes through, your browser and the website will notify you.
7. Then click “add CAKE to Metamask” to add the token to your wallet. Note - it may not show up in your metamask wallet if you haven’t added CAKE as a token. Don’t fret! Try looking for it under the assets tab in metamask.
You can also confirm that you have cake by going to the top right corner of the web page, clicking on your wallet and looking at your balance on the screen.
If it still doesn’t show up, you probably need to get Metamask to recognize CAKE - here’s a guide.
8. There you have it! You have now used a decentralized exchange to swap BNB for CAKE.
How it all works
What makes decentralized exchanges like PancakeSwap different from a centralized exchange like Coinbase? A couple of things! One, there’s no KYC (know your customer), so you do not need to share personal information to trade coins. Two, there’s no centralization - at the back of a DEX are smart contracts humming away. Three, DEXs are cheaper because few people work for them, which also means no customer service. And four, DEXs let you swap tokens instantaneously. Let’s go through this last one.
When you swapped your BNB for CAKE, it happened instantaneously. This doesn’t happen in centralized exchanges (CEXs) like the New York Stock Exchange. They use order books to buy and sell things. If you want to sell a stock on the NYSE, you give them the stock and tell them the price you want to sell it for. They then hold onto it until they find a buyer. This can take a lot of time if nobody wants to buy it or if everyone else thinks it costs too much. This makes the stock illiquid.
Liquidity refers to how quickly you can sell something. Super expensive houses that stay on the market for months are illiquid because nobody wants to buy it for its price. On the other hand, popular stocks like Apple always has a lineup of buyers ready to buy it. This makes Apple stocks liquid.
Decentralized exchanges (DEXs) don’t use order books like the NYSE does. Instead, they use liquidity pools and automated market makers. Let’s break that down.
Instead of waiting for a buyer to come and purchase your token, a DEX will have a pool of tokens on hand at all times. For us, PancakeSwap had a pool with both BNB and CAKE. When you wanted to swap one for another, PancakeSwap did so instantly from their liquidity pool, instead of waiting for someone. That’s what makes DEXs faster.
One question remains: how then do DEXs set their price? The price of a stock on the NYSE is usually the last bid that goes through. But DEXs use automated market makers instead. These are smart contracts that use algorithms to decide what the price should be.
Behind the scenes of your swap, PancakeSwap had a pool of both BNB and CAKE. When you sold your BNB to buy CAKE, you added to the supply of BNB in the pool, and you lowered the supply of CAKE in the pool. This means that the price of BNB should go down (because there’s now more of it) and the price of CAKE should go up (because there’s now less of it).
The automated market maker is what changes the price of BNB and CAKE. You can actually impact the price of a token on an exchange just by buying/selling it! This is called the price impact and PancakeSwap shows you how much that is when you exchange a token.
There are many DEXs with their own unique reasons for existing. PancakeSwap lets you swap tokens native to the Binance Smart Chain, like CAKE, BNB, and Backstab Doge. UniSwap lets you trade ethereum-native tokens (called ERC-20s) like TetherUSD (USDT) and Shiba Inu (SHIB). SushiSwap is, well, a fork of UniSwap, and the difference between the two can only be explained after you go through the next quest.
Thanks for reading! In the next quest, you’ll be the one supplying tokens to the liquidity pool, the risks involved (like “impermanent loss”), and how people make money from it.
Note: Crypto is very risky, and people have lost lots of money in it. Please do your own research before making any moves. The above was my attempt to explain how DEXs work. It is not financial advice.