DeFi for Newbies: 3) And action!

0
34
Photo by Martin Lopez from Pexels

We talked about DeFi wallets in part 1 and typical DeFi investor profiles in part 2. Now, it’s about time to actually start to invest. I thought a lot about where to start in times of high prices and high transaction cost.

Where to invest?

So, let’s assume you want exposure to different projects from the DeFi space. This helps to minimize your risk. You also want to start small and certainly want to avoid too many transactions to keep the cost side in certain limits.

This scenario falls into my investor profile Lazy Aggregator (see part 2). Let the DeFi system work for you. In this case, the DeFi Pulse Index (DPI) might be an interesting option for you. This index has high standards in selecting the top DeFi projects according to different characteristics like the fundamental token design, the token’s circulating supply, the project’s traction and its user safety. DPI is built upon TokenSets — an interesting DeFi platform to create a basket or set of tokens.

At the time of writing, DPI includes the following tokens:

DeFi Pulse Index (snapshot from 2021–02–20)

Regular readers of my articles should see familiar names like Uniswap, Aaave, Synthetix, MakerDAO, Compound or Yearn Finance.

Disclaimer: DPI is just one possible option and serves as example for this article. Please don’t take that example as financial advice and do your own research.

How much to invest?

So, now that we know our target, let’s think about a sensible amount to invest. There are different dimensions to that. Many experts warn that you should only invest as much money in crypto as you are willing to lose — in case things go bad. I totally agree. They argue, you should invest max 10–20% of your overall investments into this volatile crypto space. So, I guess this is good advice for the upper limit.

But due to the high gas price, there is also a lower limit. It doesn’t make sense to invest 100$ and make 10$ profit if you pay 20$ in transaction cost. You’ll certainly learn something out of that exercise, but it isn’t too much fun and will turn you off.

The problem with DeFi on Ethereum is that your transaction costs will vary over time. They depend on two main factors:

  1. The current price of Ethereum (with ETH>$2.000)
  2. The current price for “gas” (with standard gas price at about 175 Gwei)

You might wonder: Gwei? What’s that? It’s giga (a billion) wei — with wei being Ethereum’s smallest unit. Read this great explanation. In other terms:

1 Gwei = 0,000 000 001 ETH

Sounds not like too much, but has a big influence — as we’ll learn soon.

A third factor is the complexity of the functions in the smart contracts of a DeFi product. Complexity is expressed in gas and depends on the storage and compute demand of the functions we execute on-chain. The more space or compute power we demand from the blockchain the more we have to pay.

So, you can think of transaction costs like that:

Transaction cost($) =
<smart contract complexity>*<current gas price>*<current ETH price>

Please notice: The amount of your investment is no factor in that formula.

That means: Transaction costs in DeFi do not depend on the size of your investment.

Let’s make an example: Let’s say we want to send tokens from account A to account B. This smart contract function usually has a complexity of about 21.000 gas. With an average gas price at 175 Gwei and an ETH price at 2000$, our transaction will cost about:

21.000 * 0,000000175 * 2.000$ = 7,14$

If you want to dive deeper into transaction cost calculations you might want to read this article.

In DeFi, you usually have at least three interactions with smart contracts. Each of them results in transaction cost:

  1. Approval: You allow the the smart contract to interact with your wallet.
  2. Investing: Sending tokens into the smart contract.
  3. Withdrawal: Getting back tokens and rewards.

While step 1) is usually quite cheap, steps 2) and 3) can be quite expensive — depending on the DeFi project and its smart contract complexity.

With DeFi Pulse Index (DPI) as our first DeFi investment, we are on the simple side of smart contracts. DPI is set up as a token that can be bought on decentralized exchanges like Uniswap. So, the DPI token shields away more DeFi complexity from us. This is also very convenient regarding transaction cost. Nevertheless, buying DPI is no free lunch in current market conditions — as we’ll see soon.

If we try to buy DPI on Uniswap, we currently pay around 15–20$ for step 1) and easily 40$-50$ for steps 2 and 3, each. So, this makes 100$ end-to-end transaction cost. From that angle, I would argue that DeFi experiments below 1.000$ don’t make too much sense at the moment — at least from an economical point of view.

Just for comparison: In June 2020, we saw an ETH price at 250$ and gas around 35 Gwei. The same three transactions had cost just about 10$…

And…action!

The MetaMask way…

As mentioned in part 1, most DeFi projects work best with MetaMask. So, if you haven’t done yet, please download and install MetaMask, create an account and don’t forget to note down your seed phrase. This is very important if you ever want or need to recover your wallet (e.g. on another computer). If you have questions, please follow my recommendations of part 1 and watch the MetaMask video tutorial in there.

You now need to fund your Metamask wallet with ETH. Otherwise, it will be impossible to do anything meaningful with your wallet. There are hundreds of ways to get ETH into your Metamask wallet. In the current version there is even a built-in option to buy ETH via Wyre:

Wyre seems to take around 5% network and transaction fees. This is a very simple approach. But again, there are many ways to buy ETH (like Kraken, Binance or Coinbase) with different comfort and cost structures. If you prefer to take another provider, make sure to buy ETH and send/withdraw it to your Metamask wallet.

You can now head over to Uniswap and trade ETH to DPI. It should look somewhat like this:

Important tip: Never spend all of your ETH. Always save some of it for later since you’ll always need ETH to pay your gas cost.

If this is your first time to trade ETH against another token on Uniswap, you first need to approve that Uniswap can access your ETH and spend it for that trade (remember the first of our three transactions I mentioned above?).

Your MetaMask window pops up and you need to confirm the approval. This happens only once for all your further ETH actions on Uniswap.

Now you are set up to actually swap your ETH for DPI. You need to confirm the trade and get a window like this one:

You should now see a second confirmation screen — this time in your MetaMask window:

Please notice that you can edit the gas fee to save some transaction cost. In this case we’ll save ~10$ if we opt for “slow” instead of “average” transaction speed. But be aware that “slow” means that we might need to wait for an hour for our transaction to complete…

Once we confirm the transaction, Uniswap asks us if we want to track the processing of our transaction on Etherscan. Sure we want. Etherscan is Ethereum’s most famous Block Explorer and will become your best buddy in DeFi. You can use it to track active transactions, but also to see all of the history on your Ethereum account.

Congrats, you now have successfully invested in DeFi Pulse Index and are the proud owner of your first DPI tokens!

Keep track of your investment

There are many ways to keep track of your DeFi investments on Ethereum and beyond. Etherscan is one of them. Just navigate to your wallet address and you’ll have an overview. The probably fastest way to do that is again your MetaMask wallet. Just click the three dots and head over to Etherscan:

There are also great mobile options to take a quick glance at your portfolio. I can recommend the mobile apps from Delta and Blockfolio. Just point them to your public wallet address and you’ll be always up to date.

Summary

To sum it up, I showed a possible way how to invest into a variety of DeFi products. We chose DPI as an interesting option in times of high gas prices. Along that trip you learned some lessons in cost calculations and tooling.

You are welcome to follow me on Twitter or get in touch via LinkedIn (and please tell me your reason to connect and how you found me).

[This is a cross-post. I first published this article on publish0x.]

Further reading: You can find more articles about Blockchain and DeFi on my blogs on publish0X and Medium.

Disclaimer: This article is not intended to be an investment advice of any sort. Do your own research and search for professional support if you intend to invest in one of the projects mentioned in this article.

Join Coinmonks Telegram group and learn about crypto trading and investing

Also, Read

Get Best Software Deals Directly In Your Inbox

DeFi for Newbies: 3) And action! was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.