Wanna know more about data science? Make sure to check out my events and my webinar What it's like to be a data scientist and What’s the best way to become a data scientist !

Decentralised finance (DeFi) has become one of the most popular sectors of blockchain. The goal of DeFi, in brief, is to create a blockchain-based financial system without any intermediaries.

Some users are into this for ideological reasons, and some for purely financial reasons. In the end of the day, DeFi manages to combine both harmoniously.

Those who are in this for ideological reasons, believe that a world where financial and economic power is centralised if fundamentally wrong. Decentralisation leads to better and fairer societies.

defi

Those who are in this for financial reasons believe that by removing the intermediaries we can enjoy a better service and lower fees. Plus, we can also enjoy the creation of new financial products with different risk profiles.

DeFi has been definitely keeping some of its promises so far. And also, it has been growing more and more popular. As you can see in the graph below, at the time of writing, the total value locked in DeFi keeps growing and growing.

In this article, I am hoping to describe some of the mechanisms that make DeFi so interesting and special. This will hopefully help you understand DeFi better, but it might also aspire new blockchain entrepreneurs to come up with their own ideas.

Yield

yield

Yield is one of the magic DeFi words. Many users are into DeFi simply because of yield. In general, yield is not one mechanism, but it is the core incentive that lubricates the DeFi machine.

Every DeFi mechanism that is being used is based on two things:

  1. A user provides some sort of liquidity.
  2. The user gets back some reward in the form of an interest rate (yield).

Probably, the most famous and yield-centric project is Yearn Finance. Yearn finance uses an automated system to try and allocate your investment in different defi products, trying to maximise return.

Liquidity pools

The liquidity pool is maybe the most important mechanism in the DeFi ecosystem. One of the first protocols to use liquidity pools was Bancor, but the concept gained more attention with the popularization of Uniswap. Some other popular exchanges that use liquidity pools on Ethereum are SushiSwapCurve, and Balancer

The concept of a liquidity pool is an extension of the concept of a market maker. Liquidity pools utilise what is called automated market makers. In a traditional exchange, brokers act as middlemen that handle transactions, allowing the users to trade peer-to-peer. A liquidity pool, instead, uses smart incentives to create a peer-to-contract protocol.

A liquidity pool is like a big pile of money where anyone can invest. When someone creates a new pool they are responsible for providing the initial liquidity. The price is between the pair of tokens is defined through an equation. For example, for two tokens x and y, their price can be defined by the relationship x*y=k.

So, when there is more demand for a token (relative to the other) the price will increase. Arbitragers are free to exploit any inefficiencies of the market, bringing the price back to its fair value.

This is a high level description of the concept of liquidity pools. In practice, there are many implementation details that we need to take into account. For example, impermanent loss is a concept that many people find it difficult to wrap their heads around. This is when the users supplying liquidity into a pool, aiming at a nice return, end up being in situation where they would have made more money if they held the token in their wallet.

Borrowing and lending

Borrowing and lending is probably the most popular DeFi use case. It uses the liquidity pool mechanism described earlier in order to allow users to borrow and lend assets. The number 1 project at the time of writing (in terms of market capitalisation) is Aave which is a borrowing and lending protocol.

One of the benefits of blockchain technology is that it allows the creation of use cases that would not exist in the mainstream financial system. One such use cases is flash loans.

Flash Loans

defi

Aave allows certain loans, called “flash loans,” to be instantly issued and settled. These loans require no upfront collateral and happen almost instantly.

Flash loans take advantage of a feature of all blockchains, which is that transactions are only finalized when a new bundle of transactions (known as a block) is accepted by the network.

Adding each new block takes time. On Bitcoin, that interval is roughly 10 minutes. On Ethereum, it’s 13 seconds. An Aave flash loan therefore takes place in that 13-second period.

The flash loan works like this:

  1. A borrower requests funds from Aave. They must pay back those funds, and a small fee, within the same block.
  2. If the borrower doesn’t do this, the entire transaction is cancelled, and no funds are borrowed
  3. As a result, Aave doesn’t take a risk and neither does the borrower.

This can be used in order to capitalise on trading opportunities within a very short timespan.

Collateralization

Another mechanism that we observe in DeFi is the use of collateral to take certain actions. For example, Synthetix allows users to create new synthetic blockchain-based derivatives by placing a certain amount of tokens as collateral.

In a similar fashion, borrowing-and-lending work through collateralization. A user can be at the risk of liquidation if the value of their collateral drops.

Summary

Decentralised finance is definitely one of the most exciting areas of blockchain. Its value is constantly rising and we are seeing more and more use cases and wider adoption every day. In this article we only exposed some of the mechanisms that are used by DeFi protocols. There are many more, and I hope that this has inspired aspiring blockchain founders to look into this area.

 


Wanna know more about data science? Besides my events, you should check out my webinars:
  1. If you want to learn data science: What it's like to be a data scientist and What’s the best way to become a data scientist
  2. If you are a CEO: The importance of data strategy


Dr. Stylianos Kampakis is the owner and author of The Data Scientist.