Blockchain technology · · 6 min read
What is DeFi and how does decentralized finance work?
DeFi (decentralized finance) is the umbrella term for applications that let you lend, borrow, trade and earn interest without a bank or exchange in the middle, using smart contracts that run on a blockchain. You keep your assets in your own wallet, connect that wallet to an application and transact under rules written in code that anyone can inspect; there is no account to open and no institution whose approval you need.
A smart contract is a program stored on a blockchain that runs automatically, according to pre-written rules, whenever a transaction calls it. The first large DeFi applications grew up on Ethereum, and over time they spread to other networks that can run smart contracts.
How it differs from traditional finance
The quickest way to understand DeFi is to compare how the same operation works at a bank or a centralized crypto platform:
| Topic | Centralized institution | DeFi |
|---|---|---|
| Custody of assets | The institution holds them; you see a balance | In your own wallet; you hold the keys |
| Access | Account opening, identity checks, business hours | Anyone with a wallet and an internet connection, 24/7 |
| Who enforces the rules | The institution, the contract and the law | The smart contract code |
| Transparency | Records stay inside the institution | Transactions and balances are public on-chain |
| Errors or fraud | Disputes, refunds, customer support | Transactions are usually irreversible |
| Responsibility | Mostly on the institution | Mostly on the user |
"Decentralized" is a matter of degree, not a fixed label. Many protocols have admin keys that can change the code, token holders who vote on decisions, or a web interface run by a single company. How decentralized an application really is depends on who controls these pieces.
The building blocks of DeFi
DeFi is not a single app but an ecosystem of parts that plug into each other:
- Decentralized exchanges (DEXs): Tokens are usually swapped against pools of tokens deposited by users rather than through an order book; a formula based on the pool balances sets the price.
- Lending protocols: Users deposit assets and earn interest. Borrowers post collateral worth more than the loan, because the protocol does not know who they are and the collateral is its only protection.
- Stablecoins: Tokens designed to hold a steady value against a currency such as the dollar; they serve as DeFi's common unit of account.
- Derivatives: Perpetual contracts and options that run on-chain.
- Yield vaults: Contracts that automatically move deposited funds between protocols according to a set strategy.
- Oracles: Services that bring outside data, such as exchange prices, into smart contracts.
The key property tying these together is composability. Contracts can call each other without asking permission, so a token issued by one protocol can serve as collateral in another. That is why DeFi is often compared to "money legos." The same property links the risks: a problem in one link of the chain can spread to everything built on top of it.
A hypothetical example: a lending pool
Imagine users have deposited a total of $10 million into a USDC pool on a lending protocol, and borrowers are using $6 million of it. The borrowed share of the pool is called the utilization rate; here it is 60%.
- If borrowers pay 8% annual interest, the pool generates $480,000 in interest over a year.
- If the protocol keeps 10% of that as a reserve, $432,000 goes to depositors.
- Spread across the $10 million in the pool, that gives depositors an annual yield of about 4.3%.
Three lessons follow. First, the depositor's yield comes from the interest borrowers pay and depends on utilization. Second, many protocols adjust the rate automatically: as borrowing demand rises, so does the interest rate. Third, if utilization approaches 100%, depositors may not be able to withdraw right away, because the money is out with borrowers.
On the borrower's side, collateral is monitored continuously. Someone who deposits $2,000 worth of ether and borrows $1,000 may see part of that collateral sold automatically if the ether price falls below a certain threshold. This liquidation mechanism is the price of a protocol lending to people it does not know.
Where does the yield come from?
The rates shown in DeFi apps can rest on very different sources:
- Borrowing interest: Paid by borrowers. The source is clear, but the rate falls when demand falls.
- Trading fees: People who deposit tokens into swap pools earn a share of the fees from trades in that pool.
- Token incentives: Reward tokens a protocol mints and distributes to attract users. The rate can look high, but if everyone who receives the reward sells it, the token's price, and with it the real yield, can melt away quickly.
- Staking rewards: Rewards paid on proof-of-stake networks in return for helping secure the network.
To judge whether a rate is sustainable, start by finding its source. If nobody can explain whose pocket the yield comes out of, the risk is probably higher than it looks.
The main risks
- Smart contract bugs: A flaw in the code can lock up or drain funds. Audits reduce this risk but do not remove it.
- Oracle risk: If a wrong or manipulated price reaches the contract, it can trigger unfair liquidations or draining attacks.
- Collateral and liquidation risk: In sharp sell-offs, collateral can be sold in waves.
- Stablecoin risk: If the common unit of account loses its peg, every pool that depends on it is affected.
- Governance risk: If an admin key is compromised or a malicious vote passes, the rules can change.
- User mistakes: Fake front ends, wrong addresses and spending permissions approved without understanding them can cause losses even when the code is sound.
Network fees (gas) and regulatory uncertainty add to the list. For someone working with small amounts, fees can eat the entire yield.
For anyone who wants to try DeFi, the general principles are simple: favor protocols whose code and track record have been examined, start with a small amount you can afford to lose, open the app's address from a bookmark and read every approval screen your wallet shows you.
Key takeaways
- DeFi is the umbrella term for applications that run lending, trading and interest-earning through smart contracts instead of intermediaries.
- Assets stay in the user's own wallet; control increases, but so does the user's responsibility for mistakes.
- DEXs, lending protocols, stablecoins and oracles work by plugging into each other, which means both fast innovation and chain-reaction risk.
- Yield comes from borrowing interest, trading fees, token incentives or staking rewards; a rate with no clear source is a warning sign.
- Smart contract, oracle, liquidation, stablecoin and governance risks are built into DeFi.