Blockchain 101: The Story of DeFi

Blockchain 101: The Story of DeFi

20 Apr 2022

13 mins

SHARE

In every field, the guardians of power and knowledge guard that power and knowledge with specified terminology. When you unlock their terminology, you hold the keys…”

Introduction

Much like the world of Finance; Crypto is filled with a plethora of jargon that can be baffling to the uninitiated. DAO’s, Yield Farming, Stablecoins, Layer 2’s, NFT’s, may all sound like a load of nonsense, but there is some meaning to the madness. The jargon I’m hoping to de-mystify today is DeFi or Decentralised Finance. Of the many Crypto niches that have captured public awareness, DeFi alongside NFTs have cemented themselves beyond a momentary fad to now be considered core foundations of the emerging on-chain world.

What is DeFi? How are these DApp’s or projects decentralising elements of the financial industry and why? In this article, I will seek to provide answers to all the following, whilst at the same time hopefully fuelling some curiosity to dive deeper and explore some of these DApp’s and the wider ecosystem yourself. 

If you have not read any of my previous posts or are entirely new to Crypto I’d recommend first getting to grips with some of the key foundations such as understanding how Smart Contracts and Layer 1 Protocols function. As throughout this article we will build upon those idea-Lego’s to hopefully paint a clear picture of how DeFi works, so if you need a refresher on Ethereum, Smart Contracts and L1s dive in here.

If you’re struggling to keep up with the jargon I’d recommend opening up this Crypto glossary from Gemini in another tab and just flicking over if you find yourself stuck on something. Otherwise, enjoy!

 

Backstory and Ideals

story

DeFi Origins: Defiance

Considering the space is still in its infancy, DeFi has come a long way in just 4 years. DeFi was first conceptualised and coined by key Ethereum devs in a telegram chat back in 2018 while discussing their defiance in attempting to create a permissionless financial system. DeFi being a spin on Defiance, it just worked. It’s no small feat that from such humble beginnings, the total value locked (TVL) throughout DeFi smart contracts reached the heights of $200 billion in November of last year.

So, what actually is it? DeFi or Decentralised Finance is the name for the emergent sector of Blockchain-based finance mechanisms, services and projects that attempt to replicate many of the functions of the traditional financial system but in a permissionless manner. In what sense then is DeFi permissionless?

Well, with DeFi anyone anywhere in the world can borrow, lend, invest, buy and sell in a peer-to-peer manner without the need for traditional intermediaries like banks or brokers, as the security and finality of transactions are guaranteed instead via smart contracts. Transactions are anonymous and trustless, as delivery of assets are guaranteed not by a trusted institution with reputational risk and KYC concerns but by immutable smart contracts on the blockchain. As such Ethereum, as a public utility and settlement protocol, acts as the current backbone and foundation for most DeFi applications and activity.

But what’s the why?

So now the what and the how have been answered in brief;

  1. What — DeFi is an ecosystem of permissionless DApps that allow for the creation of a global financial system without rent-seekers and intermediaries.
  2. How — By leveraging Smart Contract/ L1 Blockchain infrastructure, anyone can stack smart contracts to execute complex action sequences and act as an application capable of automating any logic-based action performed by a human.

What’s the why?

Well, depending on who you ask, there are a few different answers. The old guard of Crypto would argue that DeFi, like Bitcoin, is born out of Libertarian view of finance and social power dynamics. They’d argue that the intentional obfuscation and inaccessibility of the financial system led to the centralization of power and creation of broad systemic risk that continues to bubble along in the background even after 2008. The only way out was through the creation of a new code-based system built on the tamper-proof blockchain immune to the fickle and greedy desires of humans.

Whilst there is definitely truth to this perspective and there is something to be said about the intentional ownership-led design of this new system, I think this narrative may be somewhat misleading or naïve. Ultimately, self-interest is always a primary driver in human action and to view the creation of DeFi as a purely altruistic endeavor unaffected by this is to pull the curtain over your own eyes and others.

The creators of many of these protocols and DApps, the VC’s funding them and many of their early participants are not simply ‘in it for the tech’ but are looking to gain sizably from their contribution. And that's OK, you should be rewarded for contributing meaningfully to the creation of this new permissionless global financial system, but lets not pretend that self-interest is not a driving factor.

Perhaps the initial intentions may have been driven by more noble ideals, yet without incentives and people to act on them DeFi would not be be where it is today. Incentive systems, composability and network effects are the driving force in Crypto; without people acting on them out of self-interest and FOMO there would be no DeFi or Crypto.

The problem of Liquidity

Many of the innovative functions that have emerged out of DeFi and that drive the tail-end of risk takers to these on-chain projects, have come as a direct result of the challenges that arise from attempting to create a financial system on a decentralized and permissionless blockchain.

One of these core issues is the problem of liquidity. When you have a nascent market with new products and you can’t rely on large market makers to make prices and drive liquidity, how can you grow and appreciate the ecosystem’s overall value? Without liquidity in the assets, it becomes increasingly more difficult to enter and close out positions and therefore taking the risk of entering these assets in the first place becomes less attractive. And there we have a chicken and egg problem.

However, understanding that liquidity begets liquidity, builders in the space set about creating several novel mechanisms to incentivise traders and speculators to deposit collateral and drive liquidity to the protocol, which is then spread throughout the wider DeFi ecosystem. We will explore these mechanisms further as we go through the DeFi innovation stacks…

DeFi has emerged and grown to a significant size due both to its ability to create liquid on-chain markets for assets and also because of the composable nature of on-chain projects. Meaning that each project can easily plug-in and connect to the next and where one problem emerges, another protocol can arise to solve said problem and accrue value as a result. With that in mind let’s look at some of the key structures and mechanisms that collectively make up the interconnected world of Decentralised Finance.

 

Defi Innovation stacks

MakerDAO and the birth of Stablecoins

The historical timeline of DeFi and where we are today is a complex web of different projects and functionalities coming online and connecting liquidity. However, the best place to start is with MakerDAO and the genesis of the idea of tokens pegged to the value of USD aka Stablecoins; a key facet to the world of Decentralised Finance.

MakerDAO was initially created in 2014 by an Ethereum developer looking to create the eDollar; the first conceptualisation of what are now known as stablecoins. Stablecoins, alongside Ethereum, are some of the most important features for the success of DeFi, as they allow you to use a token on the blockchain that has a value pegged to that of the US Dollar thereby stabilising it and making it something worth lending and borrowing as its value is far less volatile. Stablecoins allows you to post collateral in a smart contract without having to worry about watching its value plummet whilst in escrow, as could happen with more volatile assets like ETH or BTC, due to the fact its value is pegged to the value of USD.

dai

After many iterations what started as the eDollar is now known as DAI; a decentralised stablecoin issued by MakerDAO. DAI and MakerDAO innovated on centralised stablecoins like Circle’s USDC or Tether’s USDT which claim to back each token with the equivalent amount of capital, AKA dollars or other collateral. DAI on the other hand is user-generated by the Maker protocol via agents depositing digital assets like ETH as collateral into the protocol. Dai maintains its peg to the US Dollar through a number of complex mechanisms such as smart contracts affected by market mechanisms of supply and demand, decentralised price feeds via oracle networks and further monetary parameters as set by Maker governance.

However the key mechanism Maker uses is called a Collateralised Debt Position (CDP). With a CDP, a user deposits their asset like ETH of wBTC into a smart contract (on the Maker protocol) as collateral for a loan. Once the CDP holds the users deposited assets, the user is then able to generate the equivalent USD value in Dai that they wish to borrow. This is important as MakerDAO and its CDP not only led to the creation of the first decentralised stablecoin, but also it was the first effective on-chain loaning mechanism…

Borrowing and Lending Protocols

The real breakthrough period for this specific niche of the blockchain world came in the ‘DeFi Summer’ of 2020. DeFi summer was the pivotal momentum shift for DeFi, as it was when projects begun to deploy in-built incentive mechanisms into their design, driving retail traders, speculators and early institutions to deposit their fiat in DeFi borrowing and lending protocols in order to access the significant yield opportunities that were beginning to emerge.

Protocols like Compound and Aave begun innovating further on Maker’s CDP mechanism by offering a greater array of tokens alongside an innovative incentive mechanisms which has come to be known as liquidity mining. Compound first, drove users to lend their digital assets to the protocol by offering high yields on their deposits as well as using the native COMP token itself as an incentive mechanism; rewarding both borrowers and lenders with emissions of COMP tokens. Once you have deposited your collateral (ETH, DAI, wBTC, etc.) into the smart contract controlled liquidity pool, you start earning interest on your assets instantaneously as well as COMP tokens as an added sweetener.

DeFi protocols across the spectrum began to offer increasingly high yield offerings to drive further deposits, leading to many calling out the system as a Ponzi. Accordingly, its probably worth briefly outlining how these protocols were able to offer such attractive yield opportunities in the first place. Following on from Julian Koh’s (Ribbon Finance) brilliant explanation of where yield comes from. Koh posits that there are 4 core means in which protocols are able to offer yield:

  1. Natural demand for Borrowing — There exists a natural demand to borrow cash or assets across markets for individuals, business’ and banks. Whether to purchase goods, finance activities, long or short the asset or offer the ability to leverage trade; DeFi a sector offers the ability to do so on the transparent and immutable technology of Blockchain.
  2. Markets for Risk exchange — Much like in TradFi, there exists an on-chain market for exchanging risks with another individual and receiving yield as a result, via products like options or risk tranches that allow for individuals and institutions with different risk profiles to exchange risk in a seamless manner in return for yield.
  3. Providing a service — Borrowing and lending protocols acts as a service for other key protocols such as Decentralised Exchanges by providing liquidity to fill trades via their own liquidity pools (i.e. ETH-AAVE liquidity pool providing flow to Sushiswap). More on this later…
  4. Equity Growth — As demand continues to grow for these services the value of equity or token ownership in these protocols too increases. However this yield-generation is often short-lived and continued token emissions without growth in demand for the token can often lead to the opposite effect.

Now that's been cleared up, back to the matter at hand. Protocols then doubled down on their incentive models beyond offering high yields by offering deposit/receipt tokens such as cETH to individuals that have loaned their ETH to the protocol. Thereby allowing people to receive yield on their loaned collateral whilst at the same time remaining liquid, as they can use the cETH as a primitive on various other protocols. Meaning I can take my cETH to another liquidity pool or yield farm and earn further yield on these yield-bearing receipt tokens; offering the chance to create a positive feedback loop on your digital assets.

 

lend

This mechanism unlocked tremendous value for those who are long a certain asset like ETH and not looking to sell, as now they can receive a yield on their asset by lending it out, but at the same time can unlock that liquidity via the yield-bearing receipt tokens, which they can plug into another protocol for further yield, or swap for another token they’re looking to speculate on or go flip some NFT’s… The world is your oyster.

This ability to simultaneously gain yield and remain liquid had the desired effect in driving cash to these on-chain money markets, leading to native tokens and protocols taking on a value of their own in the secondary market and driving a boom in pricing due to the high number of active users and Total-value-locked (TVL).

Decentralized Exchanges and AMMs

The proliferation and success of DeFi borrowing and lending and the actual usage of stablecoins and other DeFi-specific tokens also depends upon another key facet of the ecosystem, Decentralised Exchanges.

Decentralised Exchanges or DEXs came about in response to the power centralised exchanges garnered in being human-led, run and owned intermediaries and on-ramps to the decentralised on-chain world. Centralised exchanges can track users’ activity, store and trade on their assets and in doing so they become a centralised point of failure and pressure point that hackers can exploit if vulnerabilities are found in the exchange’s security.

In response to this, some developers sought to create an alternative solution that remained true to the original vision and purpose of blockchain and so, set about creating an exchange not reliant on humans, but smart contracts. By stacking smart contracts and building on the liquidity mining mechanisms created by borrowing and lending protocols, developers were able to create Decentralised Exchanges not owned or run by any company.

Instead, the exchanges themselves are owned by native token holders and exchanges of assets/goods are managed in an automated manner via a chain of smart contracts. Rather than relying on flow from buyers and sellers, this method keep trades on decentralized exchanges liquid 24/7 by using liquidity pools.

Getting technical for a minute…

The process uses an automated market maker (AMM) that on request for trade triggers a complex exchange mechanism known as an ‘atomic swap’; instantly swapping and settling one asset for another. The swapped assets being taken from token pair liquidity pools like USDT-UNI or ETH-USDC, which always retain an equal ratio of each asset by incentivizing individuals to provide liquidity and deposit their tokens in return for yield on their deposited assets. The pool is kept at a constant balance between assets using the formula X (token A balance)* Y (token B balance) = k (constant). The pool stays in constant balance, where the total value of ETH in the pool will always equal the total value of BTC in the pool by offering an arbitrage opportunity for traders to take advantage of the price differences between the AMM and outside crypto exchanges until it is balanced once again.

dex

The first DEX protocol of this kind and still the largest by volume is Uniswap that sits on Ethereum; a DEX that allows anyone to swap tokens that exist on the Ethereum network (ERC-20). DEXs like Uniswap offer another essential function that can be tacked onto the burgeoning on-chain system; allowing you to take your COMP tokens that you received as a reward for providing liquidity in the protocol and swap them over for an asset you’re looking to speculate on. All of this can be done without the use of rent-seeking intermediaries and instead by owning UNI, Uniswaps native token, the fees from assets exchanged on the protocol are accrued to you also. What’s not to like?

Well, whilst DEX’s seek to solve many of the problems of their centralised counterparts such as human error/ mismanagement, hacking potential and more, they do come with other trade-off’s... Like many of DeFi protocols and applications, despite the existence of deep liquidity pools for consolidated ‘blue-chip’ assets there is still limited liquidity for less well-established assets, meaning that settlement of trades can end up being lengthy and fees to the DEX as well as the settlement/smart contract protocol (Ethereum) can be extremely high.

 

So, what’s next?

Since the first DeFi summer and the proliferation of various borrowing and lending protocols and DEX’s across different chains, DeFi has iterated and innovated even further upon many key roles and products of the TradFi world. A new wave of DeFi primitives' in search of more sustainable yields not reliant on token emissions has led to the formation of a number of protocols that make up the new vanguard: DeFi 2.0. It started with Olympus DAO and protocol owned liquidity and has developed further with more complex on-chain derivative contracts and yield vaults.

In this new epoch of DeFi, developers and protocols are going beyond replicating traditional models with decentralized tweaks, instead building on the TradFi structures to create zero to one innovations in products that offer tremendous opportunity for growth. From Perpetual futures contracts to options vaults to algorithmically-pegged stablecoins. All that and more to be covered next!

 

Oliver Wink.