THE Q2 2021
An analysis of Ethereum’s decentralized
finance ecosystem in Q2 2021.
ABOUT THIS REPORT
Overview
null
null

In The DeFi Economy Built on Ethereum, we analyze the growth of stablecoins, DeFi assets, and DeFi loans, and the type of transparent data consumers can get when financial services occur on Ethereum.

Decentralized exchanges are also solving the issue of being able to access crypto assets from anywhere in the world as long as you have an internet connection and a wallet like MetaMask. We cover DEX volume, explore the capital efficiency of Uniswap Version 3, and do a deep dive into the anatomy of a token swap.

While much of DeFi today involves a community of power-users that can stomach risk and custodying their own assets, we are increasingly seeing the emergence of new services that manage risk, custody assets, and provide compliance and reporting. In How DeFi is Attracting Institutional Finance, we analyze the new types of companies and services that are enabling institutional inflows of capital into DeFi.

What makes DeFi so alluring is that anyone with an idea can coordinate, pool funds, and even create tokens that represent your share within the organization. Decentralized Autonomous Organizations (DAOs) have grown in Q2 to represent new coordination mechanisms for dealing with financial decisions as a group, for fundraising or deploying capital, which we cover in Down to DAO.

Most of the major DeFi protocols are not only used for borrowing and lending, but are also governed by token holders. We cover the major DeFi governance votes and their significance for generating yield for participants.

In the Scaling DeFi section, we describe the new ways in which Ethereum-compatible scaling solutions are solving current limitations on Ethereum, such as high gas fees and throughput limitations. As new types of Ethereum-compatible Layer 2 protocols and sidechains come to market, so too has DeFi activity begun to migrate to these new networks.
The DeFi Economy Built on Ethereum
As of July 1, 2021, there are now 161 million unique Ethereum addresses, a 10% increase from the end of Q1 2021, and a slight decrease in the 12% growth from the beginning of the year.
By the end of Q2, 2.91 million unique addresses used at least one DeFi protocol, a growth of 65% from Q1. As community driven education, simple user interfaces, appealing yields, and general awareness around DeFi best practices increased throughout the quarter, so too did the number of new addresses, though it must be noted that with wallets like MetaMask, it is easy to make multiple accounts, which means addresses and users are not simply one-to-one. While this is a substantial increase, active DeFi addresses only represent 1.81% of all Ethereum addresses.


Total Ethereum addresses compared to addresses interacting with DeFi protocols. Source: Dune Analytics @rchen8, Etherscan DeFi Protocols include Uniswap, Compound, 1inch, SushiSwap, Balancer, Kyber, MakerDAO, Aave, dYdX, Curve, Tornado Cash, InstaDApp, Yearn, 0x, Bancor, PoolTogether, Synthetix, Ren, Harvest Finance, CREAM, Nexus Mutual, KeeperDAO, Hegic, Alpha Homora.



Ethereum stablecoin issuance. Source: Dune Analytics @danner_eth Stablecoin Issuers include: Tether USDT, USD Circle, True USD, Paxos Standard, Binance USD, HUSD ETH Price Q2 2021 from ethereumprice.org (April 1 to June 30)


Source: ethereumprice.org


Outstanding DeFi Loans. Source: Dune Analytics @hagaetc
Decentralized Exchanges
Decentralized exchanges (DEXs), automated market makers, and token swapping aggregators are technical descriptions of the types of cryptocurrency exchanges that operate without a central authority, allowing users to transact peer-to-peer and maintain control of their funds.
Coinbase, the popular cryptocurrency exchange that went public in Q2, identified decentralized exchanges as one of the key threats to their business in their S-1. It’s no wonder: in Q2 2021, DEXs saw the highest ever volume, with May alone witnessing a whopping $173 billion USD in volume, and Q2 total of $343 billion USD. This surpassed Coinbase’s total trading volume of $335 billion in Q1 2021. This is notable because DEXs enable trading only for EVM-compatible assets, whereas 58% of Coinbase’s trading is Bitcoin.


DEX volume by project. Source: Dune Analytics @hagaetc


Uniswap Trade Volume: V2 vs V3. Source: The Block


Value Locked in Uniswap: V2 vs V3. Source: The Block
The Anatomy of a Token Swap
Token Swaps have become a major part of the DeFi ecosystem: from swap aggregators built into MetaMask to decentralized exchanges and automated market makers Uniswap, SushiSwap, Curve, 1Inch, and many others. We think it is important to give our readers a peek under the hood of the foundational concepts and code that make a swap possible. We are going to look at some code snippets based on the Ethereum Foundation ERC20 Tutorials, OpenZeppelin ERC20 Token Standard and the Uniswap Smart Contracts.
Why is this important? As we have mentioned in other DeFi reports and on the Consensys blog, Ethereum allows for transparency - we can inspect the smart contract code that powers the DEXs and AMMs we interact with and see what those shadowy super coders are doing. The claim of transparency requires a user to have the literacy and tools to actually see what is going on, and our goal is to do that for you here. Providing some literacy around what this code does provides insight into how our decentralized ecosystem works. If you find this section interesting and want to learn more about how to read and write smart contracts, we encourage you to sign up for the Consensys Academy Blockchain Developer Program 2021!
What is a token swap? In this example, we are going to define a token swap as an exchange of fungible token(s) that conform to the ERC-20 token standard. The token or tokens will be moved from one address to another address in exchange for a different ERC-20 token atomically; at the same time. A token swap can occur between two addresses not associated with a smart contract, often serving as a wallet. We refer to these addresses as externally owned addresses (EOAs). A token swap can also occur smart contract addresses, or a combination of EOA and smart contract addresses. An example of such a swap would be Wrapped Bitcoin (WBTC) for DAI. The term swap is also used to apply to an ETH to ERC-20 token exchange, and vice versa. An example of this would be ETH for USDT.
Hover over the code to get a brief explanation of what it does.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
require(numTokens <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(numTokens); balances[receiver] = balances[receiver].add(numTokens);
emit Transfer(msg.sender, receiver, numTokens);
return true;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
require(from != address(0));
_allowed[msg.sender][spender] = numTokens;
emit Approval(msg.sender, spender, numTokens);
return true;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
require(numTokens<= _balances[from]);
require(numTokens <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(numTokens); _balances[to] = _balances[to].add(numTokens);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(numTokens);
emit Transfer(from, to, numTokens);
return true;
}
How DeFi is beginning to attract Institutional Finance
From the data and analysis presented, it’s not hyperbole to claim that the entire financial system is being rebuilt from first principles with more security, transparency, and composability across protocols.
With radical financial innovation and growth comes radical investment returns and opportunity, leading to more and more institutional capital flooding into this space. Just check out our tool Codefi Compare, to see how yields compare with traditional finance. Providing USDC liquidity on the lending protocol Aave currently yields 6.27% APR, yielding 7.22% on average since inception. As protocols chase liquidity, attractive yields like 32.5% for providing sUSD liquidity on Aave are increasingly becoming the norm.

Yields on DAI for various lending protocols. Source: Codefi Compare




null

Down to DAO?
With the continued success of DeFi protocols and services, Decentralized Autonomous Organizations (DAOs) as a means of protocol governance have flourished. These DAOs, which number in the thousands, control sizable treasuries that can be allocated towards various initiatives and new projects.
In fact, more than $6 billion dollars' worth of digital assets are now held in just the top 20 DAOs alone. While well-known DeFi projects such as Compound and Uniswap command the largest DAOs, there are thousands of other projects — from media organizations like Bankless to social token communities like Alex Masmej’s, to public funding entities like Gitcoin — that utilize DAOs to coordinate, govern, and manage their financials. There are now more than 190,000 DAO members across crypto.

There are over 1.1k DAOs using Snapshot for governance. Source: Snapshot
DAO Treasuries

DAOs have been able to flourish largely because of the emerging tooling and development ecosystem that is increasingly providing the necessary functions to support these new organizational structures. Our very own Corbin Page did an excellent job creating an infographic depicting the ecosystem.

null
DeFi Governance in DAOs
Currently, governance drives changes in most of the major DeFi protocols.
Token holders vote on proposals, which range from propositions on how a protocol should allocate its treasury funds to more specific details, like changing a collateral factor for an asset on Compound Finance which determines how much a user can borrow when posting that asset as collateral. Users can clearly see major upcoming changes in DeFi protocols by following the governance updates.






Scaling DeFi
Between April 1st and June 1st, the median gas price fluctuated significantly, from 100 Gwei to 300 Gwei at its peak.
Every DeFi user dreads when gas reaches 300 Gwei, which happened on May 18th as the price of ETH slid and users rushed to interact with DeFi lending protocols to avoid liquidation, where the total gas costs exceed $100 USD. Since June, the median gas fee has been quite low, hovering around 30 Gwei, or $1.33 for a simple transfer and $12.65 for a Uniswap trade. Why the huge disparity?


Median Gas Cost on Ethereum (Source: Dune Analytics @kroeger0x)


Growth of Transactions on Ethereum, BSC, and Polygon through Quarter 2 2021. Sources: Etherscan, BscScan, PolygonScan


Growth of Transactions on Ethereum, BSC, and Polygon in Quarter 2 2021. Sources: Etherscan, BscScan, PolygonScan


Assets locked in Polgon’s Proof of Stake network bridge. Source: Dune Analytics @nascent


Total Value Locked in Optimism. Source: L2 Beat


Total Value Locked in Arbitrum. Source: L2 Beat


Total Value Locked in Aztec, Source: L2 Beat
DeFi Solutions for Institutions and Crypto Enterprises
null
null