Pancake Swap is a decentralized exchange platform developed on the basis of China Binance Smart Network and is one of the largest defi platforms in the Binance ecosystem.
In this article, you will first get acquainted with the operation and various capabilities of Pancake Swap, and then you will learn how to work with different parts of this platform. So stay tuned for the rest of this article.
A brief history of decentralized exchanges
Since the first Decentralized exchanges (Decentralized exchange) its place in the ecosystem Blockchain And they opened up digital currencies, one thing they all have in common: they’re all simple and funny , or at least they try to look like that.
Wax charts, bookkeeping charts, trading pairs and other complex details that you see in centralized exchanges have given way to a very simple user interface.
This simplicity has had a clear impact not only on the user interface and performance mechanism, but even on the naming of these platforms; As most of these platforms have used elements such as internet memes or food names for naming: simple and beautiful like a unicorn, simple and delicious like a sushi slice, or simple and hearty like A pan cake (swap pancake).
The main difference between decentralized exchanges and centralized exchanges is how to control users’ assets. Users of centralized exchanges (e.g.BainanceAnd Kevin Bass), in order to make transactions, they must first deposit their digital currencies into the wallets managed by these exchanges; They then register their buy and sell orders in the online exchange order book, and finally the exchange order matching engine will connect buyers and sellers and make exchanges between them.
Centralized exchanges are not traded intra-chain (ie not registered in the blockchain), but are registered in the centralized database of the exchange and are registered on the blockchain network only when the assets are withdrawn from the exchange office.
This will dramatically increase the speed of transactions in centralized exchanges.
Although this simple mechanism provides fast transactions and acceptable liquidity, it also has important drawbacks; Among other things, the control of users’ assets is safely in the hands of the exchanges, and the management of these exchanges is completely centralized and vulnerable.
Decentralized exchanges were created with the aim of resolving the problems of centralized exchanges. These protocols use digital open source contracts to convert digital currencies internally.
Therefore, the possibility of manipulating the market of these exchanges will be minimized.
Also, to use decentralized exchanges, there is no need to transfer assets to safe wallets; Instead, each user can connect their wallet directly to the smart contract and interact with it; While the control of assets will be at the disposal of the user.
The first decentralized exchange protocols were created on the Atrium blockchain. Uniswap, Sushiswap, and Balancer are some of the most popular of these protocols.
These platforms have gradually gained a significant share of digital currency transactions and, along with other Diffie projects, have generated huge traffic on the Atrium network.
But in recent years, due to the low scalability of the Chinese block Atrium, Trading fees on these platforms have skyrocketed, in some cases to as much as a few hundred dollars; This made it uneconomical for many users to use these platforms.
Under these circumstances, similar projects such as Pancake Swap were created on more scalable blockchains that try to improve the performance of decentralized exchanges by reducing commissions and increasing the speed of transactions.
What is a Pancake Swap and how does it work?
Pancake swap is a decentralized exchange platform in China’s Bainance Smart network that is very similar in performance to the ion-swap platform (on the Atrium network). The platform was launched on September 20, 2020 (September 30, 2014) and in a short time, its average daily trading volume reached about $ 700 million. In the chart below, you can compare the market volume and liquidity of these two exchanges:
As we have said, in Pancake Swap Exchange (unlike centralized exchanges) there is no news of a sales order office. Also, transactions between buyers and sellers on this platform are not done on a peer-to-peer basis. Pancake Swap, like Uni Swap, uses liquidity pools and an automated marketing mechanism to manage transactions.
In this section, we will explain the concepts and mechanism of operation of the main elements of the Pancake Swap platform, including liquidity pools, automated marketers and CAKE tokens.
What is a liquidity pool?
Liquidity Pool is a virtual space where people can provide the necessary liquidity for exchanging tokens by depositing their favorite currency pairs. People who deposit their tokens in liquidity pools are called Liquidity Providers. Each time Pancake Swap users make a conversion, they pay a fee, much of which goes to financial providers as a financial incentive.
In this way, users exchange their tokens with pool tokens instead of trading directly with each other, and smart contracts act as intermediaries between users and liquidity pools.
Anyone can play an equal role in this process by participating in Pancake Swap liquidity pools and securing an equal amount of tokens (eg BNB / CAKE). These individuals receive pool-specific tokens (LP tokens) in exchange for depositing their assets in liquidity pools. LP tokens allow people to withdraw their deposits and withdraw from the platform at any time.
The use of LP tokens is also a good way to distribute revenue (exchange fees) among liquidity providers. The mechanism of income distribution can be explained with a more detailed example. Consider the WBNB / BNB pool as an example:
Suppose 10 LP tokens represent 10 BNB tokens and 10 WBNB tokens.
In this case, each LP token will be equivalent to 1 BNB token plus one WBNB token.
A person trades 10 WBNB tokens for 10 BNB tokens and is deducted 0.17% of the transaction value as an exchange fee. So now we have 20 WBNB tokens and 0.017 BNB tokens in the pool.
Another person exchanges 10 BNB tokens for 10 WBNB tokens. Considering the exchange fee, we now have 10,017 BNB tokens and 10,017 WBNB tokens in the pool.
Now each LP token will be equal to 1.0017 BNB tokens and 1.0017 WBNB tokens.
This process is repeated in all exchanges, so that the profit from the liquidity supply is stored in the LP tokens and can be withdrawn when converted into real tokens.
Given what we have learned about liquidity pools, the next question is how will prices be determined when we remove the concept of the book office altogether from an exchange office? This is where the automated marketing mechanism comes into play.
What is an automated marketer?
Automated Market Maker (AMM) is a protocol for asset pricing. In this protocol, instead of using the order book, a mathematical algorithm based on supply and demand determines the price of assets in the pools.
Each Pancake Swap liquidity pool contains a currency pair (ie, two different tokens) that the automaker determines their value relative to each other based on the weight ratio of the two assets in the pool.
To better understand this mechanism, consider the BNB / USDT pair. If we consider the number of BNBs to be X, the number of BUSD stable coins to be Y, and the volume of liquidity of the pool in question to be K, the value of K in the formula X * Y = K will always be constant. Therefore, the automated marketing protocol determines the price of X and Y in such a way that K remains constant in the above formula.
To better understand this process, consider the following example:
Pool BNB Inventory: 100
Pool BUSD Inventory: 20,000
Transaction Fee Units : 0.2.
Now the volume of pool liquidity (K in the above formula) and the ratio of BNB to BUSD are determined as follows:
K = 20,000 * 100 = 2,000,000
BNB / BUSD: 20,000 / 100 = 200
The details of the token conversion transaction in this pool will be as follows:
Farzad intends to convert 10 BNB to BUSD stable coin.
Conversion fee: 0.02BNB
Therefore, the balance of each token in the pool, during the transaction, will be as follows:
BNB: 100 + 10 – 0.02 =
109.98 BUSD: 2,000,000 / 109.98 = 18.185.12
The amount of BUSD received by Farzad is determined as follows:
Farzad Received BUSD = BUSD Primary Inventory – BUSD Secondary Available
Farzad BUSD Received = 20,000 – 18.185.12 = 1.814.88
Finally, according to the new inventory of BNB and BUSD in the pool, the value of K and the new ratio of BNB to BUSD are determined as follows:
K = 18.85.12 * 109.98 = 1,999,999,4976.2 2,000,000
BNB / BUSD: 18.185.12 / 109.98 = 165.34
As you can see, by selling BNB to the BNB / BUSD pool, the BNB liquidity in the pool will eventually increase and the BUSD liquidity will decrease. As the liquidity balance of this trading pair is upset, the price of BNB (in terms of BUSD) will decrease and the price of BUSD (in terms of BNB) will increase. Also, if you buy a BNB from this pool, the balance of the pool will be upset in favor of BUSD and this time, the price of BNB will increase. This is almost exactly what an automated marketer does.
This phenomenon (ie price changes due to buying and selling), so-called price slippage, is a common phenomenon in decentralized exchanges and depends on two factors: trading volume and the volume of pool liquidity. The more liquid the pool, the less the price will slip, and on the other hand, the more the transaction volume, the more the price will slip.
Of course, in centralized exchanges and office-based models, there is also the phenomenon of price slippage. For example, in a centralized exchange, if the volume of an individual purchase order is high, he will have to buy all the sales orders from the list of sales orders until his purchase is completed.
Decentralized exchanges control this by adding a feature that determines the maximum amount of price slippage. This parameter is expressed as a percentage and is displayed as a percentage difference to the displayed price.
What is a CAKE token and what is its role in the pancake swap platform?
When you enter the Pancake Swap, you feel more and more like entering a decentralized amusement park. The various features and components of Pancake Swap, such as currency exchange, liquidity supply, profit cultivation, Syrup pools, and lotteries, are arranged just like playground equipment, and each of them tempts the user to use the other parts as well. To try in the lottery.Cake tokens (CAKE) is the entrance ticket to this amusement park, which allows you to use different parts of the pancake swap ecosystem.
But if you want a more scientific and principled definition of a cake token, we can define it like this:
Cake is the main token of the Pancake Swap platform, whose primary purpose is to provide financial incentives for liquidity providers in the exchange; In addition, the cake token allows you to use other pancake swap features. This token was created on the basis of China Binance Smart Network (BSC) and under the BEP20 standard.
Cake tokens can be obtained in several ways:
- Yeald farming on pancake swap farms
- Shares in Syrup Pancakes Swap Pools
- Win the Swap Pancake Lottery
- Purchase from exchange offices
At the time of writing, Token Cake is ranked 35th in the digital currency market with a price of $ 27 and a market volume of $ 4.3 billion. At present, the cake token has no supply restrictions and at first glance it may be considered an inflationary token. Although the user community describes this as a concern, pancake swap developers have a good reason not to set a token ceiling: to motivate pancake swap liquidity providers .
Instead, the pancake swap protocol uses strategies that turn the cake into an anti-inflammatory token in the long run. The first solution is to reduce the supply rate ; Accordingly, the Cake Protocol has recently reduced the number of tokens generated per block from 40 to 25. The second solution is to burn the tokens on a regular weekly schedule; This means that every week, a number of tokens (for example, 10% of the tokens spent on lottery tickets) are sent to an inaccessible address and go out of circulation.
In general, the current uses of cake tokens can be summarized as follows:
1. Provide cash for Cake-related currency pairs at the Pancake Swap exchange to earn transaction fees (and share LP tokens to receive more cakes)
2- Sharing in Syrup pools to get tokens of China Binance Smart ecosystem
3- Buy lottery tickets and participate in the lottery to receive prizes (more cake tokens)
4- Creating profiles on pancake swaps and multiplying tokens NFT
5. Participate in the governance of the pancake swap ecosystem by voting on network improvement proposals
Introducing the capabilities and different parts of the Pancake Swap platform
In this section, we will introduce you to the different parts of the Pancake Swap platform and its various capabilities so that you can have a general and comprehensive view of this platform. In this article, you will learn how to work with different parts of the swap pancake.
If you go to the Home page, you can get general information about your activities and information about the status of the cake token and the Pancake Swap platform. For example, the deposit status on pancake swap farms, the amount of cakes you get or have in your wallet, the number of lotteries you have won so far, and the new tokens you earn by depositing in pancake swap pools are specified.
General information such as the total value of assets locked in Pancake Swap (TVL), the total number of tokens offered and the tokens burned are also displayed on the home page. Using the menu on the left side of the page, you can enter other sections of this platform.
The trading section consists of three modules called Swap , Liquidity and Bridge . We use the swap section to convert tokens and the liquidity section to provide liquidity to the swap pancake pools. The Bridge section is also a place to transfer digital currencies from native networks to China’s Bainance Smart Network.
In the Pancake Swap Farms section, you can deposit LP tokens from pool pools to earn interest based on a fixed annual interest rate (APR). In fact, pancake swap farms are a place to grow profits and give liquidity suppliers double incentives to provide liquidity to the exchange pools.
When you deposit your LP tokens on the relevant farms, you are in fact committing yourself to not withdrawing the original tokens from the cash pools and will be rewarded with a Cake token in return.
It might seem very generous (and really a syrup pool) to say that by sharing cake tokens in this section, you can get new tokens from the China Binance Smart ecosystem (plus the cake token itself) with a remarkable APR. But in fact, these new projects are accelerating the public acceptance of their tokens by allocating some of their tokens to cake token shareholders.
Pancake Swap users can participate in the lottery of this platform using CAKE tokens. People can get a lottery ticket with each cake token. The function of this section is that some of the deposited tokens are given to the ticket holders as a reward and some of them are burned.
In this section, you can buy a unique profile picture for yourself by spending 1.5 cake tokens, and then complete your personal profile by choosing a username. Profile images are selected from Collectibles, each of which is an NFT token. After setting up your personal profile, you can purchase other Collectibles in the future and add them to your profile.
Training to work with pancake swaps
OK; Now that you know the basics of the Pancake Swap platform and how it works, we can move on to a step-by-step tutorial on using all of the platform’s capabilities. First from the address pancakeswap.finance Log in to the Pancake Swap app.
Be sure to use the correct URL to use Defy apps; Because fraudsters in this area, by forging these websites and using URLs similar to the original address, are trying to carry out phishing attacks and defraud users. To make sure the URLs are always correct, find the URLs of the apps you want on the Coinmarketcap.com website and bookmark them in your browser.
Learn how to connect a wallet to a swap pancake
After entering Pancake Swap, connect your wallet to this platform. To do this, click connect and select a wallet from the supported wallets.
If you want to use mobile wallets, wallets Trust WaltWe recommend (Tust wallet) or Safepal. But if you want to work in the desktop space and use Chrome browser wallet extensions, we suggest (Metamask) or Binance chain wallet.
China Walt’s wallet is quite similar to Metamsk, which supports Atrium, China’s and China’s Smart China blockchain. But in this article, we will choose Metamsk wallet and teach you how to connect it to China Smart Bainance.
Learn how to connect Metamsk wallet to China Binance Smart network
Most users recognize Metamsk as a dedicated wallet for the Atrium network. But since China Binance Smart architecture is compatible with the Atrium network, the Metamsk wallet can also be connected to this network.
First you need to download and install the Metamsk plugin. If you do not know the steps of setting up and installing Metamsk article «Complete MetaMask wallet training»Read. You will then need to make the following changes to its settings to match China’s Bainance Smart و network and connect to the Pancake Swap platform.
- After installing and activating Metamsk, first enter the menu in the right corner, then enter the settings option.
- Then enter the Networks tab and click on Add Network in this section.
- You will now be taken to a page where you must enter the following information.
Network Name: Smart Chain
New RPC URL: https://bsc-dataseed.binance.org/
Block Explorer URL: https://bscscan.com
Then save this information. Eventually, the wallet will be able to connect to China’s Bainense Smart via DApps.
Just like Atrium’s Difference apps, which are paid for with Ether (ETH), in the China Binance Smart Network, all transactions will be charged in BinanceQueen (BNB) digital currency. So first of all, first transfer some BNB currency to your wallet.
Always keep in mind that Tokens Smart China Network tokens are based on the BEP20 standard and should not be confused with the BEP2 standard, which belongs to the China Binance Network. So when using Bainance Smart China apps to transfer BNB (or any of the other tokens) to Metamsk wallet, be sure to set the transfer network to BEP20 mode.
In the image below, you can see how to transfer BNB tokens from Bainance Exchange to Metamsk Wallet.
Token exchange training in Pancake Swap exchange
First select Trade from the menu on the left and then Exchange. Then select the token you want to convert and select the second token you want. For example, here we are going to convert a BNB token into a Cake. By specifying the value of one of the two tokens, the value of the other token (based on the automated marketing algorithm) is displayed as an estimate.
As you can see, the details of this conversion (in the green box) are specified. Here we examine each of the parameters and their meaning.
- Minimum recived: Indicates the minimum cake token received (or the secondary token you have selected). This means that if the price slippage is large enough that the cake token received is less than this amount, the conversion will be canceled automatically.
- Price Impact: Indicates the impact of your conversion on the price of the asset. As we explained earlier, any conversion will cause the price of the assets in the pool to slip. Therefore, this parameter displays the difference between the current market price and the estimated price in your trade.
- Liquidity Provider Fee: For each transaction you make at Pancake Swap, you pay 0.2% of the transaction value as a fee (this concept is different from the network transaction fee). 0.17% of this amount is allocated to liquidity suppliers and 0.3% of it is deposited in the Pancake Swap Treasury and burned according to plan.
After examining the details of the transaction, we can (from the area marked with a red circle) enter the transaction settings and manually adjust some of the exchange parameters, which will ultimately affect how the tokens are converted.
Customizable parameters in this section include the following:
- Slippage tolerance: This factor will determine the maximum price fluctuation during the conversion. For example, if you select 0.5%, the maximum possible volatility during the exchange will be 0.5%, and if the price fluctuation is more than this amount, the transaction will be returned. Note that changing the rate of price slip tolerance will ultimately affect the minimum receipt (described earlier).
- Transaction deadline: Here you can specify the maximum transaction time. This number is set to 20 minutes by default; This means that if the transaction is not done within 20 minutes, it will be canceled.
Finally, click on Swap. Here again, the general transaction information is displayed briefly. Check everything again and click on Confirm Swap.
Next, you need to confirm the transaction from your Metamsk wallet. As you can see in the image below, the transaction amount, commission amount and total payment are specified. Here you can change the fee paid by changing the Gas Fee number, but keep in mind that the fees of China Binance Smart Network are generally very low and it is not necessary to do so.
By clicking on Confirm, your transaction will be sent to the network and will be confirmed and finalized in a few seconds. Now if you check your wallet balance again, you will see that the desired conversion has been done.
Liquidity training in Pancake Swap Exchange
Click on the Liquidity tab and then on the Add liquidity option to provide cash for tokens in Pancake Swap pools.
Now from the drop-down menus, select the tokens you want to provide liquidity.
Note that both tokens must be present in your wallet to provide liquidity for a currency pair. You should also set the deposit amount of each token so that their dollar value is equal.
Here we have selected BNB and Cake tokens to provide liquidity.
Each time you select a new token for liquidity, you must enable smart contract access to the token through your wallet. This process will be done once for each token and after that, there will be no need to activate. To do this, click on Approve CAKE. A notification will then open from the Metamsk wallet (as shown below) showing the details of the transaction connecting the smart contract to the Cake tokens.
By confirming this transaction, Cake tokens are attached to the smart contract and you can deposit them in the BNB / Cake pool.
Here is the number of LP tokens received in return for this liquidity. By clicking on Confirm Supply, you will have to log in to the wallet again and confirm the transaction related to locking tokens in the smart contract.
By completing this transaction, LP tokens will be credited to your wallet. These tokens represent your assets in the liquidity pools and you can withdraw your balance by returning these tokens whenever you want.
If you check your wallet balance again, you will see that LP tokens have been credited to your wallet.
Now, using the LP tokens you have obtained from this deposit, you can also participate in the process of cultivating the profit of Pancake Swap (which we will explain in the next section). But if you want to get your property out of the pool, you have to follow the steps below.
First, from the Trade section, enter the Liquidity tab. Your previous deposits are displayed here under Your Liquidity. Here, select the pair you want to harvest. Click Add if you want to increase your deposit, and Click Remove if you want to withdraw your deposit.
On the Remove Liquidity page, specify the withdrawal amount and click Approve. Then sign this request in your wallet and finally click on the Remove option.
Finally, by confirming this process and performing another transaction from the wallet, you will return the LP tokens to the smart contract and receive the deposited tokens in your wallet.
Yield Farming training in pancake swap
Yield Farming allows you to stake your funds in exchange for rewards or profits. You can re-deposit your rewards for compound interest, or even transfer it between different protocols (for more profit). But you should not forget that by doing so, you expose yourself to the loss of capital due to price fluctuations. So if you are not completely familiar with Diffie platforms, doing so is not recommended at all .
To make a profit on Pancake Swap, you must first have the LP tokens of the liquidity pools. You will then be rewarded with Cake Tokens by depositing these tokens on the relevant farms according to the APR specified.
To get started, select Farms from the menu on the left. On the Farms page, all the pancake swap farms are listed along with the details of the profit cultivation. Click on each farm to view details.
The APR option, indicated by a red arrow in the image above, indicates the farm’s annual profit rate. Click on it to see more details.
As you can see, the daily, weekly, monthly and annual interest rates for each $ 1,000 deposit are specified here. Now go back to the main page and in your desired farm (the farm that has LP tokens), click on the Stake LP option.
Specify the number of LP tokens you want to deposit here and click Confirm. Then sign and confirm the transaction related to locking LP tokens in the smart contract through your wallet. Once the transaction is confirmed, your LP tokens will be locked on the farm and the profit-making process will begin.
Now from the Farms page, you can manage the status of your deposit and the amount of interest earned. The Earned section (green box in the image above) shows the income you have earned so far. You can increase or decrease your deposit by clicking on the + and – options. Also, by clicking on the Harvest option, you can withdraw your earnings cultivation income (ie Cake tokens obtained) and transfer it to your wallet.
Note that as long as you lock your LP tokens in the interest cultivation farm, you will not be able to withdraw tokens deposited in the liquidity pool. To pick up tokens, you must first release the LP tokens.
Learn how to use Syrup pools on the Pancake Swap platform
By depositing Cake tokens in Syrup pools, users can be rewarded with new tokens from China’s Bainance Smart ecosystem at a certain interest rate. By viewing the information of each pool, you can select the pool you want. Each pool offers a different annual interest rate; But it is better to choose a pool that is sure of the future of the token. This part has less risk than the farm part but still includes other risks.
To start this process, select Pools from the menu on the left.
On the Pools page, select the token you want and click on Approve Cake. By doing this, you allow the smart contract for each pool to access the cake tokens in your wallet. For example, here we have selected the XED token pool.
After confirming the access of the smart contract to the cake tokens (image number 1), enter the XED pool and click on the + sign (image number 2). Then specify the number of Cake tokens to deposit and click on Confirm (image below).
Now our Cake tokens have been successfully tagged in the XED pool and we will receive XED tokens based on the APR specified. To pick up XED tokens on Harvest, click on the + option to increase the sticking, and to remove the cake tokens from the pool, click on Unstake Cake and confirm the relevant transaction from your wallet.
You can also click the Add XED to MetaMask option to add an XED token to your Metamask wallet.
OK; By reading this article, you will learn almost everything about the Pancake Swap Exchange; But let us conclude with the risks and dangers of this platform.
Prerequisite for interacting with smart contracts and consequently defense platforms, is familiarity with their potential risks and risks. Every transaction and action you make on these platforms is an interaction with the functions written in the smart contracts of these platforms. So if the smart contract code has an undetected bug, it is possible that hackers or even developers of the same platforms will steal your capital.
In addition to this constant risk for smart contracts, one must also consider the risk of capabilities such as farming and profit cultivation of these platforms. These capabilities are similar to margin trading due to the re-share of tokens received from sticking; This means that they are sensitive to price fluctuations and there is a possibility of losing users’ capital in them.
Another threat in this area is DNS attacks on these platforms, of which Pancake Swap has recently fallen victim to one. AttacksIt was located. These attacks can lead to the disclosure of recovery words and sensitive information in users’ wallets.
Finally, it should be noted that Diffay’s world has often hosted professionals in the field of digital currencies; But these days, following the fierce competition of decentralized platforms and the rapid and low-cost expansion of China’s Bainance Smart ecosystem, the doors of the Diffie world seem to be open to the general public. Therefore, it is necessary to always move in the world of defense with your eyes open (I emphasize with your eyes wide open) .