DeFi Basics
What Is a DeFi Protocol?
Learn what a DeFi protocol is, how decentralized finance protocols work, the different types of DeFi protocols, and how they are governed by their communities.
Discover what composability means in DeFi, why decentralized protocols are called money legos, how composability enables innovation, and what risks come with highly interconnected financial systems.
Composability is one of the most powerful concepts in decentralized finance, and it is the reason DeFi has been able to innovate at a pace that traditional finance cannot match. At its core, composability means that different DeFi protocols can interact with each other seamlessly, like building blocks that snap together to create something greater than the sum of their parts.
In traditional finance, integrating two financial systems is a massive undertaking. Banks, brokerages, and insurance companies spend millions of dollars and months of development time building custom integrations. In DeFi, a new protocol can plug into existing ones on day one because everything runs on open, permissionless smart contracts with standardized interfaces.
This is why the DeFi community has adopted a playful but accurate metaphor: money legos.
Imagine a box of LEGO bricks. Each brick is a self-contained unit with a standardized connection system. You can combine any brick with any other brick to create whatever you want, without asking the manufacturer for permission or signing a licensing agreement. The bricks just work together.
DeFi protocols function the same way. A lending protocol like Aave is one brick. A decentralized exchange like Uniswap is another brick. A yield aggregator like Yearn is yet another. Each protocol performs a specific function, and because they all run on the same blockchain with the same token standards, they can be combined freely.
The real magic happens when you start stacking these bricks. Consider this sequence:
Each step involves a different protocol, but they all work together seamlessly. This entire chain of financial operations can even be executed in a single transaction using smart contract composability.
Platforms like Borrow by Sats Terminal leverage composability by aggregating across multiple lending protocols, letting users compare rates and find the best terms for Bitcoin-backed loans without manually checking each protocol individually.
The foundation of composability is that DeFi smart contracts are open source and deployed on public blockchains. Anyone can read the code, understand how a protocol works, and build on top of it. There are no proprietary APIs locked behind corporate walls.
When a developer wants to build a new lending aggregator, they do not need to negotiate with Aave, Compound, or Morpho for access. They simply interact with the publicly available smart contracts directly on the blockchain.
Token standards like ERC-20 (for fungible tokens) and ERC-721 (for NFTs) create a common language that all protocols understand. When every stablecoin follows the same standard interface, a lending protocol does not need custom code for each individual stablecoin. It can accept any ERC-20 token using the same integration pattern.
This standardization dramatically reduces the friction of building new protocols and connecting existing ones. It is the glue that makes the money lego metaphor work in practice.
Unlike traditional financial systems that require business agreements, API keys, and regulatory approvals, DeFi protocols are permissionless. Any smart contract can call any other smart contract on the same blockchain without prior authorization. This removes the gatekeeping that slows innovation in traditional finance.
All protocols on the same blockchain share the same global state. This means that the result of one transaction (for example, depositing collateral and receiving a receipt token) is immediately visible and usable by every other protocol on the chain. There is no lag, no settlement delay, and no reconciliation process between different systems.
Borrow by Sats Terminal is itself a product of composability. By building on top of multiple lending protocols, Borrow can offer users a unified interface to compare rates, terms, and risk profiles across the DeFi ecosystem.
Concretely: Borrow plugs into Aave v3, Morpho Blue, and CeFi providers across six EVM chains, and uses that composability to handle the cross-chain bridging and BTC wrapping in the background. The user just deposits native BTC and ends up with USDC. Without composability, each lending protocol would be an isolated silo, and users would need to manually visit each one to compare options.
Flash loans are perhaps the purest expression of composability. A user can borrow millions of dollars, use those funds across multiple protocols (arbitrage, liquidation, collateral swaps), and repay the loan, all within a single atomic transaction. If any step fails, the entire transaction reverts as if nothing happened.
This is only possible because DeFi protocols are composable. The flash loan contract can interact with lending protocols, decentralized exchanges, and any other protocol in a single transaction chain.
Yield aggregators like Yearn Finance automatically move user funds between different lending protocols and liquidity pools to maximize returns. The aggregator's smart contracts continuously evaluate rates across composable DeFi protocols and rebalance accordingly. Users deposit once and benefit from the aggregator's ability to compose multiple protocols together.
In some DeFi strategies, users deposit an asset as collateral to borrow another asset, then use that borrowed asset as collateral on a different protocol to borrow yet another asset. This "recursive borrowing" or "looping" is enabled entirely by composability. Each protocol's receipt tokens (like aTokens from Aave) are themselves composable assets that other protocols can accept.
Because developers can build on top of existing protocols, the pace of innovation in DeFi is extraordinary. A team does not need to build a lending protocol, an exchange, and a price oracle from scratch. They can focus on their unique contribution and compose it with existing infrastructure.
This is similar to how web developers do not build their own web servers, databases, and authentication systems from scratch. They use existing tools and focus on the application layer. DeFi composability provides the same leverage for financial innovation.
Composability enables aggregators and meta-protocols that simplify the user experience. Instead of manually navigating five different lending protocols to find the best rate for a Bitcoin-backed loan, users can visit a single platform like Borrow that leverages composability to present all options in one place.
When protocols can interact with each other, capital moves more efficiently. A user's collateral can simultaneously serve multiple purposes: it secures a loan, earns interest, and provides liquidity for other users. This multi-layered use of capital is only possible because the protocols involved are composable.
Composability lowers the barrier to entry for new protocols. A startup can launch a new DeFi product that immediately integrates with the existing ecosystem, competing with established players on a level playing field. This competition drives better rates, more features, and stronger security for users.
The same interconnectedness that makes composability powerful also creates systemic risk. When protocols are deeply intertwined, a failure in one can cascade across the entire ecosystem. This is sometimes called "composability risk" or "DeFi contagion."
For example, if a widely used stablecoin loses its peg, every protocol that accepts it as collateral, every liquidity pool that pairs it, and every yield strategy that depends on it could be affected simultaneously.
Each composable interaction adds another layer of smart contract risk. If Protocol A uses Protocol B, which uses Protocol C, a bug in any one of the three could compromise the entire chain. The more protocols involved in a strategy, the larger the attack surface.
Many composable DeFi strategies depend on accurate price data from oracles. If protocols share the same oracle and that oracle is manipulated, the effects can ripple across every protocol in the composable chain.
Each protocol in a composable stack has its own governance process. A governance decision in one protocol (such as changing collateral parameters or interest rate models) can have unintended consequences for protocols that build on top of it.
Composability works best when all protocols exist on the same blockchain. Cross-chain composability, where protocols on different blockchains interact with each other, is significantly more complex. It requires bridges, messaging protocols, and cross-chain communication standards that are still maturing.
Projects like LayerZero, Axelar, and Wormhole are building cross-chain messaging infrastructure that aims to extend composability across blockchain boundaries. As these solutions mature, DeFi could become composable not just within a single chain but across the entire multi-chain ecosystem.
Borrow by Sats Terminal already supports multiple blockchains, helping users access composable lending markets across different chains from a single interface. And you don't bridge anything yourself. Deposit native BTC once, and Borrow routes it through whichever chain (BASE, Ethereum, Arbitrum, Polygon, Optimism, or BSC) and wrapped form (wBTC, BTCB, or cbBTC) the winning lender requires.
Composability is what makes DeFi fundamentally different from traditional finance. It enables a pace of financial innovation that is impossible in permissioned, siloed banking systems. As the ecosystem matures, we can expect:
Common Questions
Composability in DeFi refers to the ability of decentralized protocols and smart contracts to interact with each other seamlessly, like building blocks that snap together. Because DeFi protocols are built on open, permissionless blockchains with standardized interfaces, any new protocol can integrate with existing ones without needing permission. This characteristic is why DeFi protocols are often called "money legos."
Related Questions
DeFi Basics
Learn what a DeFi protocol is, how decentralized finance protocols work, the different types of DeFi protocols, and how they are governed by their communities.
DeFi Basics
Learn about the key risks of decentralized finance (DeFi), including smart contract vulnerabilities, protocol risk, systemic risk, and how to protect your assets.
DeFi Basics
Learn what decentralized finance (DeFi) is, how it works, and why it matters. Understand the core concepts of DeFi including smart contracts, blockchain, and permissionless financial services.
DeFi Basics
Learn what oracles are in DeFi, how they bring off-chain data on-chain, the different types of oracle networks, and why accurate price feeds are essential for lending, borrowing, and other decentralized finance applications.