How DeFi Vaults Actually Earn Yield
Most users see APY as a static number, a headline yield that simply "exists." In reality, every vault's return comes from dozens of moving parts: block-by-block interest accrual, rebalancing across different markets, internal accounting events, fee realization, and more. To understand where your yield truly comes from you have to look inside the vault.
The Vault is an Accounting Engine
When you deposit, your tokens don't just sit waiting for interest.
They are converted into shares, each representing your proportional claim on the vault's total assets. This is being done through vault minting special tokens for you.
Let's follow a real example.
- At block 16728514, the vault is idle. No transactions, no minting, no burning. The underlying Morpho markets keep accruing interest, but it's unrecognized. TotalAssets: the USDe in this case rises every block because the underlying markets are accruing interest (even though you don't see it anywhere but Rosetta; if curious, check this post)
- TotalSupply, which represents the tokens minted by the vault (feUSDe) stay flat until a user interaction triggers
accrueInterest(). You deposit 10 USDe at block 16728515, and the function is triggered.
- Before minting shares, the vault first runs accrueInterest(). That call books all interest accrued since the last event and mints fee shares โ around 2.28 T feUSDe โ to the fee recipient (totally depending on when the last transaction is). Then, the depositor receives 9.586 T feUSDe priced at the updated PPS.
Different tokens have different decimal scales โ for example, USDT uses 1e6, while most tokens use 1e18. When reading on-chain data, we divide those large integers by their respective decimal factor to make the numbers human-readable.
- The depositor capital is directly allocated to the markets according to DepositQueue, which is the pre-defined market where the deposits will be allocated to - until rebalancing. It's important to state that queue is totally discretionary, if the vault you're allocating is not rebalancing frequently, you assets may remain semi-optimized - unless you are using @rosetta_hl's Router ๐ค.
Let's continue with what happens within the vault;
The vault's TotalSupply grows by both user and fee shares (~11.867 T total), and the depositor's funds begin earning instantly. This order โ recognize, fee, then mint โ guarantees fairness: new entrants never benefit from unpriced history. Between blocks 16728515 and 16728548, nothing happens on-chain, no one deposits, no one withdraws, yet value rises. Morpho markets accrue quietly, lifting TotalAssets while TotalSupply remains constant, so PPS climbs. The depositor's shares gain value without changing in number, and fee shares appreciate proportionally. Passive accrual, fully visible on-chain.
At block 16728549, the depositor withdraws. Again, the vault first realizes accrued interest, mints new fee shares for its cut, then processes the withdrawal. The user's shares are burned, and โ10.000058 USDe (return for 34 seconds), principal plus interest after the 10% fee โ is returned. The fee recipient doesn't take assets; they receive new shares, which stay invested in the underlying markets until redeemed.
Every block is a yield event โ Rosetta simply makes it visible.
This model isn't limited to a single vault or market. It's the foundation for what Rosetta is building: the yield infrastructure layer of DeFi, starting with HyperEVM.
This infrastructure will allow protocols, exchanges, and asset managers to plug into a unified layer of on-chain yield โ a common language for earnings, fees, and performance. Whether it's a single user, an aggregator, or an institution, they'll all interact with the same atomic logic: yield realized, balances updated.
By standardizing block-level yield accounting across protocols, Rosetta turns every vault into a transparent, autonomous balance sheet โ one that updates itself every block. No hidden accruals, no off-chain dependencies, just real-time yield visibility across the entire ecosystem.
For early access visit https://rosetta.sh/telegram