Decentralized Finance Primer

By 23-Nov-2020No Comments

Decentralized Finance Primer

By Daniel Dal Bello, Director.

November 23, 2020 – 7 min read.

One of the growing narratives throughout 2020 has been the emergence and potential of the decentralized finance (‘DeFi’) ecosystem.

The generally open-source ethos of DeFi has driven a frenzy of new product releases over the past few months – the pace of innovation has been difficult to keep up with. We are optimistic about the future of a niche that democratizes financial products. However, despite the overwhelming growth, several critical issues still remain including gas fees, on-chain congestion, user experience, and insurance.

In this post, we present our version of a decentralized finance primer.

When Satoshi Nakamoto released Bitcoin’s whitepaper just over 12 years ago, little would they have imagined it would set into motion the creation of an industry worth over $500 billion in market capitalization. Bitcoin’s ability to be a sovereign currency has remained unrivalled over the past decade as evidenced by Iran’s moves toward using the currency to evade sanctions[1].

But the means to create programmable assets that can scale meaningfully has remained elusive on the Bitcoin blockchain. Ventures like BTCJam, once focused on banking applications such as lending and remittances had to shut down due to this limitation.

Ethereum coming of prominence in 2017 changed the industry for good. The ability to create scalable financial applications had been democratized. Anyone with access to the internet and the ability to write code could now create custom token economies. This is what birthed the ICO mania of 2017 that lead to over US $8 billion in raises.

As focus shifted from a single monetary system that could solely store value to token economies that failed to capture them through ICOs, developers explored means to recreate the gaps Bitcoin was trying to solve in 2013. Token instruments being used for trade were prominent as early as 2013 with the launch of Mastercoin on Bitcoin’s sidechain. It was however restricted to Bitcoin’s blockchain and had little audience for it. With the influx of users that came during the bull market of 2017, a captive user base for financial applications came to being.

The early wave of DeFi applications like Compound, Synthetix and Uniswap were specifically focused on these users.

By the Numbers

Understanding DeFi
DeFi refers to the use of smart contracts to automate financial functions that typically require centralized custody. This allows cost efficiency for each individual transaction involving a loan or exchange while reducing the risk of a central party being hacked.

More importantly, it makes exponentially scalable ventures possible with a handful of the resources a centralized alternative would take.

Uniswap – an automated token exchange uses a fraction of the resources its centralized counterparts like Binance does and yet manages to do more in volume. Decentralized Finance is close in ethos to what is typically referred to as “open-finance” in traditional fintech circles. This is because much like open-finance, DeFi focuses on the free-flow of capital between products to scale.

Where open-finance relies on APIs, DeFi relies on smart contract calls and oracles such as Chainlink for logic-checking individual transactions. There are a number of feature subsets that enable DeFi to do what is not possible in fintech today.

Below we look at some of these in further detail.

1. Automated Market-making
Automated market-making refers to the use of smart contracts for price discovery without human intervention. Individuals park tokens they wish to enable trades for in a smart contract and allow people to add tokens or remove them on basis of market supply and demand.

In this case, a standard equation of k=x*y is used for price. K is typically kept as a constant, where x is the supply of the asset given and y is the price of the asset over time.

Since K is maintained as a constant in these liquidity pools (explained further below), the variations in supply of x (amount of tokens given) changes the price.

If there is more of an asset in the pool, the price of the asset decreases. Similarly, if market demand for the asset is high and a great amount of individuals look to buy the token, then the amount of tokens in the pool reduce, thereby increasing price.

This is the basis on which automated market-makers like Curve, Balancer, and Compound work.

2. Liquidity Pools
If a smart contract can be understood as a vault with logic enabled in it, liquidity pools are the capital deposits that go into them.

Liquidity pools allow developers to crowd-source capital to do economic activities such as exchanging or lending. Audited, open-source smart contracts can transparently show what the pooled capital is used for and is thereby often far more transparent than traditional banking applications. More importantly, it allows the market to determine which functions generate the most fees and thereby allocate capital to it.

The incentive average individuals have for parking money in these pools is what is referred to as yield. This is the monetary reward they get for allocating money into smart contracts. The activity of switching between liquidity ‘farms’ in search of the highest yield is called yield farming.

3. Yield Farming
Smart contracts allow developers to source money from anywhere in the world without restrictions so long as they are tokens. In order to incentivize people for parking money with their projects, token-based rewards are given. As the price of the token fluctuates, the reward received becomes a variable.

Where banks rely on interest rates as a fee model for sourcing capital, yield farming uses governance-based tokens. Individuals have an incentive to accumulate these tokens to have a say in the governance of the platform through voting. Alternatively, if they wish to simply exit the project, they could sell the token through an automated market-maker.

“Where banks rely on interest rates as a fee model for sourcing capital, yield farming uses governance-based tokens.”

Yield farming reduces the cost of capital for ventures to a fraction of what they historically used to be. For users, they give a multiple on the interest rate retail banking typically offers.

Impermanent Loss
This is the difference in return an individual would make if they had simply held on to an asset instead of moving it to a liquidity pool. Given that automated market-makers work on a constant equation k=x*y (as explained in the automated market-maker section), a sudden move in the price of the asset can result in either the pool having a lower amount of the initial asset provided or the asset’s price declining substantially.

The difference in return an individual would make if they had simply held on to an asset instead of moving it to a liquidity pool.

This loss can be greater than the interest rates generated from the DeFi project the individual has provided liquidity to. This concept of impermanent loss is one of the largest risks associated with providing liquidity to DeFi protocols today.

Why DeFi Is Not Yet Mainstream
Even after growing to over US $14 billion in value locked, DeFi has struggled to reach the masses. Unless the market itself grows, an increasing number of developers will be competing with one another for a slice of a pie that is not expanding exponentially.

Part of the challenge is operational in that regional regulators stifle the ability of developers to directly onboard potential users. The other is that user experience is sub-optimal given the costs involved with each transfer and the likelihood of a hack.

We explore some of these challenges in depth below.

1. Costs associated with transfers
Gas is a measure of fees used to pay for enabling transactions on Ethereum’s network. Since most prominent DeFi projects are built on Ethereum, gas costs tend to surge once multiple or even single projects begin to see scale.

The network effects of Ethereum means a single venture seeing scale could clog the entire network.

This occurred in 2017 when CryptoKitties began seeing some meaningful adoption. A similar dynamic played out in 2020 as DeFi ventures began seeing some form of product-market fit. During that time users had to spend anywhere between $4 to $20 on each transaction related to smart contracts. This made the whole process of engaging with DeFi not feasible due to the unit economics involved.

In turn, whales began dominating the networks as the fees involved in transfers were a fraction of what they would earn.

2. Network Clogging
It is pertinent that individuals are able to transfer money to DeFi-related projects to be able to provide additional collateral or trade assets in a meaningful amount of time. It is not rare to witness individuals lose massive amounts of capital through margin trades or lending-based products simply because they could not provide the necessary collateral in a sufficient period of time.

In March 2020, this led to the loss of millions of dollars for those using MakerDAO[2]. Ethereum is now beginning to solve this through layer-2 solutions such as zk-SNARKs and Rollups. The challenge here is that apps lose their ability to interact with one another (referred to as composability) once individual projects use their own scaling solutions. Which in turn fragments liquidity and ultimately makes it difficult for DeFi ventures to scale.

3. Front-running and collusion
While the radical transparency of open, permissionless and public blockchains make it easy to account for transactions, it also comes with its challenges. One of the reasons why DeFi does not scale in its current form is that strategies can be detected and counter-run by other parties.

Due to the fee-based nature of Ethereum throughput, there is a difference in transaction speed due to the gas cost paid. This makes it possible for third parties to pay a higher fee and front-run any individual transaction.

Front-running in this context means buying or selling an asset faster than a third party in anticipation of price movements due to their activity on-chain. Institutional interest in DeFi is unlikely to happen at scale until privacy for strategies being used and positions taken is made possible.

4. Smart contract auditing and insurance
Although anyone can set up a smart contract and launch a DeFi venture today, however acquiring an audit by security experts cost a lot. The early nature of the industry means best practices are not yet established. This in turn creates barriers to entry for new developers looking to enter the industry.

More importantly, for institutions that are committed to scaling capital deployed in DeFi, there are little to no insurance underwriters. Being able to assess the risk involved with smart contracts requires heavy technical and financial expertise. It is unlikely that the industry grows substantially until there are convincing reasons to think capital deployed in smart contracts won’t be hacked. While alternatives like Polkadot and side-chains on Bitcoin are possible, they have struggled to see meaningful scale.

Although Ethereum dominates the market today, it is unlikely to be the only solution in the industry going forward. One of the likely routes the industry could take in the future is that of teams creating custom solutions for market-makers and hedge funds.

For example, FTX exchange launched Solana-based Serum to help with fee and scaling challenges linked to Ethereum-based DeFi. Similarly there have been moves to establish on-ramps for institutions to enter DeFi.

Depending on the use case, target audience and unit economics of ventures involved, it is likely that we see multiple DeFi-focused ventures come into being.

Today DeFi remains in its relative infancy when comparison to the blockchain industry at large and while there are clear challenges present many new projects and protocols are working to address and surmount these issues. DeFi is an exciting niche of this industry that is here to stay.

[1] T Erdbrink, ‘How Bitcoin Could Help Iran Undermine U.S. Sanctions‘, The New York Times, Tehran, The New York Times, 2019.

[2] MakerDAO, ‘ The Market Collapse of March 12-13, 2020: How It Impacted MakerDAO‘, MakerDAO, 2020.