You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Decentralised Finance (DeFi) is a financial ecosystem built on blockchain that aims to recreate and improve upon traditional financial services — lending, borrowing, trading, insurance — without intermediaries. Tokens are the building blocks of DeFi.
DeFi replaces traditional financial intermediaries (banks, brokers, exchanges) with smart contracts:
| Traditional Finance | DeFi Equivalent | Example |
|---|---|---|
| Bank savings account | Lending protocol | Aave, Compound |
| Stock exchange | Decentralised exchange (DEX) | Uniswap, SushiSwap |
| Loan officer | Collateralised lending | MakerDAO |
| Insurance company | Decentralised insurance | Nexus Mutual |
| Asset manager | Yield aggregator | Yearn Finance |
| Derivatives exchange | Decentralised derivatives | dYdX, GMX |
Ethereum token standards define how tokens behave and interact with wallets and protocols.
ERC-20 is the standard for fungible (interchangeable) tokens:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor() ERC20("MyToken", "MTK") {
_mint(msg.sender, 1000000 * 10 ** decimals());
}
}
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.