An illustrated tour of the world of decentralized finance
Welcome to DeFi. The goal is open access to decentralized financial services for anyone in the world. DeFi is possible because of cryptocurrencies and smart contracts, which allow us to write code to program money.
A smart contract is a self-executing piece of code that can interact with the blockchain. It can send and receive funds based on predetermined criteria written in the code.
Check out our video on smart contracts for more:
What can we do with programmable money?
I've written previously about some of the real world applications of crypto.
Smart Contracts are deployed on smart contract blockchains or "L1s". L1s are primarily competing across 3 factors: • Scalability • Decentralization • Security An L1 can only pick 2 out of 3. This is called the blockchain trilemma.
L2s help the Ethereum blockchain scale without compromising on security. Here's a thread explaining L2s.
DeFi is becoming increasingly multichain.
Whether its L1s or L2s, you're going to need a way to hop around between chains if you're going to be part of the DeFi world.
For this, we have Bridges.
Bridges allow you to transfer funds from one blockchain to another.
In exchange, they take a small fee.
Because of the way most bridges work, they need to store lots of assets in their contracts. Which means their contracts are giant honeypots for attackers.
For example, you can see that there is $137M+ worth of tokens on this wormhole bridge contract.
To interact with a blockchain, you need a Wallet. Wallets hold your crypto, and give you a way to interact with the blockchain.
More accurately, Wallets hold the private keys that let you access the crypto at your wallet address.
Most wallets will give you a recovery phrase in case you lose access to your wallet.
Keep this seed phrase very safe. If you lose this, you cannot recover your funds.
Wallets let you interact with a blockchain and with apps deployed on a blockchain.
Most popular wallets can interact with multiple chains.
DApps may be deployed on one or multiple chains.
Wallets come in many shapes and sizes.
For example, some wallets are actually just a smart contract under the hood.
More wallets are becoming modular, allowing developers to integrate apps directly into the wallets.
...kind of like the iOS/Android App Store model.
For institutions, associations, DAOs, or people who want more security, there are multisig wallets.
These can be configured to require signatures from multiple parties to authorize a transaction.
Example: only transfer funds if 3 out of 4 people sign a tx.
Dapps are decentralized applications deployed on blockchains.
Typically, they just require you to connect your wallet.
No sign up needed.
See my thread on web2 apps vs web3 dapps
Here are some common dapps you'll find on most chains: • Lending and Borrowing Examples: @AaveAave
- Decentralized Exchanges (DEX)
DEXes let you trade or swap coins without using a centralized exchange.
Decentralized Exchanges use an "Automated Market Maker" to facilitate trades. Here's a guide explaining AMMs & Liquidity Pools.
- DEX Aggregators, which aggregate liquidity across various DEX-es.
- @synthetix_io has tokenized derivatives of stocks and crypto.
- @lyrafinance offers decentralized call and put options on crypto.
- @InsurAce_io offers decentralized insurance (mostly on crypto investments for now).
Most users in DeFi today are just looking for yields on their crypto. But a lot of yields in DeFi are unsustainable or driven by token inflation. See this post to understand where the money is REALLY coming from
The 3 basic ways to earn yield in DeFi are: 1. Lending & Borrowing You can lend to earn interest or borrow against your assets. Borrowers pay interest to lenders. Loans are overcollateralized so borrowers need to have more collateral than the borrow amount.
2. Staking You can stake your crypto and run your own validator node, to help secure the network in exchange for staking rewards.
Or do delegated staking, which means you delegate your crypto to a validator. The validator gets a commission. You get staking rewards minus commission. "Staking-as-a-Service"
Some staking services will give you a "receipt token" for staking. This receipt token represents your staked tokens + interest, and can then be traded, used as collateral, etc. This is called "liquid staking". @staderlabs, @lidofinance and some others are working on this.
@magikinvestxyz wrote a great thread about this here 👇
3. Liquidity Pools Liquidity pools facilitate trading without the need for an order book exchange. Liquidity Providers supply coins into the pool and earn a % of the trading fees.
Note: Liquidity Pools have an additional risk called "Impermanent Loss" or IL. You can read more about IL here:
In crypto, you also have liquidity risks. This is the risk that your assets are illiquid and you cannot get rid of them easily. This risk is low for large highly-traded coins like BTC and ETH, but becomes increasingly higher for smaller cap coins.
NFTs are particularly vulnerable to this.
If you can’t find a buyer, your NFT is worth $0
Now, for a functional decentralized finance ecosystem, we also need a Stablecoin. This allows you to move your exposure in and out of crypto without needing to offramp your crypto.
Stablecoins are pegged 1:1 to a currency like the US dollar. The only important function of a stablecoin is to maintain its peg.
Some are collateralized like $DAI - meaning that every stablecoin minted is backed by at least the same amount (and usually more) in collateral.
Some are algorithmic and rely on market forces to maintain the peg.
Some have a hybrid model. But when market forces work unexpectedly, it can cause the whole system to collapse.
Stablecoins are not the only type of pegged assets. DeFi also has wrapped assets. For example: WBTC is a "wrapped" Bitcoin token on the Ethereum chain. Theoretically, its price should stay very close to $BTC's price.
You can also have other types of synthetic assets in DeFi. For example: • Fund token (basket of cryptos) • Leveraged token (2x ETH) +++ Lots of possibilities...
There's a LOT more going on in DeFi world. This was just a quick illustrated tour of DeFi world.