Thanks to the open-source ethos surrounding blockchain networks, many smart contracts are able to interact with each other in a permissionless manner. ‘Permissionless’ refers to the fact that once a smart contract is created, its author does not generally retain control over who can interact with it, or how it is used. This offers developers the freedom to build on each other’s achievements and create ever more sophisticated products for DeFi users.
Anyone can write a smart contract and publish it to the blockchain. Once hosted, others are free to interact with the contract in any way that its code allows. For users, this is typically done via Dapps, front-end websites which provide a UI for the underlying contracts.
Developers, however, can write code that interacts directly with another contract, incorporating its functionality into their own projects in whatever way they see fit.
Most contracts are open-source and the code can be viewed via a block explorer. This allows other developers to combine elements of existing protocols with new ideas, or bundle together actions from different projects into a single transaction. As well as boosting the speed of innovation, standards are established, creating more secure systems that are based on reliable, battle-tested code.
The composability of smart contracts has led to the idea that many DeFi protocols act as “money legos” which can be put together in different ways. For example, a user who deposits stablecoins into a liquidity pool on Curve, can take their Curve LP tokens and deposit them into a strategy on Stake DAO, then, they can use the strategy deposit token as collateral for a loan, etc.
The above can be done manually, or via Dapps which combine a series of actions for execution in a single transaction. Combining DeFi products in this way can be referred to as “stacking”, and can lead to higher yields. However, with more complexity comes greater risk, too, as each protocol comes with its own security concerns — if one of the projects is hacked, funds on another platform may be lost.
While the idea of composability is a great way for DAOs to work together, the cooperation may be an active or passive relationship, since the use of the smart contracts is not dependent on being granted permission.
Although composability is usually of net benefit for all involved, misaligned interests can cause problems. For example, a protocol which receives its revenue in another project’s token and goes on to sell large quantities on the open market has a negative impact on the price of that token.In contrast to this, Stake DAO has developed a series of Liquid Lockers which work symbiotically with the underlying protocols through the power of vote-escrowed Tokens. In this model, depositors maximise yields and maintain governance rights via a liquid version of the underlying veToken.