Learning Decentralized Finance by Example using SafeMoon

CryptoAnalyst69
7 min readMar 27, 2021

SafeMoon is a hot new cryptocurrency that has taken social media by storm, and introduced thousands of people to the world of Decentralized Finance (DeFi). In just a couple weeks, SafeMoon has amassed more than 140,000 holders. Since many of these holders are new to cryptocurrency, this article overs the basics of DeFi and decentralized exchange (DEX). SafeMoon is the perfect choice for this case study, not only because it’s brought so many newbies into the fold, but also because the SafeMoon Protocol interacts directly with the DEX liquidity pool. By the end of this article, you’ll understand how this works, and what to expect when you invest in the SafeMoon Protocol.

So the first thing to understand is that SafeMoon is a token. Tokens are different from traditional cryptocurrencies like Bitcoin and Doge (which have their own blockchains), because tokens piggyback on an existing blockchain. You can think of a blockchain as a massive ledger that keeps track of and organizes all the transactions and contracts that occur within its scope. SafeMoon, in particular, lives on the Binance Smart Chain (BSC), which was started by Binance as a cheaper competitor to the more decentralized Ethereum blockchain. For this reason, we call SafeMoon a “BSC token” (more precisely it’s a “BEP20 token”).

Since it is a BSC token, SafeMoon can be held in any BSC address. An address is like a bin that lives on the blockchain, and you can place a variety of different tokens in it and sign blockchain contracts (Smart Contracts) with it. An address is owned by the person who holds its private key (or equivalently its seed phrase), and can be accessed via a wallet such as MetaMask or Trust Wallet. These wallets are just interfaces to the underlying address, so you can actually access the same address from multiple wallets! That also means that if someone gets a hold of your private key (or equivalently, your seed phrase), they can load your address and steal your tokens, so be very careful with these! Never enter your private key / seed phrase into an untrusted interface, and don’t store it in the cloud either.

As a BSC token, SafeMoon can take advantage of all the tools that are developed for BSC. For example, you can keep track of all the SafeMoon transactions using the website BscScan.com. Here’s the link:

You can see on that site the number of SafeMoon “holders” and a list of the recent transactions. If you click on the “Holders” tab, you can see the addresses that hold the largest amounts of SafeMoon and how much they hold:

The top holders list just linked is one of the most informative pages (and this applies to any token!). You can get a lot of information from it. One thing I like to look for is how much of the supply the top holders hold. Another thing you can spot on this list is the SafeMoon that is committed to the PancakeSwap liquidity pool:

It’s called “PancakeSwap: SAFEMOON”, because the the SafeMoon in this address is managed by PancakeSwap, the leading DEX for BSC tokens. You can use PancakeSwap to buy and sell SafeMoon (and other BSC tokens) via the Exchange screen, here:

How does a DEX like PancakeSwap work? To simplify things, we will assume there is only a single liquidity pool for SafeMoon — the SAFEMOON:BNB pool, which pairs SafeMoon to BNB. This liquidity pool is managed by the PancakeSwap contract, and lets you exchange SafeMoon for BNB and vice versa. The 1:1 Rule for liquidity pools is simple: the value of SafeMoon and the value of BNB in the pool is equal. If there are 10 SafeMoon tokens and 1 BNB in the pool, then 1 SafeMoon is “worth” 0.1 BNB. I put “worth” in quotes because it’s a bit more complicated than that.

Generally speaking, an asset is worth what someone is willing to pay for it. So SafeMoon is worth what someone (the counterparty) is willing to accept/pay you for it. A liquidity pool on the PancakeSwap DEX is set up to serve as a counterparty to any buy/sell order (this is automated by the PancakeSwap Smart Contract). The liquidity pool sets its price so that the 1:1 Rule is satisfied before and after the exchange. If I buy or sell a very small amount of SafeMoon, the ratio of SafeMoon:BNB in the pool stays constant, and that’s the price I get. But if I try to buy/sell enough SafeMoon that it changes the ratio of SafeMoon:BNB in the liquidity pool, the price changes too.

So let’s work through an example: suppose there are 10 SafeMoon tokens and 1 BNB in the pool, and I want to sell 20 SafeMoon. At the market price, I should receive 2 BNB… but the liquidity pool can’t offer me that (there is only 1 BNB in there!). So what happens is that I’m going to get far less than the stated market price for my SafeMoon when I sell it to the liquidity pool. I’d actually receive something like 0.7 for my 20 SafeMoon, or just 1/3 of the market value! After the exchange, the liquidity pool would have 30 SafeMoon and 0.3 BNB left in it, and the market price of 1 SafeMoon is now 0.3/30 = 0.01 (or 10% of what it was before). This is why the amount of liquidity matters. More liquidity means more stable prices, since the same size buys/sells have less of an effect on the ratio of SafeMoon:BNB in the pot.

Where does liquidity come from? This is the magic of DeFi: anyone who owns both SafeMoon and BNB can add liquidity! You can do this by visiting the “liquidity” page in PancakeSwap, and clicking “add liquidity”:

When you add liquidity, you must contribute an “equal value” of each token in the pair (in this case, SafeMoon and BNB) to the pool. You will get back liquidity pool tokens (LPs) representing your stake in the pool. You can later exchange these LPs back for your proportional share of the pool. So going back to our example, where there were initially 10 SafeMoon tokens and 1 BNB in the pool. Let’s say you had contributed 5 SafeMoon and 0.5 BNB to the pool, so your LP tokens represent a 50% stake in the pool. After I sell my 20 SafeMoon, the pool is now 30 SafeMoon and 0.3 BNB, so your LPs may now be exchanged for 15 SafeMoon and 0.15 BNB. By participating a liquidity pool, you serve as a counterparty to buyers/sellers who interact with that pool.

Ok, so now we understand how the DEX and liquidity pool work. How much liquidity does SafeMoon have? We can go back to the holders list on BscScan and click into the “PancakeSwap: SAFEMOON” address. This lets you see the value of the liquidity pool:

So you can see that as of writing this, there are 22T SafeMoon tokens and 29,000 BNB in the liquidity pool, worth around 7.6 million USD.

Ok, so that’s the introduction! I left out some important things like impermanent loss and whatnot, but this is a good foundation for understanding DeFi.

We can now understand exactly how the liquidity injection part of the SafeMoon Protocol works. The main feature of SafeMoon is a 10% tax on each transaction. 5% is redistributed toward existing holders, in proportion their wallet size, and 5% is added to the liquidity pool on Pancakeswap. This is done first by selling 2.5% to the liquidity pool for BNB, then by pairing the BNB with the other 2.5% to add it to the liquidity pool. What is the net effect of this operation?

At first glance, we see 5% redistribution and we think: GREAT! The value of my SafeMoon increases as people trade. But as it turns out, the opposite is true.

Let’s suppose that trading over a 24 hour period is a wash, with a net BNB-inflow of 0 BNB, and a total trading volume of 15T SafeMoon (based on the last 24hr as of this writing). Of that 15T, 10% is taxed, so 1.5T SafeMoon is taxed. Suppose you own 1B SafeMoon (approx 0.00016% of supply). Then you receive 0.00016% of the 5% redistribution or 1.2M SafeMoon — so you now have 1.0012B SafeMoon, a 0.1% increase!

But let’s see what happens to the price of SafeMoon. Recall the liquidity pool has 22T SafeMoon in it, and 29,000 BNB. The Protocol adds the other 5% of the 10% tax to the liquidity pool, so there are now 22.75T tokens in the pool, and 29,000 BNB. That means that the price of SafeMoon went from 29K/22T*$267 = $0.00000035 to 29K/22.75T*$267 = $0.00000034.

Even though you gained 0.1% SafeMoon by holding, a wash in trading for the day means that the value of your SafeMoon has dropped by 3.3%!

In order for your investment to stay at equal value, you have needed the number of BNB in the liquidity pool to also rise by 3.3%. I.e., you needed new buyers to invest at least $255,000 new money into the pool.

But where did the 3% go? Well, it went to the owner of the LP tokens created by the “liquidity injection” part of the SafeMoon Protocol. This is none other than the SafeMoon Protocol itself, which is controlled by the SafeMoon team. In other words, the main effect of the SafeMoon Protocol is to redistribute a significant part of the 10% transaction tax to the SafeMoon team.

And so ends today’s lesson on Decentralized Finance! Beware of “liquidity injection” protocols and 10% transactions taxes — I’ve yet to see one that makes sense economically for anyone but the original team.

If you enjoyed this story, check out my previous article: SAFEMOON Tokenomics: Incompatible With Exchanges.

--

--