DeFi
Decentralized Finance is a system built on blockchain technology that allows users to perform financial transactions, like lending, borrowing, and trading with cryptocurrencies.
Some well known DeFi services are briefly presented bellow, but to dive deeper into these topics, you should read the CS251 Lecture 9 and CS251 Lecture 10 slides.
Staking
The rise of Proof of Stake blockchains gave birth to one of the most popular DeFi services: Staking. Simply put, staking lets crypto holders earn rewards by locking their funds in a dedicated wallet for a certain amount of time, and thus participating in the Proof of Stake protocol. The high barrier of entry for staking some cryptocurrencies like Ethereum which requires a minimum of 32 staked ETH to become a validator, and the complexity of setting up such nodes has led to the creation of Staking Pools. Other forms of staking include Delegated Proof of Stake (similar to pools) and Liquid Staking.
Decentralized Exchanges (DEXs)
Decentralized Exchanges are exactly what their name implies : an exchange built on top of a blockchain. Unlike centralized exchanges (CEX) like Kraken and Binance, DEXs are non custodial. That means that the users keep control of their private keys and cryptos, and there is no need to deposit into an account owned by the exchange. In fact, there are no accounts. Instead you just connect your wallet, you choose a swap pair (e.g. ETH to USDc), you submit the swap and the rest happens on smart contracts. To understand how DEXs work under the hood, check out this article and also read about AMMs.
Popular DEXs include UniSwap for swapping ERC20 Tokens, PancakeSwap for BEP20 Tokens (equivilent of ERC20 for Binance Smart Chain), Orca for Solana and of course many more.
Stablecoins
Stable coins are cryptocurrencies whose value is tied to that of another currency or commodity. Usually, they are tied to some Fiat currency (government backed), like the U.S. dollar. What makes them important is the market's high volatility, since even Bitcoin often moves more than 10% in the span of a few days. Stablecoins aim to address this problem by serving as a medium of exchange and promising to hold on to their value in a variety of ways.
-
Fiat-Collateralized Stablecoins: Backed by a reserve of a fiat currency as collateral. Such reserves are maintained by independent custodians and are regularly audited. Tether USD (USDT) and USD Circle (USDc) are the two most popular ones.
-
Commodity-Backed Stablecoins: Backed by the market value of commodities such as gold, silver or oil. Tether Gold (XAUt) is one popular example.
-
Crypto-Collateralized Stablecoins: Back by other cryptocurrenceies. Due to the high volatility of their reserves also being a cryptocurrency, they are generally overcollateralized, which means that the total value held in reserves greatly exceeds that of the stablecoins issued. To learn more about this category, check out how DAI works.
-
Algorithmic Stablecoins: These coins maintain their value through programmed mechanisms that adjust supply based on market demand, without relying on direct collateral. Examples include Ampleforth (AMPL) and Terra (UST), whose collapse is an interesting read.
Crypto Lending
Crypto lending can be split into two categories : borrowers and investors.
Borrowers take loans in the form of cryptocurrencies, by using their digital assets as collateral, similar to how a house is used as collateral for a mortgage. The amount of crypto you can receive is calculated based on how much collateral you can stake using loan-to-value (LTV) ratio. You can avoid collateral altogether by taking flash loans, which are repaid within the same transaction and work in a complex but cool way.
Investors take part by depositing their cryptocurrencies into pools managed by lending platforms, and then get a part of the profits. If a borrower is unable to repay the loan, investors can sell the crypto collateral to cover losses (technically, the platform liquidates the collateral automatically based on LTV thresholds).
Others
DeFi is one of the most popular aspects of blockchains since most users have gotten into the space looking to make profit, so new services continue to emerge. Yield Aggregators, Decentralized Insurance and Asset Management Protocols are a few examples we did not cover.
💡 Tasks
- Use Uniswap to swap $10 worth of your Ether to USDC directly through your Metamask without using a centralized exchange.
- Check out the articles and services mentioned above and try to use some of them.
- Read CS251 Lecture 9 slides.
- Read CS251 Lecture 10 slides.
- Create your own ERC20 token using OpenZeppelin. Deploy it to main net Ethereum and mint 20 of your own tokens to your wallet.