Subscribe to get high-signal insights on how modern fintech is built.

anatomy

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.

By Alex Kugell ·

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.

wstETH looping — one cycle
1
Stake ETH
Lido
+ ~3–4% staking yield
2
Deposit wstETH as collateral
Aave v3 (E-Mode)
Yield continues accruing
3
Borrow WETH
Aave v3
− ~2–3% borrow cost
4
Swap WETH → wstETH
DEX
More wstETH in hand
Loop
Net per cycle
Staking yield − borrow cost = spread × leverage

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.

  1. 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.

  2. 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.

  3. Deposit the wrapped LP token as collateral on a lending protocol that accepts it. Borrow stablecoins against it.

  4. 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.

Generalized composability stack — four protocols, one capital base
LP Protocol
Uniswap v3
~6–12% trading fees
Deposit ETH + USDC
Set price range
Receive LP position
ERC-721 (NFT)
→
Wrapper
Arrakis / Gamma
No additional yield
Deposit LP NFT
Protocol wraps position
Receive vault token
ERC-20 (fungible)
→
Lending Protocol
Aave / Morpho
−4–5% borrow cost
Post vault token
As collateral
Borrow USDC
Against collateral
→
Yield Vault
Morpho
~6–8% lending yield
Deposit USDC
Into curated vault
Receive vault shares
ERC-4626
■Wrapping step — converts NFT to ERC-20, enabling composability

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.

wstETH looping — 10 ETH, 3.5% stake, 2.5% borrow, 90% LTV
No loop3.50%
0.350 net
Loop 14.40%
0.440 net
0.225 cost
Loop 25.21%
0.521 net
0.428 cost
Loop 35.14%↓ diminishing
0.514 net
0.410 cost
Net yield (ETH/yr)Borrow cost (ETH/yr)

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.

Risk stacks upward through the composability chain
Failure propagates
Contagion
Receipt tokens propagate failure across protocols
↳ Protocol A's bad debt becomes protocol B's bad collateral
Liquidation Cascades
Correlated positions unwind simultaneously
↳ CRV: 460M tokens too large to liquidate on-chain
Oracle Risk
Price feeds lag, fail, or misreport during stress
↳ rsETH: oracle priced frozen collateral at canonical rate
Protocol Risk
Smart contract bugs, upgrades, governance attacks
↳ Each protocol in the stack is an independent failure surface

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

Alex Kugell
Alex KugellAI/ML Engineer, Fintech Infrastructure

Writes Ledger Drift. Engineer building AI systems and financial infrastructure. Open source contributor to x402, ACK, and MPP – agentic payment protocols.

Frequently Asked Questions

How can the same capital earn yield from multiple DeFi protocols at once?
Each DeFi protocol issues a receipt token when you deposit funds. That receipt follows the ERC-20 standard, which means any other protocol that accepts ERC-20 tokens can use it as an input. You deposit ETH into a staking protocol and receive wstETH. You deposit wstETH as collateral on a lending protocol and borrow stablecoins. You deposit those stablecoins into a yield vault. Your original ETH is now generating staking yield, your collateral position is enabling a borrow, and your borrowed funds are earning lending yield. Three yield sources from one pile of capital.
What are receipt tokens in DeFi and why do they matter?
Receipt tokens are ERC-20 tokens that represent a claim on assets deposited into a protocol. When you deposit USDC into Aave, you receive aUSDC. When you deposit ETH into Lido, you receive stETH or wstETH. These tokens are fungible, transferable, and follow the same interface as any other token on Ethereum. Because they implement the same standard, any protocol that accepts ERC-20 tokens can accept them, which is what makes DeFi composability possible at the protocol level.
What is ERC-4626 and how does it standardize DeFi yield vaults?
ERC-4626 is a token standard that defines a common interface for yield-bearing vaults. Before it existed, every vault protocol implemented deposit, withdraw, and share accounting differently. ERC-4626 standardizes these operations so that any vault built to the spec works the same way from the outside. Morpho uses it. Yearn uses it. A protocol that integrates one ERC-4626 vault automatically supports any other vault built to the same spec.
What is the wstETH looping strategy and how does it work?
You stake ETH with Lido to receive wstETH, earning roughly 3 to 4% staking yield. You deposit wstETH as collateral on Aave v3 in Efficiency Mode, which allows higher loan-to-value ratios because both assets are correlated to ETH. You borrow WETH at around 2 to 3%, swap it back to wstETH, and repeat. Each loop multiplies both the staking yield and the liquidation risk. Three loops gives you roughly three times the yield and three times the exposure to a price divergence between wstETH and ETH.
What happened in the rsETH/Aave incident in April 2026?
Attackers exploited a bridge vulnerability in KelpDAO and drained roughly 116,500 rsETH. They had borrowed WETH against rsETH on Aave v3 before the exploit. When Kelp paused operations, the oracle continued pricing rsETH at its canonical rate, so the liquidation threshold was never crossed. Aave absorbed between $124 million and $230 million in bad debt depending on the scenario estimate. Total value locked dropped roughly $6.6 billion in 24 hours and total available liquidity on Aave V3 fell 41% in 29 hours.

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.

Keep reading

engineeringHow the Stock Market Actually WorksCo-located servers, microsecond algorithms, and 50 competing venues sit between your buy order and the fill.
analysisFintech's Center of Gravity ShiftedWealthtech has led fintech by deal count for six straight years, and the 2026 data makes the rotation from payments hard to miss.
analysisPayoneer's Stablecoin Bank Is a Settlement ShortcutA cross-border payments company that already supports stablecoins through Bridge just got a charter to issue its own.
View more ›