IAMUVIN

Bitcoin & Cryptocurrency

What Is DeFi? Decentralized Finance Explained Simply

Uvin Vindula·March 20, 2023·9 min read

Last updated: April 14, 2026

Share

TL;DR

DeFi — Decentralized Finance — lets you do everything a bank does, without the bank. Lend money and earn interest. Borrow without a credit score. Trade currencies without a broker. Earn yield on savings. All of it runs on smart contracts — programs on a blockchain that execute automatically, transparently, and without permission. I am Uvin Vindula, founder of uvin.lk, and I have spent years not just using DeFi but building it. This guide is for people who want to understand what DeFi actually means, what it does, and what can go wrong.


One-Paragraph Explanation

DeFi is a system of financial services — lending, borrowing, trading, savings — that runs on blockchain networks instead of through banks. Instead of a bank manager deciding whether you qualify for a loan, a computer program handles it based on transparent rules anyone can read. Instead of an exchange matching buyers and sellers behind closed doors, a smart contract does it in the open. Nobody needs to approve your account. Nobody can freeze your funds. You connect a digital wallet, and the entire financial system is open to you — whether you live in London, Colombo, or a village in the south of Sri Lanka with nothing but a phone and an internet connection.


How Traditional Finance Works

Before I explain DeFi, you need to see what it is replacing.

Think about what happens when you walk into a bank in Sri Lanka and deposit money. The bank takes your deposit and lends it to someone else — a business, a homebuyer, another bank. They charge that borrower interest. They give you a tiny fraction of that interest and keep the rest. That is how banks make money. They are middlemen.

Want to send money abroad? Forms, fees, days of waiting. The bank checks everything and takes a cut at every step. If it is a weekend, nothing moves. If the bank does not like the transaction, they block it. Your money, their rules.

Want a loan? You need a credit history, collateral the bank approves of, and you need to convince a human being that you are worth the risk. If you are a young person in Sri Lanka without property or a government job, good luck.

This is how the system works by design. It requires trust. You trust the bank to hold your money and give it back when you ask. If you are Sri Lankan, you know exactly how that trust can be broken. In 2022, we watched it happen in real time.

DeFi asks a simple question: what if we did not need to trust anyone at all?


How DeFi Changes It

DeFi replaces the middleman with code.

Instead of a bank holding your money, a smart contract — a program that lives on a blockchain — holds the funds and follows rules that were written into it from the start. Those rules are public. Anyone can read them. They execute automatically. No human being can override them or make exceptions for their friends.

When you deposit money in a bank, you are trusting people. In DeFi, you are trusting mathematics. The smart contract does exactly what the code says it will do, every single time, for every single person.

You interact with DeFi through a digital wallet — software like MetaMask on your phone or computer. Connect your wallet to a DeFi application, choose what you want to do, and the smart contract handles the rest. No forms, no approval process, no office visit. Everything is recorded permanently on a blockchain, and you can verify every detail. Try asking your bank for that level of transparency.

There are DeFi applications running on Ethereum, Arbitrum, Optimism, Base, Polygon, and many other networks. Billions of dollars sit in DeFi smart contracts right now. Not in a bank vault. In code.


Lending and Borrowing — Without a Bank

In traditional finance, you deposit money in a bank. The bank lends it out, charges interest, gives you a fraction, and keeps the rest.

In DeFi, the same thing happens — minus the bank. You deposit cryptocurrency into a lending protocol like Aave or Compound. Your funds go into a pool. Borrowers take from that pool and pay interest directly to you. The smart contract manages everything: interest rates, collateral requirements, liquidation rules.

Here is the part that surprises people. DeFi borrowers do not need a credit score or proof of income. What they need is collateral. To borrow 1,000 dollars' worth of one cryptocurrency, you might deposit 1,500 dollars' worth of another as collateral. If the collateral value drops below a threshold, the smart contract automatically sells it to repay the loan. No collection agencies. No legal proceedings. Just math.

This over-collateralization means the lender is always protected by code. That is why DeFi lending works without trust, without credit scores, and without anyone knowing your name.

I have used these protocols and written smart contracts that implement lending logic. The code is not magic. It is accounting — the same calculations your bank does, running on a blockchain where nobody can tamper with it.


Trading — Without an Exchange

Normally, when you want to trade a stock or currency, you go through an exchange — the Colombo Stock Exchange, Binance, or similar. The exchange matches buyers with sellers and takes a fee.

DeFi replaces this with something called an Automated Market Maker, or AMM. Imagine two buckets side by side. One is full of Token A, the other full of Token B. People deposit their tokens into these buckets and earn fees for doing so. When you want to trade Token A for Token B, you put some of Token A into the first bucket and take some of Token B from the second. A mathematical formula in the smart contract determines how much you get based on the ratio of tokens in the two buckets.

No order book. No exchange operator. No trading desk. Just a formula and two pools of tokens.

The most well-known AMM is Uniswap. It has processed hundreds of billions of dollars in trades across Ethereum and other networks. Anyone can create a trading pair. Anyone can provide liquidity and earn fees. The whole thing is open and permissionless.

I have built AMM-related smart contracts. The core math uses what is called a constant product formula — a simple equation that ensures the pools stay balanced. When I first read the Uniswap whitepaper, I was struck by how something so powerful could be so mathematically simple. That simplicity is what makes it trustworthy. Less code means fewer places for bugs to hide.


Earning Yield — What the Numbers Mean

When you deposit money in a Sri Lankan bank, you might earn 8 to 12 percent annual interest locked up for a year. In DeFi, you will see numbers like 5%, 15%, or higher. These numbers are real, but they need context.

DeFi yield comes from real activity. Provide liquidity to a trading pool, and you earn a share of the fees. Lend your crypto, and you earn interest from borrowers. Some protocols also reward you with their own tokens as incentive. The yield is not coming from nowhere — it comes from people paying to use the service you provide.

But a 10% yield in DeFi is not the same as a 10% fixed deposit. DeFi rates change constantly based on supply and demand. More depositors means lower yield. More borrowing demand means higher yield. These rates are dynamic, not guaranteed.

Protocols advertising 100%, 500%, or 1,000% yields are almost always paying you in their own token (which can lose value faster than you earn it) or offering a temporary rate that will collapse. The sustainable yields in DeFi are the boring ones — single digits to low double digits. Anything dramatically higher should make you ask hard questions.


The Risks Nobody Talks About

I would be lying to you if I told you DeFi was all opportunity and no risk. Here is what can go wrong — I have seen every one of these happen.

Smart contract bugs. Code can have vulnerabilities. Hackers exploit them and drain funds. Hundreds of millions of dollars have been lost this way. Unlike a bank robbery, there is no insurance and no way to reverse the transaction. This is why I take security so seriously in every contract I write.

Impermanent loss. When you provide liquidity to a trading pool, your deposit can decrease in value if token prices shift significantly. You can earn trading fees and still end up with less than if you had simply held the tokens. This is a structural feature of how AMMs work, and many tutorials gloss over it.

Rug pulls and scams. Anyone can create a DeFi protocol, which means anyone can create a fraudulent one. A rug pull is when creators drain the liquidity and disappear. Anonymous founders, unaudited code, and impossible yields are the warning signs.

Regulatory uncertainty. Governments are still figuring out DeFi regulation. Rules can change, and access can be restricted. Stay informed about the laws in your jurisdiction.

User error. You are your own bank and your own security department. Lose your private keys and nobody can recover your funds. Approve a malicious contract and nobody can undo it. Freedom comes with responsibility.

I am not listing these to scare you. Anyone who explains DeFi without mentioning risks is not educating you — they are selling you something.


DeFi in Sri Lanka

In 2022, our economy collapsed. The rupee lost massive value. Banks restricted dollar withdrawals. Capital controls made it nearly impossible to move money out of the country. People watched their life savings evaporate — not because they made bad decisions, but because the institutions they trusted failed them.

DeFi does not fix macroeconomic mismanagement. I want to be clear about that. But it offers something the traditional financial system in Sri Lanka has repeatedly failed to provide: access that cannot be revoked by a government decree.

If you have a phone and an internet connection, you can access DeFi. You do not need a bank account, permission from the Central Bank, or to stand in a queue. The same protocols available to a hedge fund manager in New York are available to a university student in Kandy. That is not a marketing pitch — it is how the technology works.

I must be honest about the limitations. DeFi runs on cryptocurrency, not Sri Lankan rupees. You need to acquire crypto first, which has its own challenges here — limited on-ramps, regulatory ambiguity, and a steep learning curve. The risks I described above apply doubly to people who are new to the space.

But the trajectory is clear. Financial access is moving from permission-based to permissionless. Sri Lanka, with its history of financial crises, has more reason than most countries to pay attention.


How I Went from DeFi User to DeFi Builder

I started with DeFi the way most people do — as a user. I connected a wallet, deposited crypto into a lending protocol, and watched the interest accumulate. No human being involved at any step. Just smart contracts executing logic.

But I am an engineer by nature. I could not just use DeFi — I needed to understand how it was built. I started reading smart contract code, studied Solidity, learned Foundry for fuzz testing, and dissected the code behind Uniswap and Aave line by line.

Eventually, I started building. I wrote smart contracts that implement lending logic, AMM mechanics, staking systems, and token distribution. I learned the hard way about reentrancy attacks, gas optimization, and the difference between code that works and code that cannot be exploited. Every contract I deploy goes through fuzz testing, invariant testing, and security review — because in DeFi, a bug does not crash a webpage. A bug loses real money.

That journey fundamentally changed how I think about finance. The core mechanics are simple — addition, subtraction, percentages, ratios. The complexity is in making the math impossible to exploit. That is where engineering discipline matters.

Through uvin.lk, I teach people both sides — how to use DeFi safely and how the systems work under the hood. Understanding the technology is the best protection against the risks. When you know what a smart contract does, you can evaluate whether it is worth trusting. When you do not know, you are guessing. And in DeFi, guessing is expensive.


Key Takeaways

  • DeFi stands for Decentralized Finance — financial services that run on blockchain smart contracts instead of through banks and middlemen.
  • You can lend, borrow, trade, and earn yield without a bank account, credit score, or anyone's approval.
  • Smart contracts are the foundation — programs that execute automatically based on transparent rules that anyone can verify.
  • DeFi yield comes from real activity — trading fees, borrowing interest, and protocol incentives. Sustainable yields are moderate, not spectacular.
  • The risks are serious — smart contract bugs, impermanent loss, scams, regulatory changes, and user error. Know them before you participate.
  • DeFi is especially relevant in countries like Sri Lanka where traditional financial institutions have failed to protect people's savings and access.
  • Understanding the technology is your best defense — learn how protocols work before you trust them with your money.
  • Start small, start slow — use established protocols with audited code and years of track record before exploring newer, riskier options.

*Written by Uvin Vindula — Bitcoin educator, Web3 engineer, and founder of uvin.lk. Based in Sri Lanka and the UK. Building tools and writing guides to make decentralized finance accessible to everyone, regardless of geography or background.*

Working on a Web3 or AI project?

Share
Uvin Vindula

Uvin Vindula

Web3 and AI engineer based in Sri Lanka and the UK. Author of The Rise of Bitcoin. Director of Blockchain and Software Solutions at Terra Labz. Founder of uvin.lk — Sri Lanka's Bitcoin education platform with 10,000+ learners.