Money Legos: How DeFi Composability Actually Works
Receipt tokens following the ERC-20 standard let the same capital earn yield from multiple DeFi protocols simultaneously, and stack the risk identically.
Deposit 10,000 USDC into Aave and the protocol mints a token called aUSDC directly into your wallet, sitting alongside your ETH and everything else. It represents your 10,000 USDC plus whatever interest has accumulated since you deposited.
Because aUSDC follows the ERC-20 standard, the same interface that every token on Ethereum implements, any other protocol on the network will accept it. That property is the entire mechanism behind what DeFi calls composability. One protocol's output plugs directly into another protocol's input, not through an integration or a partnership agreement, but because both protocols speak the same token standard.
But the interface-level description omits the risk math. The receipt from your Aave deposit can serve as collateral on a different protocol, and you can borrow against it, then deploy the borrowed funds into a third protocol. Each connection multiplies the yield and the exposure.
The common shorthand is "money legos." Each protocol produces a standardized output, an ERC-20 receipt token, that snaps into the input slot of any other protocol expecting an ERC-20. The connector that holds the stack together is the shared token interface, not a business relationship between the protocols.
Yield inside a single protocol comes from borrowers paying interest on deposits. This piece covers how the yield stacks when you chain protocols together, how the risk stacks with it, and what happens when the stack collapses.
The connecting layer
A bank savings account gives you a balance on a screen. You can't take that balance and use it somewhere else while it's still earning interest. Moving it means withdrawing it, which stops the yield.
A DeFi lending deposit gives you a token. That token is yours in the same way your ETH or USDC is yours. It sits in your wallet, you can transfer it, and you can interact with other contracts using it. The underlying deposit stays in the lending pool earning interest while you use the receipt token elsewhere.
The receipt is portable, and that portability is what makes composability possible.
Aave issues aTokens. When you deposit USDC, you get aUSDC, and the balance in your wallet grows continuously as interest accrues. Compound issues cTokens, where the exchange rate between cUSDC and USDC increases over time so a fixed number of cTokens becomes redeemable for more USDC as interest accumulates.
Different accounting, same principle. Both produce a transferable ERC-20 that represents a claim on deposited assets plus yield.
Before ERC-4626, every vault was bespoke. Integrating with Yearn meant learning Yearn's interface. Integrating with Harvest meant learning a different one. Each vault spoke its own dialect for deposits, withdrawals, and share accounting.
ERC-4626 standardized the interface. Deposit function, withdraw function, share accounting, preview functions, all specified in one standard that Morpho and most newer vault protocols now implement. A protocol that integrates one ERC-4626 vault can integrate any other vault built to the same spec without custom code. That standardization turned yield vaults from isolated products into composable building blocks.
The stack, step by step
The simplest version of yield stacking chains three protocols together, using approximate numbers from late 2026.
Step 1. You stake 10 ETH with Lido. The protocol takes your ETH, delegates it to Ethereum validators, and hands you wstETH (wrapped staked ETH). Your 10 ETH is now earning staking yield, roughly 3% to 4% annually.
That yield comes from Ethereum's consensus rewards: the network pays validators for securing the chain, and Lido passes most of it through to depositors after a 10% fee.
The wstETH in your wallet is an ERC-20 token. It appreciates relative to ETH as staking rewards accumulate.
Step 2. You deposit your wstETH as collateral on Aave v3. Normally, Aave limits borrowing to about 70% of collateral value. But wstETH and ETH move together in price because one is a derivative of the other, so the protocol can safely allow more.
That's what Aave's Efficiency Mode does. E-Mode increases the loan-to-value cap to around 90% for correlated asset pairs, letting you borrow nearly as much as you deposited.
Your wstETH is still earning staking yield. Aave doesn't interrupt that. It just records your deposit as collateral and assigns you borrowing power based on the value.
Step 3. You borrow WETH against your wstETH collateral. The borrow rate on Aave v3 for WETH is roughly 2% to 3%, depending on pool utilization. You now have borrowed ETH in your wallet and a debt position on Aave.
Step 4. You swap the borrowed WETH back to wstETH through a DEX. Now you have more wstETH than you started with, your original stake plus the amount you just acquired with borrowed funds.
You can stop here, or you can loop: deposit the new wstETH back as collateral, borrow more WETH, swap again. Each loop multiplies the staking yield and the borrowing cost by the same factor.
After three loops on a 90% LTV, your effective exposure is roughly 2.7x your original stake. The detailed math is below, but the short version: if staking yield is 3.5% and your borrow rate is 2.5%, three loops nets you about 5.2% on your original 10 ETH, versus 3.5% from a simple stake.
That's yield from three sources on one pile of capital. Ethereum consensus rewards pay the staking yield. Aave borrowers' interest subsidizes the borrow rate. And the spread between the two, amplified by leverage, produces the stacked return.
The pattern is called leveraged staking, or wstETH looping, and it accounts for a substantial share of DeFi lending activity on Ethereum and Layer 2 networks.
The generalized version
The wstETH loop is the most common pattern because the correlation between collateral and debt keeps liquidation risk contained. But the same composability mechanics work across uncorrelated assets, and the stacks get taller.
-
Provide ETH and USDC as liquidity to a Uniswap v3 pool. You earn trading fees on the pair, maybe 6% to 12% annualized depending on the range you set and how much volume the pool processes.
-
Wrap the LP position. Uniswap v3 liquidity positions are NFTs, not ERC-20 tokens, because each position has a unique price range. Protocols like Arrakis or Gamma wrap these NFTs into fungible ERC-20 vault tokens, letting the position enter the composable stack.
-
Deposit the wrapped LP token as collateral on a lending protocol that accepts it. Borrow stablecoins against it.
-
Deploy the borrowed stablecoins into a Morpho vault earning 6% to 8% lending yield.
Your original capital is now earning trading fees from the LP position, and the borrowed stablecoins are earning lending yield, while you're paying the borrow rate. Three yield sources, one capital base, every connection made through ERC-20 tokens and ERC-4626 vault shares.
Not every DeFi primitive outputs an ERC-20. Uniswap v3 positions, options contracts, and some loan positions are non-fungible by design because each one has unique parameters. The wrapping layer converts non-standard outputs into the standard token format the rest of the stack expects.
But every wrapper introduces another smart contract, another team maintaining that contract, and another audit surface. The composable stack looks like a simple four-step chain, but the actual dependency graph includes every wrapper, every oracle, and every governance process behind every protocol in the chain.
What the looping math looks like
Take the wstETH loop with specific numbers.
Starting capital is 10 ETH, worth about $20,000 at $2,000 per ETH.
Staking yield is 3.5%, the borrow rate is 2.5%, and E-Mode LTV is 90%.
After one deposit and borrow, you hold about 9 ETH in borrowed WETH. Swap it to wstETH, deposit again. After three full loops, your total wstETH position is roughly 27 ETH, against about 17 ETH in debt.
The gross staking yield on 27 ETH at 3.5% is 0.945 ETH per year. The borrow cost on 17 ETH at 2.5% is 0.425 ETH. Net yield: about 0.52 ETH, or roughly 5.2% on your original 10 ETH, versus 3.5% if you had just staked without looping.
That 1.7 percentage points of additional yield came from leverage. Your capital is working 2.7 times harder than a simple stake.
But the position has a liquidation threshold. If wstETH depreciates relative to ETH by more than the gap between your LTV and the liquidation threshold, typically around 3% to 5% in E-Mode, Aave's liquidation bots start selling your collateral to cover the debt.
Three loops means roughly 3x leverage, which means a 3% to 5% price move can trigger liquidation. Without looping, your staked ETH has no liquidation trigger at all.
Products that package leveraged wstETH looping into a single ERC-20 token take this to the extreme. The yield is higher and the liquidation band is thinner, and the entire position is itself a composable token that someone could, in theory, use as collateral for something else.
The risk mirror
Every yield source in the stack is also a risk source. The same composability that lets protocols chain together lets failures chain together.
Layer 1: Protocol risk. Each protocol in the stack is a smart contract, and every smart contract can have bugs. A stack using Lido, Aave, and Morpho means your capital depends on three separate codebases being correct.
These protocols have been audited extensively, but audits verify the code at a point in time. Upgrades, governance votes, and new integrations introduce changes that may not have the same level of review.
Layer 2: Oracle risk. Lending protocols use price oracles to determine when collateral is undercollateralized. If the oracle reports an incorrect price because of a data feed delay, a manipulation attack, or a depegging event the oracle doesn't reflect, liquidations can fire when they shouldn't or fail to fire when they should.
The rsETH incident on Aave in April 2026 showed exactly this failure mode. Attackers exploited a bridge vulnerability in KelpDAO and drained roughly 116,500 rsETH. They had already borrowed WETH against rsETH on Aave.
When Kelp paused operations, the oracle continued pricing rsETH at its canonical rate, the price at which rsETH should redeem for ETH under normal conditions. The collateral was functionally worthless because the protocol behind it was frozen, but the oracle never reflected that.
Aave absorbed somewhere between $124 million and $230 million in bad debt, depending on which LlamaRisk scenario estimate you use. The range itself tells you something: seven months after the incident, the community hasn't settled on a single number.
Total value locked across Aave dropped roughly $6.6 billion in 24 hours, about 25% of its TVL. Total available liquidity on Aave V3 fell 41% in 29 hours, and the AAVE token lost 16% to 21% of its value over two days.
Aave's Umbrella backstop mechanism was designed for this exact scenario, but community estimates suggested it could not cover the full deficit. Aave initially said the fund would cover losses, then walked that back within a day.
Layer 3: Liquidation cascades. In a leveraged loop, all positions share the same collateral asset and the same liquidation trigger. When the trigger fires, every loop unwinds simultaneously. The collateral hits the market at once, pushing the price down further, triggering more liquidations in adjacent positions using the same collateral.
The Curve/CRV incident in July 2023 demonstrated the inverse problem. Curve's founder had deposited roughly $168 million worth of CRV as collateral across Aave, Fraxlend, and Abracadabra, borrowing close to $100 million against it.
When a Curve exploit crashed the CRV price by over 20%, the position approached its liquidation threshold.
But there wasn't enough on-chain liquidity to absorb the position without cratering the price further. The collateral was too large for the market to unwind automatically. It was resolved through a series of OTC sales to investors including Justin Sun and others rather than through the protocol's liquidation mechanism.
Composability created a position that the composable infrastructure couldn't safely unwind.
Layer 4: Contagion through receipt tokens. If protocol A's receipt token is used as collateral on protocol B, and protocol A has a bug or a governance attack, the receipt token's value may drop to zero. Protocol B now holds worthless collateral and inherits the bad debt.
The borrower who posted that collateral has no incentive to repay a loan that's already underwater.
This is the mechanism that turns isolated protocol failures into systemic events. A bug in one lending protocol affects every protocol that accepted its receipt tokens as collateral, and every protocol that accepted those protocols' receipt tokens, and so on through the chain.
Composability as a property
The same design that makes DeFi powerful (every output is a standard token, every protocol is permissionless, anyone can build on anyone) is the design that makes it fragile. Composability is a consequence of the token standard, not a feature bolted on.
ERC-20 doesn't know or care whether a token represents a simple balance or a 15x leveraged position on a derivative of a derivative. It treats them identically.
That indifference is the strength and the vulnerability. A protocol can accept any ERC-20 token as an input without knowing what that token actually represents, whether its value depends on a single smart contract or a chain of eight contracts across three oracles and two governance systems. The dependency graph behind that price is invisible at the interface level.
Traditional finance has the same composability in principle. Banks lend to each other, mortgage-backed securities get packaged into CDOs, and derivatives reference other derivatives. The 2008 financial crisis was, structurally, a composability failure: stacked positions with correlated risks unwinding simultaneously when the base layer, subprime mortgages, deteriorated.
The difference in DeFi is speed. A bank run takes days or weeks, but Aave lost roughly 25% of its TVL in 24 hours. Composability on a blockchain operates at block time. Cascading liquidations, oracle updates, and collateral seizures all happen within seconds of each other, faster than governance can respond and faster than most participants can exit.
Earning yield from three protocols on the same collateral is genuine financial engineering. The risk compounds through the same channels the yield does.
Knowing which blocks in the stack are load-bearing is the difference between leveraged yield and leveraged exposure to a cascade you can't unwind fast enough.
Sources
- EIP-4626: Tokenized Vault Standard - Ethereum Improvement Proposal specifying the standard interface for yield-bearing vaults, ratified March 2022
- Aave v3 Technical Paper - Architecture documentation covering E-Mode, LTV parameters, and liquidation mechanics
- S&P Global: DeFi Lending -- An Analysis of Aave - S&P Global, September 2026, covering $52B DeFi lending TVL, Aave's $19-20B share, and protocol mechanics
- Lido: Ethereum Staking - Lido protocol page covering wstETH mechanics, staking yield, and the 10% protocol fee split between node operators and DAO treasury
- Morpho Vaults Overview - Morpho documentation covering curator-managed vaults, ERC-4626 share mechanics, and deposit allocation across lending markets
- Anatomy of a Liquidity Freeze: The rsETH/Aave Incident - Glassnode research, April 2026, analyzing the bad debt event, liquidity impact, and oracle failure mechanics
- Aave Records $6 Billion TVL Drop as Kelp Hack Exposes Structural Risk - CoinDesk, April 19 2026, covering the rsETH exploit, Aave's TVL drop, and community response
- rsETH Incident Post-Mortem - Aave governance forum, April 2026, community analysis of bad debt estimates, Umbrella fund coverage, and proposed remediations
- A Curve Founder's $168M Stash Is Under Stress, Creating Risk for DeFi - CoinDesk, July 2023, covering the CRV collateral position, liquidation risk, and OTC resolution
- How Composability Unlocks Crypto and Everything Else - a16z, conceptual framework for understanding composability as a design property of permissionless systems

Writes Ledger Drift. Engineer building AI systems and financial infrastructure. Open source contributor to x402, ACK, and MPP – agentic payment protocols.
Frequently Asked Questions
Built by Trio, a fintech-native engineering partner helping teams build the next generation of financial technology and infrastructure.
Subscribe to Ledger Drift for high-signal insights into how modern fintech is built, from systems to code to teams.