Gold photo created by master1305

Intro to DeFi

Alexandre Carvalho
7 min readFeb 16, 2021

--

What is all this hype about?

Before diving into the topic let me say nothing I write here is investment advice, crypto is risky, you may lose everything you put in so please be careful.

As a second disclaimer, if you’re into finance and/or tech be advised that DeFi is extremely addicting and may become a huge time sink, consider yourself warned.

What is Blockchain?

You can think of blockchain as a way to store data (transactions) in a decentralized, immutable, and secure way.
Decentralized because there is no central point where everything is stored, the ledger with the transactions is replicated across thousands of nodes geographically distributed.
Immutable and secure as the data can’t be changed and is protected by state of the art cryptography.

What is DeFi?

DeFi stands for Decentralized finance.
Imagine that all the underlying infrastructure of traditional finance is now written in plain English, accessible in a place that everyone could read, decentralized, and permissionless.

This would mean that I would be able, just by accessing public information, to verify how much money is in the reserves of a bank, how much interest is being paid by that said bank, how much money is being lent out, and much more. It would also mean that anyone could, based on this information, select which services and providers to use and use them without any kind of discrimination or bias. It wouldn’t matter who I am, where I live, or how much money I have.

So you may be asking, what kind of services are there in DeFi today?

Borrowing and Lending

Explanation

Borrowing and Lending platforms are platforms where you can earn interest by borrowing (depositing) assets into or where you can borrow some assets from.

How to profit

There are two main strategies when it comes to this kind of protocols, the simple one, you deposit an asset and earn interest. And the more complex one, where you borrow an asset so that you can do some kind of purchase operation (currently all of the available borrow and lending protocols work with over-collateralization). An example of this is depositing ETH borrowing a stable coin like DAI or Tether and buying more ETH (this is called leveraging). If ETH goes up, you can then pay the loan + interest and keep the profit. The problem is if ETH goes down and you run the risk of being liquidated losing your collateral.

Risks

When you are just earning interest with your deposits the only risk is the smart contract risk. A bug in the code that allows some malicious actor to steal your deposits.
If you are borrowing against collateral, the risk is being liquidated when you’re collateral drops below the ratio defined by the protocol.

Good examples

Two good protocols for borrowing and lending are https://aave.com/ and https://compound.finance/.

Decentralized exchanges (DEX)

Explanation

Instead of centralized exchanges, like Coinbase where you trust your money into a third party (the exchange) and then withdraw when you are done transacting, decentralized exchanges are non-custodial, you never deposit your money it is always in your wallet and just goes out when you execute your trade, receiving immediately the outcome of the trade execution, 100% trustless.

How to profit

In decentralized exchanges, you can be a liquidity provider (LP). An LP deposits assets into a pool and earns a percentage of the fees generated by that pool.
Example: You deposit ETH and DAI into de ETH/DAI pool. Each time a user converts ETH into DAI or DAI into ETH using the exchange, you receive a percentage of the fees the user pays to execute the transaction in that transaction.

Risks

Smart contract risk, a bug in one of the contracts that composes the protocol may lead to loss of money.
Impermanent loss is hard to explain but if the value of the two assets in the pool evolves in opposing directions (one up and the other down), when withdrawing from the pool you may end up with less than you deposited (a better explanation can be found here:https://defiyield-info.medium.com/why-impermanent-loss-calculators-are-wrong-and-how-to-avoid-incorrect-assessment-of-the-money-waste-d349607706fc ). This risk is higher if the volatility of the deposited assets. With stable coins, this risk is almost inexistent.

Good examples

Two of the biggest DEXs are https://app.uniswap.org/ and https://www.sushiswap.fi/.

Yield aggregators

Explanation

DeFi is an extremely fast-paced ecosystem and so are the yield opportunities in the space, one day the biggest yield opportunity for ETH is to deposit into AAVE the next one is to provide liquidity into some DEX, but moving your money around often is very capital inefficient as you need to pay a fee per transaction (GAS).
To reduce these costs and maximize the yield, Yield aggregators do all of this for you. They have vaults where you deposit your tokens and for each vault, they execute specific yield maximizing strategies.

How to profit

Deposit into the vaults and see your money grow.

Risks

Compounding smart contract risks. Similarly to DEXs and most other DeFi applications with Yield aggregators you have smart contract risks, the difference here is that you are compounding that risk as the Yield Aggregators are moving your money across multiple different protocols, maximizing the surface area that is prone to bugs.

Good examples

https://yearn.finance/ is the pioneer in the space and https://app.badger.finance/ is one of the fastest-growing at the moment, specializing in BTC.

One more thing

Yield aggregators are particularly interesting for newcomers to the blockchain space who still think the volatility of the assets is too big for them. If you look into stable coins (these are assets pegged to a fixed value, most often the value of the dollar), you can use the money you have in the bank probably earning very low interest or in some cases already in the negative, and deposit into a Yield aggregator often in the 10% APY range. You get the APY without the volatility.

Insurance

Explanation

Insurance protocols provide cover for smart contract bugs, refunding users who purchased a cover from losses incurred when some of these smart contracts are exploited.

How to profit

Profiting here is a bit more complex than on the previously described DeFi protocols but simplifying the most I can, a user can stake his money into the protection of the smart-contracts he deems secure and earn rewards if they don’t suffer exploits.

Risks

Also here bugs in the insurance provider smart contracts can appear causing loss of funds.
This is also a more hands-on kind of investment and will require some knowledge of the space as staking in “unsecure” smart-contracts may lead to losing some of your funds.

Good examples

The biggest providers in this space are https://nexusmutual.io/ and https://www.coverprotocol.com/

What else to take into consideration if you want to start using DeFi?

Gas

Like I mentioned before for every transaction you do you have a transaction cost, this is the price to use the ETH blockchain, the price you pay so that your transaction is added to a block in the blockchain.
As more users arrive and want to use, the competition for block space intensifies and the transaction price goes up, so you need to be careful and consider this cost when moving your money around. Often it doesn’t make sense to transact small amounts as the fees will amount to a large percentage of the transactions.

Two quick tips:
- Fees tend to be higher during the day in the US timezones, so if you’re in GMT like I am, gas is cheaper during most mornings.
- You can use websites like https://ethgasstation.info/ or this browser extension https://chrome.google.com/webstore/detail/defi-saver-gas-prices-ext/afgfdkloegmghldbalmenklokhlifphe to monitor the gas prices.

Protocol fees

Most of these protocols charge some kind of fees, like 0.5% on withdrawals, don’t forget to check before using so you aren’t surprised when you go to take your money out.

Extreme composability

After reaching this part of the post, hopefully, you are already excited about what’s possible in this space but the really exciting part, at least for me, is the composability.
All of these protocols are written in code, there is no ambiguity, everything is specified in lines of code. This makes composability very easy, all of these “Money Legos” can communicate with each other through API’s creating a real permissionless ecosystem.

Let me give you an example:
When you deposit DAI and ETH into a pool in Uniswap, you receive tokens (LP tokens) that represent your share of the pool. You can then use those LP tokens in AAVE as collateral for a loan.

Does it still sound too complicated?

If all of this DeFi stuff sounds good and you think this may be the future of finance but you don’t have the time to go and learn about all these protocols, there is an easy way to participate in the upside, DPI, Defi Pulse Index https://www.indexcoop.com/dpi. This is an index that tracks the top DeFi tokens, in their words: “a capitalization-weighted index that tracks the performance of decentralized financial assets across the market.”

Hopefully, you are now a bit closer to understand where all of this DeFi craze is coming from.

--

--

Alexandre Carvalho

Metaphysic CTPO, Blokssom builder studio DAO co-founder, Blockchain enthusiast.