The Ultimate DeFi Introduction: Part II/III

Satria Pamudji
10 min readAug 29, 2021

In the first week, we covered the potential of Decentralized Finance (DeFi) and also the risks associated with it. We also covered the basics of blockchain — such as the definition of cryptocurrencies — and how stablecoins work last week.

If you happened to have Googled DeFi while waiting for my article, you might now be wondering, “how do the applications run if there are no middlemen”… and “what on earth is Yield Farming?”

Don’t worry, because this week we will be diving deeper into the DeFi space. In this article, we go through:

  1. How smart contracts work
  2. Core DeFi applications
  3. DeFi Terminologies
  4. Overview of the past weeks

And I am sure by the end of this article, you will be confident in exploring the different ecosystems for yourself, and taking steps so you will be financially free. Let’s get started!

Smart Contracts… What are they?

Remember the diagram of the ETH blockchain in our last article? If you were wondering who issues the tokens or where your money will go… Well, you’ll learn that today.

Basically all of these transactions — apart from transferring from one wallet to another — are facilitated via smart contracts.

Think of smart contracts this way: We have vending machines in our everyday lives. To get a drink that’s labeled A1 from the vending machine, you would put in money and press A1 using the number pad on the vending machine. The vending machine will then proceed to dispense both the drink that’s labeled A1, and your change as well. This transaction happened without the need for a cashier or clerk.

Likewise, smart contracts work the same way and allows anyone to buy/sell/trade on the blockchain without the need of a middleman.

Core DeFi Applications

So with that out of the way, now we can have examples of how smart contracts are being used for DeFi applications, and how they work. These 3 are what I consider core applications:

  1. Decentralized Exchanges (DEXes)
  2. Decentralized Money Markets
  3. Yield Aggregators

Decentralized Exchanges (DEXes)

Decentralized exchanges are cryptocurrency exchanges that operate without a central authority, and this allows people to trade peer-to-peer while allowing users to maintain full control of their funds. But how does it work exactly?

The Uniswap DEX at https://app.uniswap.org/#/swap

One of the more popular DEXes on Ethereum is called Uniswap. But to truly understand how DEXes work, let’s understand how Centralized Exchanges (CEXes) works.

In centralized exchanges, when you deposit your money in an exchange such as Binance, you give up control of your funds. All of the transactions are also done. Because you also don’t own the private keys, you have to ask the exchange to sign transactions on your behalf when you want to do things like withdrawing it or transfer it to other accounts. This means you would need to fully trust the exchange with your money, and expose yourself to some counterparty risk.

However, with a decentralized exchange, you don’t lose custody of your funds and there is no middleman that facilitates your transactions. Just smart contracts.

Let’s take a look at Uniswap and how it works. Uniswap ditches the traditional order-book — the list of buy and sell orders you see on exchanges and goes with a constant product market model, which is a variant of the automated money market (AMM) model. AMMs are basically just smart contracts that hold liquidity pools that traders can then swap/trade against.

Liquidity pools — funded by liquidity providers — compromise two tokens of equal value. And when traders trade with a liquidity pool, they have to pay a fee, which is then distributed to liquidity providers according to their share of the pool.

Sounds super complex, I know, so let me explain it with a simple graph below.

The underlying smart contract for the ETH/USDT pool

As you can see above, Cheryl as a liquidity provider provides $500 worth of ETH and $500 worth of USDT to the liquidity pool and gets 0.3% of every trade in the future (trading fees). With this, John is then able to trade his ETH for USDT or USDT for ETH without any form of middlemen.

Decentralized Money Markets

Just like traditional finance, money markets also exist. Money Markets allows anyone in the world to be able to lend/borrow money peer to peer, any time without any form of KYC or documents. One example of this is Aave, a money market built on Ethereum.

Aave —decentralized money markets at https://app.aave.com/markets

While this might seem new to you, the fundamentals of a decentralized money market versus a traditional money market still remain the same.

Borrowers use money markets for short loans which allows them to borrow one currency (eg. dollar) while putting up collateral (eg. car, or house). This collateral is sold in the case that the borrower fails to pay back their loans to make the lender whole. Otherwise, the collateral will be paid back the moment the borrower repays his/her loan.

In this case, for a borrower to be able to borrow USDT, he/she would need to put BTC upfront as collateral. For more volatile assets, you have a lower loan-to-value (LTV) as compared to assets that are less volatile, like DAI.

Borrowers are also required to pay a fee, usually in the form of an annual interest rate (e.g. 7% a year), in exchange for borrowing working capital from lenders. This interest rate is typically a function of supply and demand to ensure sufficient liquidity is available to both borrowers and lenders.

A high supply and low demand of an asset lead to lower interest rates, while low supply and high demand of an asset lead to a higher interest rate. Various money markets compete based on the interest rates they offer, as well as other parameters such as how much collateral is required for loans.

Yield Aggregators

The last of which I consider a DeFi core application are yield aggregators, which allows people to earn returns on their cryptocurrencies through a process called “yield farming”. A simple yield strategy consists of depositing a token (USD), borrowing DAI against your USD, swapping it back to USD, and then re-depositing it back into the USD pool, which maximizes their “farming rate”.

However, because yields can vary between platforms, it becomes tedious for normal users to farm because they have to research various applications. This is where Yield Aggregators — such as Yearn Finance below — comes in.

Yearn’s yield aggregator at https://yearn.finance/

Yield aggregators search the different DeFi platforms and their respective yields to find the best profits for a user, with a more unified and simplified user experience. Apart from just shifting a user’s fund to various different platforms, yield aggregators also aim to give users farms with the shortest commitment and lowest gas fees.

They not only help investors find the best yield strategies, but also the safest one as well without all the manual work.

DeFi Terminologies

So before you embark on your journey & explore the different applications for Decentralized FInance available out there, here are some different terminologies you will frequently encounter along the way, and their meaning!

Feel free to come back here in the future if you ever see a specific term you don’t understand.

Audit

In crypto, usually an audit is generally meant for smart contracts. A comprehensive audit includes a thoughtful and in-depth look at the structure, strengths, weaknesses, and vulnerabilities of the smart contract.

Audits may be either informal or formal audits and are meant to be a tool to find and analyze weaknesses, so that issues and problems discovered during an audit may be remediated, mitigated, or corrected.

AML/KYC

AML refers to the Anti Money Laundering laws, regulations, and procedures to help detect and report suspicious activity such as money laundering, and terrorist financing. KYC is one of the subsets of the AML laws, and it just means “Know your Customer” — ie. their identity, financial activities, and the risk they pose.

APY

Annual Percentage Yield, a time-based measurement of the Return On Investment (ROI) on an asset. For example, $100 invested at 2% APY would yield $102 after one year, if there is no compounding of any interest earned on that $100 through the year. Assuming a static APY rate, the Monthly ROI would be 0.16%, in this case.

CeFi

Centralized Finance. In terms of cryptocurrency, CeFi is represented by centralized cryptocurrency exchanges, businesses, or organizations with a physical address, and usually with some sort of corporate structure. These CeFi businesses must follow all applicable laws, rules, and regulations in each country, state, or region in which they operate.

Collateral

In DeFi, collateral is the asset pledged by a borrower to protect the interest of a lender. For example, if you want to borrow $100, you would need to put $200 worth of assets as “collateral” in the event that you cannot pay back the $100.

Composability

Think of composability as lego blocks. The more composable something is, the more modular it is. So when we talk about a particular application being composable, it means that that particular application can be treated like a lego block and be used as a base layer to create other things.

dApp

A dApp means decentralized application. Decentralized applications have their backend code running on a decentralized network, as opposed to traditional applications where the backend runs on centralized servers.

DAO

A DAO is a business model. Similar to how businesses classify themselves as LLC, the difference with a DAO is that there is no one single entity that is able to make business decisions such as the movement of funds. All major decisions are put through a governance vote.

Delegate

The concept of permitting a person, company, or organization the ability to borrow utilizing another owner’s deposited collateral.

Derivative

Derivatives are financial contracts, set between two or more parties, that derive their value from an underlying asset, group of assets, or benchmark. One example of this is ETH futures, where the underlying is ETH and the derivative is the futures contract.

Gas Fees

“Gas fees” are the transaction fees that users pay to miners on a blockchain protocol to have their transaction included in the block. Some blockchains use gas fees as a way to mitigate spam as well.

Leverage

Leverage refers to the use of debt (borrowed funds) to amplify returns from an investment or project. For example, in Binance you can have up to 125x leverage, meaning that your $10 would be $1250 and your profits will be amplified as well. However, the higher the leverage, the higher the risk since your losses will be amplified too.

Liquidity

Liquidity refers to the ease with which an asset, or security, can be converted into ready cash without affecting its market price. For example, if a particular pool has little liquidity, it means that even a purchase of $1,000 can have a huge price impact.

Market Cap

Market capitalization refers to the total dollar market value of a cryptocurrency circulating supply. Commonly referred to as “market cap,” it is calculated by multiplying the total number of circulating supply by the current market price of one coin.

ROI

Return on investment (ROI) is a performance measure used to evaluate the efficiency or profitability of an investment or compare the efficiency of a number of different investments.

Stake/Staking

Staking is the act of locking cryptocurrencies — to support the security and operations of a blockchain network — and in return, you receive rewards.

TVL

TVL in DeFi stands for Total Value Locked. Usually it’s used to measure adoption and trust in an ecosystem. For example, if an ecosystem has 1b TVL as compared to 10m, one would pick the former to be more trustworthy.

Whale

An individual or organization that holds a large amount of Bitcoins or other cryptocurrency, allowing them to impact the markets.

Conclusion

And that’s it for week 3! So far since week 1, we’ve covered everything you need to know about DeFi, from the potential of DeFi, to how blockchains work, and today we went through the different core DeFi apps.

Now you might be wondering since I’ve covered everything one would need to know about DeFi, “Satria, what is going to happen next week?

Next week, we will get you set up in the Terra Ecosystem. We will talk about the UST stablecoin, how to save in Anchor to net you 19% APY, and how to buy stocks (and potentially short it too!). Finally, we will end off this series by going through the reason why I’m recommending Terra amongst all the other blockchains available out there.

If you have any discrepancies with this article, feel free to shoot me a DM or message me. Not financial or legal advice, do consult a financial professional before you decide to make a serious financial investment!

This is the third out of four of the DeFi introductory series that I plan to release in August (once a week) — so be excited about it! If you want to stay updated, follow me on Twitter!

--

--

Satria Pamudji

I help you understand technical concepts by writing easy-to-digest articles