The Hitchhiker’s Guide to DeFi (Part I) — Lending Protocols & Superfluid Collateral

Rahul Rai
9 min readSep 29, 2020

What is Decentralized Finance (DeFi)? Here’s how I’d describe it — it’s like building a plane as you fly, but the plane is actually the entire financial services industry, and it’s filled with a bunch of geeks that have never studied how to build a plane, AND these geeks also happened to bring along billions of dollars which they could lose if the plane crashes.

That’s basically all you need to know. But if that explanation wasn’t eloquent enough for your liking, here’s how the folks over at Multicoin Capital describe DeFi and its disruptive potential:

By making all units of value — stocks, bonds, real estate, currencies, and so forth — interoperable, programmable, and composable on distributed ledgers, capital markets will become more efficient and accessible to everyone on the planet. Just as the proliferation of capital markets over the last 100 years supportedstaggering levels of wealth creation, the permissionless, expansionary effect of open finance will pave the way for new services and applications that will deliver tremendous value.

So DeFi is essentially trying to take the existing financial services ecosystem, break it down to its fundamental parts, and then reconstruct a more elegant, secure and open version of it on the blockchain. No big deal. DeFi took off on the Ethereum blockchain primarily because of Ethereum’s high level of Composability — the ability to coordinate different parts of a modular & stateless software stack. Composability allows different smart contracts to interact with each other to produce complex financial structures, creating a network of interlinked protocols, or “Money LEGOs.”

Source: Consensys
Source: Consensys

The two buckets of protocols, that have amassed a bulk of the capital that has flown into DeFi, along with their most popular platform implementations, are:

i) Lending/ Borrowing Protocols — MakerDAO, Compound, Aave, dYdX

ii) Decentralized Exchanges (DEXs) — Uniswap, Balancer, Curve

In this post, we will primarily focus on lending/ borrowing protocols. DEXS and other protocols (asset managers, aggregators, derivs etc.) will be covered in future posts.

Growth of the DeFi Ecosystem

Global Macro Backdrop

DeFi has taken the crypto and blockchain world by storm. Billions of dollars have been locked up in lending & exchange protocols, and the yields that DeFi can offer are especially attractive given the low interest rate environment that we’re currently in. With central banks injecting massive liquidity through unprecedented levels of quantitative easing (as well as coordinated fiscal stimulus by governments across the globe), crypto and DeFi have never been more appealing to yield seeking investors.

Total Value Locked (TVL)
There is currently $8.6B of total value locked up in DeFi protocols. While this is a relatively modest amount relative to the amount of capital flowing through the traditional financial platforms, the rapid growth in TVL is a testament to the widespread adoption of DeFi by the broader crypto community.

Source: DeFi Pulse

DeFi Users Data
There are currently over 450,000 unique addresses that have interacted with an Ethereum DeFi protocol. The number of users across DeFi protocols remained fairly consistent up through Q1 2020, and then spiked up exponentially mid-June due to the release of the Compound governance token (COMP), with Balancer (BAL), Curve (CRV) and other top platforms following suit.

Source: Dune Analytics

Lending Protocols

Credit is the cornerstone of every financial ecosystem. It enables non-zero-sum wealth creation by allowing individuals with surplus assets to lend them to borrowers, who have a productive or investment use for those assets.

The traditional financial services industry relies on counter-party trust + legally binding contracts to determine default risk and enforce creditworthiness. But how do you translate this on to the blockchain, which can be accessed pseudonymously and lacks a centralized judicial system? Two words — overcollateralization & liquidation.

Instead of relying on their trust in borrowers, suppliers rely on overcollateralization and liquidation to ensure that they can withdraw their assets at any time. Borrowers always have to supply more value in collateral than they can borrow, and suppliers can always seize that collateral through a free and open market for liquidation. These mechanics work exactly the same way regardless of the borrowers’ creditworthiness. In other words, overcollateralization and liquidation are intended to almost completely eliminate default risk.

Source: Helis Network

A simple example — say the lending protocol has a 1.5x overcollateraliztion ratio and a 1.25 liquidation level. That means that if I deposit $150 worth of ETH as collateral, I can then borrow $100 worth of DAI stablecoin (or any other asset), which I will have to repay with accrued interest. If the value of my ETH collateral ever falls below $125, it will be automatically be liquidated to pay back the lenders in full ($100 + accrued interest worth of DAI).

The first lending protocol was the MakerDAO project, which in Dec 2017 launched the Dai Stablecoin System, a decentralized, unbiased, collateral-backed cryptocurrency soft-pegged to the US Dollar through unique smart contracts known as Collateralized Debt Positions (CDPs).

Source: Blockspace

Following MakerDAO, a number of other lending platforms came up that used similar collateralization and liquidation protocols. The rest of the DeFi ecosystem also began to take shape, with some of the early DEXs/ AMMs, insurance, and asset management platforms launching throughout the late 2018 — mid 2019 period.

Source: DeFi.WTF

Superfluid Collateral

Are these overcollateralized lending protocols risk-free for lenders? Almost. Taking the example from above, the main risk for lenders is that the ETH collateral might gap from $125 to say $90 before they had time to liquidate it. This “gap risk” however is very low, especially when using relatively stable, liquid assets with high overcollaterzliation and liquidation ratios. Hence, for argument’s sake, we can assume that the lending yield is “risk-free”, i.e there is no default or credit risk. However, there still exist the standard liquidity, smart contract, and protocol administration risks inherent in any blockchain protocol.

This leads to two profound realizations. First, any crypto asset A_i can be lent out to earn a risk-free interest. In return, the lender will receive an asset that represents a claim on the underlying asset A_i, as well as all of the risk-free lending interest that it accrues. Let’s call the asset, or token, that represents this claim cA_i. Now cA_i itself is an asset that can be borrowed, lent, traded, swapped etc. As it can always be exchanged for the underlying asset A_i (+ accrued interest), its value is always greater than the A_i and will continue to increase steadily over time as interest accrues.

Hence, every asset A_i, has a risk-free yield earning counterpart cA_i that’s wrapped in a lending protocol. It almost always makes sense to own the wrapped coin, as it is always worth more than the underlying coin and bears (almost) no additional risk. The beauty of wrapped coins is that it creates a financial universe where every single asset can, and should, be earning a risk-free yield.

Source: Superfluid ETH

The second profound realization is that cA_i itself is an asset, and so it can be used as collateral to borrow another asset, say B_i, which can then be further lent out and so on. Hence collateral can be lent out, and that lent out collateral can replace the original collateral. And so on. Till infinity? Sure, as long as there are no transaction/ gas fees. We’ll explore this further in the next section.

A great example of a protocol that leverages this beautifully is Compound. The Compound protocol aggregates the supply of each user; when a user supplies an asset, it becomes a fungible resource. Suppliers are issued cTokens that represent a claim on the underlying asset, along with the accrued interest. In this way, earning interest is as simple as holding a ERC-20 cToken, whose value relative to the underlying token constantly increases over time.

The cToken exchange rate can be almost viewed as the NAV per share for the liquidity pool. So when depositing $1 USDC for example, you will receive 1/exchangeRate_c amount of cTokens.

Source: Kalinoff’s Blog

In addition, Compound allows users to frictionlessly borrow from the protocol, using cTokens as collateral, for use anywhere in the Ethereum ecosystem. Supplied collateral assets earn interest while in the protocol, but users cannot redeem or transfer collateral while it is securing an open borrowing position.

If the value of an account’s borrowing outstanding exceeds their borrowing capacity, a portion of the outstanding borrowing may be repaid in exchange for the user’s cToken collateral, at the current market price minus a liquidation discount; this incentivizes an ecosystem of arbitrageurs to quickly step in to reduce the borrower’s exposure, and eliminate the protocol’s risk.

Overall, the Compound protocol can be represented by the following equations:

Single-Asset Recursive Money Market Model

Let’s assume that I’m a crypto investor that owns w_{DAI} DAI, i.e all of my wealth is currently held in DAI.

I can leverage money-market platforms, like Compound, to borrow (w_{DAI})/c more DAI, where c is the collateralization ratio (usually 1.5x). I can continue to do this recursively to infinity, by lending out the borrowed DAI and using that as collateral to borrow more DAI and so on (ignoring transaction costs and gas fees).

Here’s how my balance sheet will look as a result of this:

Where l_DAI and b_DAI are the respective lending and borrowing rates that can be obtained on the DAI, and assuming that l_DAI > b_DAI.

The expected wealth and returns from this strategy can be represented as:

If c = 1.5, we can simplify this infinite GP series to:

Hence, the money market protocol enables crypto traders to leverage their positions by 3x, through recursive borrowing & lending.

Summary

  1. Wrapped tokens are risk-free claims on an underlying coin/ asset and are steadily increasing in value, relative to the underlying asset, due to accrued interest.
  2. These wrapped tokens are themselves assets that can be used as collateral on lending protocols. Hence, risk-free yield can be earned on assets locked up as collateral.
  3. Recursive lending and borrowing enable crypto traders and investors to obtain leverage and to generate additional yield on their assets.
Source: Chainlink

Sources:
Aquaponic Yield Farming: https://bankless.substack.com/p/aquaponic-yield-farming
Compound Whitepaper: https://compound.finance/documents/Compound.Whitepaper.pdf

--

--