Composability is why DeFi could build in three years what traditional finance took decades to assemble: a new protocol inherits the liquidity, the price feeds, and the users of everything already deployed, and integration costs a function call rather than a legal agreement.
It is also why a single bug can spread through a dozen protocols in one block. Both statements are the same fact — shared state — which is why "money legos" is a good analogy only up to the point where you notice the bricks are load-bearing for each other.
How the mechanism actually works
Any contract can call any other contract, and a transaction that touches five protocols either completes entirely or reverts entirely. That atomicity is what makes a collateral swap, a borrow, a trade, and a repay executable as one action with no window for a partial failure.
Atomicity is also what makes flash loans possible: capital that is borrowed and repaid inside one transaction, so no one has to trust the borrower. It is the cleanest demonstration of what composability adds, and it is the same property that lets an attacker drain five protocols in a single atomic call.
The four patterns worth knowing
Yield aggregation routes deposits across lending markets to find the best rate, and rebalances as rates move. Leverage loops borrow against a supplied asset and supply the borrowed asset again, which multiplies both the yield and the liquidation risk. Arbitrage keeps prices aligned across venues and is the reason most pools track the same number. Liquidation bots are the enforcement mechanism for every loan in the system.
Three of those four are the market working. The fourth — loops — is where most user losses in a downturn come from, because a loop is a directional bet wearing the clothes of a yield strategy.
Where it breaks
The named risks are systemic, contract, oracle, and governance, and they compound in that order. A protocol that depends on another that depends on a third means a failure in any one propagates to all. Every added protocol in a stack adds attack surface. Most strategies rely on a price feed, so a manipulated oracle is not a single protocol's problem. And governance is the sharpest edge: an upgrade or a parameter change in a widely-composed protocol is a change to everything built on it, which its dependents cannot veto.
The practical consequence is that you cannot audit a composable position by reading one protocol's docs. You have to trace the dependency graph and decide whether you trust the weakest link, and that link is usually the one you know least about.
Across chains it is a different animal
Cross-chain composition looks like the same thing and is not. A bridge-based version replaces atomic execution with a promise that settles later, which introduces the window where the value can be lost. Native messaging and intent-based systems reduce that gap but do not eliminate the different trust model: on one chain, a revert is free; across chains, it is a loss.
If you are building
The design rules that matter are unglamorous: do not assume a dependency will behave as it does today, price in the possibility that an external call reverts, keep a circuit breaker for the paths that touch external protocols, and make your own interfaces easy to compose with rather than hoarding the integration.
The protocols that last are the ones other people can build on safely. That is a design constraint, not a marketing position.
Next: what restaking does once the same assets are securing several protocols at once. Join our Discord.
References
Next, read Compute Marketplaces 101. More in DeFi Markets.