Interacting With DEX & DAPPS In Web3
Welcome to the 3rd edition of Web3 and More. Last week we discussed 'The Role of DeFi in Web3' where we explained every essential component of DeFi.
Today, we’ll be creating our first Web3 wallet, setting up different blockchain networks, funding our wallet through a debit card or CEX account, connecting to a DEX, buying a coin and starting our first yield farming.?
WHY YOU NEED TO LEARN THIS
If you wish to ever utilize Web3 to your benefit now or later in the future, it's a must for you to have practical understanding of DeFi. While the theories are critical in building a basic understanding, practicing how these theories plays out in reality will enable you to take better advantage of all that Web3 got to offer.
Buying cryptocurrency on a decentralized exchange (DEX) is nothing like that of a centralized exchange where everything is practically done for you. With DEX/DApps, you’ll need to set up all the individual parts and bring them together by yourself and complete the process without errors.
For example, you’ll need to create a Web3 wallet, set up the specific network, fund it via external sources, then connect to a DEX, copy the correct contract address of the coin you want to trade and so on and so forth.
It's also worth noting that each blockchain network is powered by its own native token which is required to pay for gas or transaction fees on that specific network. For example, making a transaction on the Ethereum network will require you to pay gas fees in ETH (ERC20) while on Binance Smart Chain (BSC) gas is paid in BNB (BEP20) etc. ?
Note: The same MetaMask address can be used across different networks. For example, your wallet address on Ethereum is the same for BSC, Polygon Fantom and others.
GETTING STARTED
There are several DeFi wallets out there but the most used is MetaMask and its available both on PC (desktop, laptop) and Mobile. In this guide, we’ll use PC cause the processes can vary across different smartphones.?
CREATING WEB3 WALLET
Please pay attention to the arrows so you don't miss a step.
1. Open your browser and visit metamask.io and click the download button as indicated by the 'green arrow' on the left image.
Then choose the browser type you're on, (where the 'orange arrow' is pointing) an the right image and click the install button as indicated by the 'blue arrow' at the bottom.
2. Once you see the 'remove from chrome' as shown on the left image below, then you're good to go.
Next, click on the 'extensions' icon at the top right of your PC as indicated by the 'blue arrow' and click the pin icon next to MetaMask as indicated by the 'orange arrow'. The 'black arrow' shows that your MetaMask is now pinned for easy access.
3. It's time to create your wallet. Click the MetaMask icon you just pinned at the top and click the 'Get Started' button (green arrow). Next, choose 'Create a Wallet' (orange button).
4. Click 'No Thanks' (green arrow), then set a strong password for your wallet and click 'Create' (orange button).
5. Make sure to hit play and watch the short video on how to secure your wallet. On the next page is the most import part of your DeFi journey so make sure to handle this info as private as possible.
You can either use the download option as indicated by the 'black arrow' or click the blur area (orange arrow) to reveal the phrase for you to copy manually.
6. Confirm your recovery phrase in the empty box (green arrow).
Congratulations! You just created your passport to the world of decentralized finance.
7. Close the pop up from the area pointed by the 'green arrow'. The left image shows how your new wallet looks like. The top right (orange arrow) shows the network area, which is set to Ethereum by default and the 'blue arrow' shows the native token for the current network.
8. Due to high gas fees on the Ethereum network, we’ll be using Binance Smart Chain for our practice today.?So let's add some popular blockchain networks to our new wallet.
There are two ways to add a new network to your wallet. First is by clicking on the network area (green arrow) then click 'Add Network' to add manually.
The second way is by using Chainlist which is displayed in the next steps.
ADDING CUSTOM NETWORKS
1. Go to Chainlist.org and click 'Connect Wallet' (orange arrow)
2. A pop up will appear from MetaMask. Simply click next (green arrow) and click connect (orange arrow).
3. Now click Add To MetaMask button under Binance Smart Chain. MetaMask approval box will pop up again, simply click Approve to automatically add BSC to your networks.
4. Do the same thing for the other three networks marked by 'green arrows'. Next, click the MetaMask icon from the top (pinned area) and open 'networks' (orange icon on the right image), then choose Binance Smart Chain. Notice how the native token has changed from ETH to BNB since we're now on the BSC network.
If you're in the US, click 'Buy' (indicated by blue arrow in image 2) to buy some BNB with your Debit card via Transak. If you're not in the US, follow the next steps to fund your wallet via Binance.
FUNDING YOUR WEB3 WALLET
1. Last week, I recommended creating an account on Binance since it's a lot easier funding our Web3 wallets from CEX. If you haven't, please register an account on Binance and get it verified now.
Let's continue for those who were able to register by now. From the home page on Binance, click 'Buy Now' (green arrow) to buy crypto via bank wire or debit card.
2. Choose what currency you want to pay (green arrow) and choose from the blue arrow what coin you want to receive. Choose BNB as indicated on the right image (orange arrow).
3. At this point, if you haven't connected your card during the account verification process, you'll be able to do it here. Select payment method, click continue (green arrow) and confirm (orange arrow).
4. You'll be shown an overview of your order, the fee and other details. Click confirm and complete the payment.
If your payment was successful, hover on 'Wallet' and click 'Fiat and Spot' (orange arrow).
5. Click on Withdraw at the top right (green arrow). Choose which coin you want to withdraw (orange arrow) - choose BNB. The address space (blue arrow) is where you'll paste your MetaMask wallet address.
6. Open Metamask again (green arrow) and click the Account 1 area (blue arrow) to automatically copy your wallet address.
领英推荐
7. Back to Binance, paste your address in the 'Address' space (green arrow) and the matching network for the address will be highlighted (blue arrow). Now, enter an amount you want to withdraw. The current minimum for BNB is 0.01 which is about $4.3 (black arrow).
Enter a small amount to withdraw. Please don't withdraw more than $20 until you've gotten used to interacting with DApps on your own. For this exercise, I'll be withdrawing $10 (orange arrow). Confirm your transaction (phone and email codes will be sent for verification) and wait few minutes for it to arrive in your MetaMask wallet.
8. While we wait for the funds to arrive, let's quickly edit the name of our wallet for easy reference. Open MetaMask again (top blue arrow). Click the gradient circle at the top right (green arrow), then choose Account Details.
Click the pencil icon (orange arrow) and change the name to whatever you like.
9. Our account name was successfully changed (green arrow) and our funds from Binance has arrived also. Now time for the fun parts.
INTERACTING WITH YOUR FIRST DEX
1. Go to Pancakeswap, the #1 DEX on Binance Smart Chain. Click 'Connect' at the top (green arrow)
2. Choose MetaMask from the list of wallets and click next (green arrow), then click 'Connect' (orange button).
Well done! Your wallet is now connected and ready to trade.
3. Hover on Trade (green arrow) and click Swap (blue arrow). Click the settings icon at the right image (orange arrow).
4. Set 'Slippage' to 0.5% (green arrow) and set TX deadline to 5 -10mins maximum (blue arrow). Close settings.
Enter amount of BNB you want to sell for Cake (PancakeSwap token) then click Swap. On the left image, I'll be selling 0.01BNB for 0.5Cake.
5. Click 'Confirm Swap' and click Confirm in Metamask. Note that you'll be paying a tiny amount for gas fees in each transaction, so make sure to keep enough BNB in your wallet always.
Wait a few seconds for transaction to confirm.
PROVIDING LIQUIDITY
1. Now that we have both BNB and Cake in our wallet, let's try to add liquidity and farm some coins.
Hover on Trade again and click Liquidity this time.
2. This place is empty for now so let's add a pair first. Click 'Add Liquidity' (green arrow). Select BNB where there is orange arrow and select Cake where there is blue arrow.
3. To provide liquidity, you must add equal value of two different tokens into a trading pool. For example, We'll be adding $3 dollars worth of Cake and $3 worth of BNB into this liquidity pool.
After entering the amounts, click 'Enable Cake' and approve the transaction in your MetaMask (wait for the pop up).
4. Now that Cake is enabled, Click on 'Supply' and click 'Confirm Supply'. Another MetaMask pop up will appear for you to approve the transaction.
5. Congrats, you just added your first liquidity pool on a DEX (orange arrow).
Now hover on the Earn option and click 'Farms'.
YIELD FARMING ON A DEX
1. These are the current yield farming offers available on PancakeSwap and we just provided liquidity for Cake-BNB pair, so we're going to choose that offer.
Click on the small toggle icon at the right end of the Cake-BNB offer. Click on 'Enable' and confirm again in MetaMask.
2. Now we can 'Stake LP' (liquidity pool tokens). Click on 'Stake LP', enter the amount of LP you want to stake or simply select 'Max' to stake all, then click 'Confirm'.
Approve transaction in MetaMask again.
3. Well done! You just started farming at 34% APY, but there's even better.
The bold harvest button (blue arrow) is where you can claim your rewards whenever there's enough coins worth claiming (rewards accumulate within seconds).
Finally, hover on 'Earn' again and click Pools.
4. This is a different kind of farming where you stake only 1 token to get more of the same token or others, you don't need to provide liquidity to stake and earn. In this case, we're going to stake Cake to earn GMI at 170% APY (green arrow).
Select details at the far end of Earn GMI offer and click 'Enable'. Confirm transaction in MetaMask.
5. Now click on 'Stake', enter amount of Cake you wish to stake and click 'Confirm'. Confirm transaction in MetaMask again.
Annual ROI shows about $5 when the investment amount is just around $1.
6. Rewards are already accumulating within seconds and of course, you can harvest your rewards and withdraw them whenever you wish to.
SUMMARY
This was a really long one and sorry if it got too complex for you to follow along. Reading and talking about DeFi is clearly different from actually getting it done, but the fun part is that, you only get your hands dirty this once. Now that it's all set up, you can do this at the snap of your finger and use DeFi to it's full potential.
Do you have any question, stuck at any step, or is there something you'd like to suggest? Please don't hesitate to share them in the comments.
I’m not a guru of any kind, but I hope that I can help you and others to make informed choices in Web3 and More.