Press ESC to close

What is the Difference Between APR and APY in DeFi?

If you are still confusing APR and APY, you are going to get rekt on your very first yield farming campaign. Whales love painting shiny numbers across UIs to trick retail into aping liquidity into insane yields. Then retail takes a heavy loss and cries in the Telegram chats.

Let us break down how this actually works without the rose-colored glasses or marketing BS.

APR - straight math or a trap for the greedy

APR stands for Annual Percentage Rate. Simple interest. No auto-compounding.

The formula is straightforward. Drop a grand into a pool at 36 percent APR, and after a year you get an extra 360 bucks in the base asset or governance tokens. It trickles in every block, or every second.

Actually, wait. Forgot about gas. If you are farming on Ethereum and claiming your yield manually every single day, transaction fees will eat up your entire profit base in a couple of weeks. Say hello to a depleted deposit.

On L2s the mempool is basically a non-issue, things move faster, but the core concept is identical. Pure math without the magic of compounding. No hidden multipliers. What you see is what you get, unless the smart contract turns out to be a rug pull.

APY - the magic of compounding or marketing for the gullible

APY stands for Annual Percentage Yield. Compound interest with auto-compounding built in.

This is where reinvestment kicks in. Your rewards are automatically sold, more of the pool core asset is bought, and you start earning interest on your interest. The formula looks like this:

APY = (1 + APR / n)^n - 1, where n is the compounding frequency.

Sounds sweet. The numbers on the screen flash green, soaring past 10000% at the launch of some random new memecoin. But did you actually think it through before aping in?

I rushed into a default auto-compounding pool like that myself a year ago, hooked by an 800% APY figure. While my compounding script kept pushing transactions through, the reward token plummeted by 99%. In the end, I got compound interest on a crashing asset. Down 700 bucks in three days. Brilliant.

Side-by-side comparison

ParameterAPR (Simple)APY (Compound)
Reinvestment trackingNo, you claim manuallyYes, automatically via workers
Yield calculationLinear and predictableExponential and volatile
Gas and feesEats up budget on manual claimsBaked into the pool smart contract
Main riskMissed gains from lazinessCompound interest on a crashing asset (death spiral)

Practical code: calculating real yield

Dropping a quick Python script snippet I threw together when auditing another farming contract for bugs. The comments match the vibe.

# calculating apy for the pool, why overthink it
def calc_apy(apr, periods_per_year):
    # if we compound daily, then periods_per_year = 365
    # classic formula, nothing extra
    effective_apy = (1 + (apr / 100) / periods_per_year) ** periods_per_year - 1
    return effective_apy * 100
# checking for an APR of 50% with daily compounding
base_apr = 50.0
daily_comp = 365
result = calc_apy(base_apr, daily_comp)
print(f"real apy: {result:.2f}%") # outputs over 64 percent, magic...

The hidden underbelly of DeFi nobody talks about

Most protocols show astronomical APY numbers driven by the endless emission of their own useless token. This is not real yield from swap fees. It is just a literal shitcoin printing press.

If the fee APR from actual trading volume is 3%, while the total APY is flashed at 450% thanks to a governance token, run away. This is not an investment. It is a liquidity extraction scheme right before an exploit or rug pull. A real trader looks at Real Yield instead of virtual tokens promising the moon.

Summarize this blog post with:

FAQ

APR measures simple interest earned on deposited capital over a year without reinvestment, while APY accounts for compound interest by factoring in auto-compounding rewards. APR increases linearly over time, whereas APY reflects continuous growth as claimed incentive tokens are periodically converted and added back to the underlying liquidity position.

High advertised APY usually results from aggressive governance token emissions designed to bootstrap protocol liquidity rather than sustainable trading fee revenue. When reward tokens face heavy sell pressure, auto-compounding yields fail to offset rapid token devaluation, leading to severe principal loss denominated in base assets.

Manual compounding under APR requires standalone transactions to claim and restake rewards, generating repeated network gas fees that rapidly consume net profit on smaller capital deposits. Automated compounding vaults aggregate multiple user balances into single batch transactions, distributing state update overhead and preserving net returns during periods of high gas prices.
Sergey Zhukov

Senior Back-End Engineer and Technical Architect with 8 years of experience engineering high-performance distributed systems, low-latency trading infrastructure, and complex Web3 data pipelines.

Verification & Professional Profiles: Linkedin Profile

...

Leave a comment

Your email address will not be published. Required fields are marked *