ChainScore Labs
LABS
Guides

How to Calculate Your Real Yield and APY

A technical guide for developers and DeFi users on calculating, comparing, and understanding real yield versus advertised APY in decentralized finance protocols.
Chainscore © 2025
core-concepts

Core Yield Metrics in DeFi

Understanding key yield metrics is essential for evaluating DeFi investment returns. This guide breaks down the calculations for Real Yield and APY, helping you distinguish between nominal rates and actual, sustainable earnings.

01

Annual Percentage Yield (APY)

APY represents the total return on an investment over a year, factoring in compound interest. It shows the projected growth if earnings are reinvested.

  • Compounding Frequency: Interest can compound daily, weekly, or monthly, significantly boosting returns over time.
  • Example Calculation: A 10% APR compounded daily yields an APY of approximately 10.52%.
  • User Impact: APY helps compare different DeFi protocols by standardizing returns to an annual rate, though it is a forward-looking projection.
02

Annual Percentage Rate (APR)

APR is the simple annual interest rate earned on a deposit, excluding the effects of compounding. It provides a baseline for yield comparison.

  • Simple Interest: Calculated as (Interest Earned / Principal) * 100 over a year.
  • Use Case: Useful for loans or yields that do not reinvest automatically, like some staking rewards.
  • Key Difference: APR is always lower than APY for compounding products, making it a more conservative metric.
03

Real Yield

Real Yield refers to the actual, sustainable profit generated from a protocol's core operations, such as trading fees or loan interest, and distributed to token holders. It excludes inflationary token emissions.

  • Revenue Source: Derived from real user activity and demand, not token printing.
  • Sustainability Indicator: High real yield suggests a protocol with genuine utility and long-term viability.
  • Example: A DEX distributing a portion of its swap fees to liquidity providers in a stablecoin represents pure real yield.
04

Total Value Locked (TVL)

TVL is the total amount of capital deposited in a DeFi protocol. While not a direct yield metric, it is a crucial health indicator that influences potential returns.

  • Market Confidence: High TVL often signals trust and liquidity, which can lead to more stable yields.
  • Yield Correlation: Protocols with lower TVL may offer higher APY to attract capital, but with increased risk.
  • Analytical Use: Comparing a protocol's yield against its TVL helps assess if returns are driven by sustainable growth or temporary incentives.
05

Calculating Your Real APY

To find your Real APY, adjust the advertised APY by subtracting the protocol's token inflation rate and accounting for impermanent loss or fee structures. This reveals your net, sustainable earning power.

  • Inflation Adjustment: If a token's supply inflates at 5% annually, a 15% APY becomes a 10% real yield.
  • Fee Consideration: Factor in gas fees for transactions and protocol withdrawal costs.
  • Practical Outcome: This calculation prevents overestimation of profits and guides capital to protocols with genuine economic activity.
06

Impermanent Loss (IL) Impact

Impermanent Loss is the potential loss experienced by liquidity providers when the price of deposited assets changes compared to simply holding them. It directly reduces effective yield.

  • Mechanism: Occurs in automated market maker (AMM) pools when asset prices diverge.
  • Yield Netting: A pool might show 20% APY, but if IL is 5%, the real yield is 15%.
  • Mitigation Strategy: Choosing stablecoin pairs or pools with high fee revenue can help offset IL risks.

Step-by-Step Calculation Process

A comprehensive guide to calculating your Real Yield and Annual Percentage Yield (APY) by accounting for fees, inflation, and compounding effects to understand your true investment returns.

1

Gather Your Investment Data

Collect all necessary raw figures from your investment platform or protocol.

Detailed Instructions

Begin by collecting the precise raw data points from your investment dashboard or smart contract. You cannot calculate accurate yields without the correct foundational numbers. This includes the initial principal, any fees incurred, and the current value of your holdings.

  • Sub-step 1: Identify Principal Amount: Log into your platform (e.g., Aave, Lido, or a centralized exchange) and locate your initial deposit amount. For example, you might have deposited 10 ETH.
  • Sub-step 2: Locate Earned Rewards: Find the total rewards or interest earned over a specific period. This could be staking rewards, liquidity provider fees, or lending interest. Note if these are displayed in a different token (e.g., stETH or a governance token).
  • Sub-step 3: Record All Fees: Check transaction histories for network gas fees, protocol withdrawal fees, or performance fees. For instance, a Uniswap V3 LP position might have a 0.3% fee on swaps.
  • Sub-step 4: Note the Time Period: Precisely record the period over which these earnings accrued (e.g., 30 days, 90 days).

Tip: Use blockchain explorers like Etherscan for DeFi investments to verify on-chain data. For the example, assume: Principal = 10 ETH, Rewards Earned = 0.5 ETH, Fees Paid = 0.02 ETH, over 90 days.

2

Calculate the Nominal Yield

Determine the simple percentage return on your investment before adjusting for external factors.

Detailed Instructions

Nominal Yield is your basic return, calculated as (Earnings / Principal) over a period. It does not account for compounding or inflation. This gives you the raw performance figure.

  • Sub-step 1: Compute Net Earnings: Subtract any fees from your gross rewards. Using our example: Net Earnings = 0.5 ETH (Rewards) - 0.02 ETH (Fees) = 0.48 ETH.
  • Sub-step 2: Apply the Nominal Yield Formula: Divide the net earnings by the principal and multiply by 100 to get a percentage. Formula: Nominal Yield (%) = (Net Earnings / Principal) * 100.
  • Sub-step 3: Execute the Calculation: For our 90-day period: (0.48 ETH / 10 ETH) * 100 = 4.8%.
  • Sub-step 4: Annualize if Necessary: To compare with APY, convert this periodic yield to an annual rate. For a 90-day period: Annualized Nominal Yield = (1 + 0.048)^(365/90) - 1. Calculate this as: (1.048)^(4.0556) - 1 ≈ 0.207 or 20.7%.

Tip: This annualized figure is not the APY; it's a simple projection ignoring compounding within the year. Use a calculator for the exponent.

code
// Example calculation in JavaScript let principal = 10; let netEarnings = 0.48; let periodDays = 90; let nominalYieldPeriod = (netEarnings / principal); // 0.048 let annualizedNominal = Math.pow(1 + nominalYieldPeriod, 365/periodDays) - 1; // ~0.207
3

Calculate the APY with Compounding

Compute the Annual Percentage Yield, which includes the effect of compounding interest or rewards within the year.

Detailed Instructions

Annual Percentage Yield (APY) reflects the real rate of return, factoring in compounding frequency—how often earnings are reinvested to generate their own earnings. This is crucial for protocols that compound rewards automatically, like many liquid staking derivatives.

  • Sub-step 1: Determine Compounding Periods: Identify how often rewards are compounded (e.g., daily, weekly, per block). For example, Lido stakes ETH and compounds stETH rewards continuously.
  • Sub-step 2: Use the APY Formula: The standard formula is APY = (1 + (r/n))^(n) - 1, where r is the annual nominal interest rate (as a decimal) and n is the number of compounding periods per year. If you have a periodic yield instead, adapt accordingly.
  • Sub-step 3: Apply with Example Data: Assume our 4.8% yield over 90 days came from a protocol that compounds rewards daily. First, find the daily rate: daily rate = (1 + 0.048)^(1/90) - 1 ≈ 0.000522. Then, APY = (1 + 0.000522)^365 - 1 ≈ 0.211 or 21.1%.
  • Sub-step 4: Verify with Known Tools: Cross-check using an online APY calculator or a protocol's own dashboard, which might display this directly.

Tip: For simplicity, many DeFi interfaces show a projected APY. Always verify if it's APY or APR (Annual Percentage Rate, which doesn't compound).

code
// Calculating APY from a periodic yield with daily compounding let periodicYield = 0.048; // Over 90 days let daysInPeriod = 90; let dailyRate = Math.pow(1 + periodicYield, 1/daysInPeriod) - 1; let APY = Math.pow(1 + dailyRate, 365) - 1; // ~0.211 console.log(`APY: ${(APY*100).toFixed(2)}%`);
4

Adjust for Inflation to Find Real Yield

Determine your purchasing power gain by subtracting the inflation rate from your nominal return.

Detailed Instructions

Real Yield is the most critical metric, representing your return after accounting for inflation, which erodes purchasing power. It tells you if your investment is truly growing wealth. You'll need a reliable inflation rate, such as the Consumer Price Index (CPI) for traditional finance or a crypto-native inflation metric.

  • Sub-step 1: Obtain the Inflation Rate: Find the annual inflation rate for your currency. For USD, use the U.S. Bureau of Labor Statistics CPI data (e.g., 3.2%). In crypto, consider the network's token issuance rate or a general defi index.
  • Sub-step 2: Use the Real Yield Formula: The approximate calculation is Real Yield ≈ Nominal Yield (or APY) - Inflation Rate. For a more precise result, use the Fisher equation: Real Yield = (1 + Nominal Rate) / (1 + Inflation Rate) - 1.
  • Sub-step 3: Perform the Calculation: Using our annualized nominal yield of 20.7% and a CPI of 3.2%: Approximate Real Yield = 20.7% - 3.2% = 17.5%. Using the Fisher equation: (1 + 0.207) / (1 + 0.032) - 1 ≈ 0.169 or 16.9%.
  • Sub-step 4: Interpret the Result: A positive real yield (like ~17%) means your investment outpaces inflation. A negative real yield means you are losing purchasing power despite nominal gains.

Tip: For crypto investments, also consider gas fee inflation (cost of transacting) and token-specific inflation (e.g., ETH issuance post-merge) for a more accurate picture.

code
// Calculating Real Yield using the Fisher equation let nominalAPY = 0.207; // From previous step let inflationRate = 0.032; // 3.2% let realYield = (1 + nominalAPY) / (1 + inflationRate) - 1; // ~0.169 console.log(`Real Yield: ${(realYield*100).toFixed(2)}%`);

Comparing Yield Sources and Structures

How to Calculate Your Real Yield and APY

Yield MetricSimple Interest (Option A)Compound Interest (Option B)Liquidity Pool with Fees (Option C)

Nominal Annual Rate

5.00%

5.00%

12.00% (Base APR + Fees)

Compounding Frequency

None (Annual Payout)

Daily (365 times/year)

Continuous (Reinvested per block)

APY (Annual Percentage Yield)

5.00%

5.13%

12.75% (Estimated)

Real Yield (After 2% Inflation)

3.00%

3.07%

10.49%

Initial Investment

$10,000

$10,000

$10,000

Value After 1 Year

$10,500.00

$10,512.67

$11,275.00

Liquidity & Lock-up

No Lock-up

30-Day Lock-up

Impermanent Loss Risk

Tax Treatment (US)

Ordinary Income

Ordinary Income

Potential Capital Gains

Practical Calculation Approaches

Getting Started

Real yield is the actual profit you earn from a DeFi protocol after accounting for fees and token inflation, while APY (Annual Percentage Yield) is the projected annual return including compounding. Understanding both helps you assess true profitability.

Key Points

  • Identify Revenue Sources: Determine if a protocol generates fees from swaps (like Uniswap), lending (like Aave), or other services. Real yield comes from these, not token emissions.
  • Calculate Net Earnings: Subtract all transaction fees, gas costs, and potential impermanent loss from your gross returns to find your real yield.
  • Use APY Calculators: Many platforms like Yearn Finance or Beefy Finance display APY, but verify if it's sustainable or driven by temporary incentives.

Example

When providing liquidity on Uniswap V3, your real yield is primarily from trading fees collected in the pool. If you deposit $1,000 and earn $50 in fees over a year but pay $5 in gas, your real yield is 4.5% ($45 net). The displayed APY might be higher if it assumes compounding those fees daily.

Common Pitfalls and Advanced Considerations

APR (Annual Percentage Rate) and APY (Annual Percentage Yield) are often confused. APR represents the simple interest rate without compounding, while APY includes the effect of compound interest over a year. This distinction is critical for accurate yield calculations.

  • APR Calculation: If you stake 1,000 tokens at 10% APR, you earn 100 tokens after one year, assuming no compounding.
  • APY Calculation: With daily compounding at 10% APR, the APY becomes approximately 10.52%, yielding about 105.20 tokens.
  • Impact: The more frequent the compounding (e.g., daily vs. monthly), the higher the APY. For example, a 5% APR compounded daily results in a 5.13% APY, but compounded monthly it's only 5.12%.

Platforms like Compound Finance use APY to show true earnings, so always verify which metric is displayed to avoid underestimating returns.