Composability in DeFi
Trading billions of dollars a day in volume and with over a hundred billion in total value locked, decentralized finance has grown exponentially over the last few years. New innovations, competitive fees and high returns make entering the DeFi space increasingly attractive for the everyday investor. But what has enabled decentralized finance to become this big? In this article, we’ll explore composability in DeFi applications, consider some of its pros and cons, as well as discuss how money Legos could help you in your DeFi journey.
What is Composability?
In short, composability refers to the ability for individual apps to be combined in various ways to become larger structures, or for one app’s output to be another’s input. Due to this “stackable'' nature, DeFi apps are often also called “money legos”, which is a great way to visualize them. New apps can be built on top of pre-existing ones, or incorporated with others to create something entirely new.
Take an example from recent news: the Curve wars. A user can swap $DAI for $CRV on Uniswap. With these $CRV tokens, they can either lock them for four years on Curve Finance for veCRV - or stake them on Convex Finance in exchange for cvxCRV, which rewards the same returns as veCRV plus CVX governance tokens. This is possible due to the composability of Ethereum network dApps through the ERC20 standard. Protocols can build their dApps based on these standards, which allows tokens to be easily transferable on the same blockchain without ever leaving the system. Without composability, you might buy $CRV on Curve Finance, but then you would be stuck using those tokens on dApps on the Curve protocol, without the option to earn boosted rewards using the liquid version in cvxCRV.
Now that we’ve established what composability is, let’s dive into some of the pros and cons that composability brings to DeFi -
Pros
Scalability
At the time of writing, Ethereum and its L2 solutions are by far the most popular smart contract ecosystem in terms of number of dApps (2929 on ETH, 7000+ on Polygon / 3957 total), total value locked ($109.14B on ETH / $198.07B total) and market cap ($318B). As one of the first smart contract platforms, Ethereum had developers working on dApps early on, helping to scale and attract users. Scalability is a virtuous cycle in a way - blockchains with more dApps appeal to more users, and the more users there are, the more developers flock to build on that network, further capturing more users. Additionally, as the number of composable pieces increase, the variety of services become more than a sum of its parts - as money legos can be stacked without any limits. Not only are there more services on the network, but also the tokens themselves will appreciate in value with adoption.
Innovation
The open-source nature of web3 allows developers to integrate code done by other devs. Instead of building from scratch, developers work on their specific original idea that builds on an existing protocol. New dApps can even link two existing protocols, adding value by providing an easy-to-use interface and simplifying an experience for the end user. Innovation is pushed forward at all stages of software development, and any new app creates an opportunity for someone else to build off of.
Advantages over Traditional Finance
Bitcoin aside, some of the largest blockchains by market cap are Layer 1 and Layer 2 smart contract platforms. Ethereum, Terra, and Polygon among others are growing fast because they allow for the deployment of smart contracts. Smart contracts have given rise to a whole new world of financial services - allowing for token minting, yield farming and many more. Yet, with composability, these services can not only be executed individually, but also as combinations. This leads to innovations that were not possible in traditional finance.
An example of one of these new ideas are flash loans. Protocols like Aave allow users to borrow with no collateral, as long as the loan is paid back within the same block. If you spot an arbitrage opportunity, you can take advantage of a flash loan to flip a quick profit for a small fee. This is made possible by a specific type of composability called atomic composability, which allows operations across multiple dApps to be bundled as one transaction and executed at the same time. Flash loans are also safe for all parties because the transaction is executed as one - it either happens or doesn’t at all. As the DeFi sphere grows, novel ideas like flash loans that were previously impossible can be invented, creating one-of-a-kind financial opportunities.
Cross chain bridges are another example of new innovations. This enters the realm of interoperability, but bridges allow different blockchains to communicate with each other. For instance, the Polygon Bridge allows ERC tokens to move from the Ethereum network to Polygon’s network. Doing this grants users the ability to capitalize on lower gas fees compared to Ethereum and a number of dApps unique to Polygon. Cross chain composability makes blockchains compatible with each other, simplifying the transfer of assets between networks.
Cons
Blockchain and Smart Contract Risks
Any problems with the blockchain platform itself (i.e. Ethereum) will translate directly onto its protocols. High gas fees and slow network times are disruptive for users and drive down liquidity. Since smart contracts are executed on the base layer, any attacks aimed at the blockchain itself will also affect all protocols on the network. Faced with unexpected circumstances, smart contracts can also fail and be exploited. Hackers who find vulnerabilities and bugs in the contract can abuse its logic to steal funds or control governance. Attacks like theDAO hack happen when newer code is published and not properly audited. Open-source code somewhat combats this as the developer community works to fix these issues as soon as possible.
Contagion
With composability, vulnerabilities in the smart contract of one protocol will not only affect the protocol in question, but possibly all others in the stack. The ability to combine protocols increases the number of operations that developers did not expect and did not have to test for, thus creating potential bugs in the program.
User-Based Risks
Lastly, there are user-based risks. Due to the DeFi’s complexity and composability, risks from multiple protocols can be compounded, which makes it especially important for the user to fully understand each dApp that they interact with. There can be significant consequences to mistakes in DeFi, so please remember to do your own research (DYOR) for any DeFi apps that you invest your money into.
A Note on DeFi Returns
Inflation rates in the United States are at their highest since the 1980s, and keeping your money in savings accounts yielding sub-1% APY only means you are losing purchasing power over time. Meanwhile, crypto protocols such as Anchor and Abracadabra’s Degenbox offer nearly 20% APY on stablecoins. Comparable returns on investment in traditional finance have generally been limited to the super rich in the form of hedge funds and private equity funds, which is both expensive and laborious. Owing to the scalability and efficiency of building dApps, composability is a type of magic that makes your money work harder for you. With APYs ranging from single digit large-cap coins all the way to triple digit percentages for some smaller tokens (proceed with caution), decentralized finance is an accessible alternative to high finance that offers a spectrum of ways to earn “passive” income.
Conclusion
Decentralized finance is growing at a rapid pace, and with such a vast assortment of dApps out and more to come, it’s important to recognize what DeFi composability has done to help grow the crypto ecosystem. Thanks to structural efficiency and doors open to never-seen-before innovation, new dApps will continue to be released and help scale blockchain networks using composability. While composability has its risks, open-source code and a strong understanding of protocols should be sufficient to tackle these issues. That being said, I’m excited to see what the future holds in DeFi. Are you?
Author is a Decentralized Finance (DeFi) intern at Polygon, highly interested in Tokenomics, Web3, and blockchain applicability in the real world. They’re a student at New York University – College of Arts and Sciences, studying Economics and Data Science. Other interests include golf, anime and poker. Feel free to reach out on Twitter @charlesgnuhc.