Calculation method
How MoonMath calculates defi yield
DeFi Yield Reality Check — What would this observed yield look like after costs and price stress?
The formula
The observed total rate is compounded over the period, split into base and reward legs by their share of the rate, with only the reward leg revalued by its price change. Performance fees and transaction costs are then subtracted.
What it reads
- The principal and the period in days
- The base and reward annual rates as observed
- Scenario price changes for the principal and for the reward token
- The performance fee percentage and any transaction costs
What it assumes
- The observed rate is held constant for the period as a scenario, not a forecast
- Only the reward leg is revalued: the base yield is never touched by a price-change input
- The performance fee applies to the valued yield only, not to principal appreciation
- Yield accrues on the starting principal with no deposit or withdrawal during the period
What this does not establish
- It is not a projection of realised yield — the rate is a held-constant scenario
- It is not a safety assessment: smart-contract, liquidation, impermanent-loss, depeg and withdrawal risks are all outside it
- Observing a pool is not an endorsement of it
- It does not establish that rewards are claimable or liquid at the stressed price
Run it
Stress-test an observed DeFi pool APY after reward-token price changes, principal movement, performance fees and transaction costs. Results keep provider observations separate from user-controlled scenarios.
Open the DeFi Yield calculatorHow the market itself works
This page describes MoonMath's arithmetic. The mechanics section describes the market: how an order book forms a price, why order-book depth is not the same thing as pool liquidity, and what a public book does and does not let you observe.
Read the market mechanics