Explainerintermediate

    How DeFi Yield Vaults Work: Auto-Compounding & Risks

    Follow one deposit through the full auto-compounding loop to see how DeFi yield vaults earn, charge fees, and where risks hide.

    44 min read

    Updated 19 November 2026

    Level 2 · PractitionerAssumes you can use a wallet and an exchange.
    DeFi Fundamentals
    3 to read first · 3 next steps

    A vault page shows a large APY figure and a Deposit button. That figure is produced by a set of contracts, and most guides never explain what those contracts do. This guide explains how DeFi yield vaults work: the auto-compounding mechanics, the fees, and how to assess the risks, so you know what happens to your money after you click.

    You have probably connected a wallet, swapped tokens, and maybe added liquidity once. Then you open a Yearn or Beefy vault and the questions start. Could the contract be drained? Is the APY real, or does it come from reward tokens that are about to lose value? How much do the fees take? Asking these questions is good judgment.

    This guide follows one deposit through the full ten-step auto-compounding loop. It then compares manual compounding with a vault, including gas costs, maps every layer of risk a vault adds, and ends with a 12-point checklist you can run in about 15 minutes. Don't take the APY number on trust. Learn what produces it, what it costs, and what could break it.

    ⚖️ Disclaimer: This guide is for education only and is not financial, investment, or tax advice. It does not promise any yield. Every number in the examples is an illustrative assumption, not a forecast or a claim about any real vault. Fees, strategies, and contract settings change, so always check the live vault page and official docs before you act.

    📋 What You'll Learn

    • The smart contract architecture behind a vault: vault, strategy, keepers, and governance
    • The 10-step life of a single deposit, from approve() to withdrawal
    • Auto-compounding math, including how APR becomes APY and why harvest frequency matters less than it seems
    • A manual vs vault comparison that includes gas, with a simple break-even rule
    • The six-layer "Risk Stack" and what real exploits teach
    • A 12-point due diligence checklist with traffic-light scoring

    ⏱️ Estimated Time: About 25 minutes to read, plus about 15 minutes per vault to run the checklist

    📊 Difficulty: Intermediate (assumes you have swapped tokens and know what an LP token is)

    The 5-Phase Process at a Glance

    Every auto-compounding vault runs the same basic loop. A farm-to-table kitchen is a useful comparison: harvest the crop, take it to market, buy ingredients, and replant.

    1) Deposit & receive shares → 2) Strategy deploys funds → 3) Harvest rewards (pick the crop) → 4) Swap & reinvest (sell at market, buy ingredients, replant) → 5) Share price rises, then withdraw

    The "chef's tip," the performance fee, is taken at the market stage before anything is replanted.

    Skimmer tip: Look for "Check this on-chain" and "Red flag" callouts throughout. If you only have 15 minutes, go straight to the 12-point checklist. It works on its own.

    What Is a DeFi Yield Vault? (The 60-Second Version)

    A yield vault is a smart contract that pools deposits, runs a farming strategy, and automatically reinvests the rewards. Each depositor's position grows without them having to do anything.

    A vault does not create yield. It automates yield that already exists in an underlying farm, lending market, or liquidity pool. If the underlying source pays nothing, the vault pays nothing.

    The Problem Vaults Solve

    Farms pay rewards, but those rewards sit idle until you act on them. Reinvesting by hand is tedious and expensive:

    • Rewards don't compound by themselves. Unclaimed reward tokens earn nothing.
    • Compounding takes several transactions: claim rewards, swap them, add liquidity, and stake the new LP tokens.
    • Gas makes frequent compounding uneconomic for small positions, especially on Ethereum mainnet.
    • People forget, or they compound at bad moments, such as during gas spikes or thin liquidity.

    The Real Reason Vaults Exist: Shared Gas

    The main economic case for vaults is that they share the cost of gas. Manual compounding is like every person driving their own car to the same place and paying for their own fuel. A vault is a bus. One harvest transaction carries every depositor at once, so the gas cost per person falls sharply.

    That is why vaults matter most on expensive chains and for small positions. On cheap chains, the advantage shrinks, as the math section shows.

    Vaults vs Farms vs Lending Pools

    ProductWhat you depositWhere yield comes fromWho compoundsExtra contract layers
    FarmLP tokens (or single tokens)Reward token emissions, plus trading fees inside the LPYou, manuallyNone beyond the farm and pool
    Lending poolA single assetInterest paid by borrowersInterest typically accrues automaticallyNone beyond the lending protocol
    VaultA single asset or LP tokenThe underlying farm or market, auto-compoundedThe vault's strategy and keepersOne or more (vault, strategy, sometimes zaps)

    For context, Compound's documentation describes Compound III as a protocol that "enables supplying of crypto assets as collateral in order to borrow the base asset" (Compound docs). Lending markets like this are a common building block that vault strategies plug into.

    Who Runs Vaults: Yearn, Beefy, and Other Yield Aggregators

    Vault platforms are often called yield aggregators. The two names most readers meet first are:

    • Yearn: an Ethereum-native pioneer of the vault model. Depositors receive yvTokens. See the Yearn docs.
    • Beefy: a multichain aggregator known for many LP auto-compounders. Depositors receive mooTokens. See the Beefy docs.

    Many other aggregators and forks exist. DeFiLlama groups them under a yield aggregator category, which is a good place to compare age and TVL. For a broader tour of the category, read DeFi Yield Aggregators: Maximizing Passive Income. Platform-specific checks come later in the "Choose Your Path" section.

    Next, here is what is actually behind the Deposit button.

    Inside the Vault: The Smart Contract Architecture

    No Solidity is needed here. A vault is a small set of contracts, each with a defined job. The simplest way to see it:

    You → Vault contract → Strategy contract → Underlying protocol (farm, DEX, lending market)

    Keeper / harvest caller → triggers harvest() on the Strategy

    Governance / Multisig → controls settings on both Vault and Strategy

    Treat the strategy as a robot employee that farms for you around the clock. The performance fee is its wage. A timelock works like a mandatory notice period: nobody can secretly swap in a new, possibly dishonest worker overnight.

    🔎 Check this on-chain: Every contract named in this section has a public address you can open on a block explorer. The checklist section shows exactly where to click.

    The Vault Contract and the ERC-4626 Standard

    The vault contract does the accounting. It accepts deposits, mints shares when you deposit, burns them when you withdraw, and tracks the total assets it controls.

    Many newer vaults follow ERC-4626, the Tokenized Vault Standard. It defines common functions such as deposit, withdraw, redeem, convertToShares, and convertToAssets. A shared interface lets wallets, dashboards, and other protocols read any compliant vault the same way.

    Not every vault uses it. Yearn's documentation describes its newer vaults as built around ERC-4626, while many older vaults, including many Beefy vaults, use their own interfaces that predate the standard. Check the docs for the specific vault you are evaluating.

    The Strategy Contract

    The strategy holds the yield logic. It decides where funds go, how rewards are claimed, and how they are swapped back into the deposit asset.

    Governance can often replace a strategy or add a new one. That flexibility is useful, because a strategy can move when a farm dries up. It is also a risk, because a bad strategy can be installed. Yearn's docs describe newer vaults that can allocate across several strategies. A Beefy vault typically maps to a single strategy. Confirm the current design in each platform's docs.

    Keepers and Harvest Callers

    Someone has to trigger the harvest() function. Depending on the design, that might be:

    • The protocol's own automation bots
    • A third-party keeper network
    • Anyone at all, who then receives a small call fee as payment

    Harvesting costs gas, so the call fee pays the caller back. Some vaults also harvest automatically when a new deposit arrives, so new depositors don't capture rewards that existing depositors earned.

    Governance, Multisigs, and Strategists

    Some party can usually upgrade strategies, change fees, or pause the vault. Three terms matter:

    • Multisig: a wallet that needs several signatures, described as "X of Y signers," to approve an action.
    • Timelock: a contract that forces a waiting period between when a change is queued and when it takes effect.
    • Strategist: the developer who wrote the strategy, often paid a share of the fees.

    A timelock works like a public notice board. Any change must be posted for a set period before it takes effect, which gives depositors time to read it and leave if they disagree. Without that notice board, changes can happen with no warning.

    Step-by-Step: How DeFi Yield Vaults Work Through One Deposit's Auto-Compounding Loop

    This section follows one deposit through the machine. The ten steps below mirror the actual contract calls. Each one ends with what could go wrong, which sets up the Risk Stack later.

    The running example is a deposit of LP tokens from a generic stablecoin/ETH-style pool into a vault on a layer 2 network.

    Step 1: Approve and Deposit

    What happens on-chain: First, you sign an approve() transaction that lets the vault contract spend your LP tokens. Then you sign deposit(), which pulls the tokens into the vault.

    Wallets often suggest an unlimited approval so you never need to approve again. An exact approval covers only the amount you are depositing. Unlimited approvals stay active after you leave, which matters if the contract is ever compromised.

    Some front-ends offer zaps, which let you deposit a single token such as ETH. A zap adds a swap step and another contract to trust.

    What could go wrong: approving a phishing contract. Your action: before signing, compare the spender address in your wallet popup with the address in the platform's official docs.

    Step 2: Receive Vault Shares

    What happens on-chain: The vault mints share tokens to your wallet: yvTokens on Yearn or mooTokens on Beefy. You do not receive more LP tokens. You receive a claim on a portion of the vault.

    The number of shares depends on the price per share (PPS), meaning how many underlying tokens one share is currently worth.

    Hypothetical example: Suppose you deposit 100 LP tokens when the vault's PPS is 1.05 (figures are illustrative).

    Shares received = 100 ÷ 1.05 = 95.24 shares (rounded).

    Months later, after many harvests, suppose PPS has risen to 1.12. Your share count has not changed. Your claim is now 95.24 × 1.12 = 106.67 LP tokens (rounded), a gain of 106.67 − 100 = 6.67 LP tokens.

    Your shares work like passengers in a rising elevator. The number of passengers never changes, but the elevator climbs a little with every harvest.

    What could go wrong: shares are ordinary transferable tokens. If your wallet is drained, your shares go with it. Your action: hold meaningful positions in a hardware wallet.

    Step 3: The Strategy Deploys Capital

    What happens on-chain: The vault forwards your LP tokens to its strategy. The strategy stakes them in the farm's staking contract, often called a gauge or a MasterChef contract.

    This is the key shift in thinking. Your funds are no longer sitting "in the vault." They sit in a third-party protocol that the vault does not control.

    What could go wrong: the underlying farm can be exploited even if the vault code is perfect. Your action: research the underlying protocol, not just the vault (checklist item 8).

    Step 4: Rewards Accrue

    What happens on-chain: The farm credits reward tokens, often a governance token, to the strategy's staked position as new blocks are produced. On Ethereum, a block arrives every 12s (ethereum.org), and other chains have their own block times.

    These rewards are accrued but not yet compounded. Until someone harvests, they earn nothing extra.

    What could go wrong: the reward token's price can fall while rewards are waiting to be sold. Your action: check reward-token liquidity and emissions (checklist item 10).

    Step 5: The Harvest Call

    What happens on-chain: A keeper, bot, or call-fee hunter calls harvest() on the strategy. The strategy claims the accrued rewards from the farm.

    How often this happens depends on gas costs compared with accrued rewards. Some vaults harvest several times a day, and others much less often. Frequency varies by vault and chain.

    Frequency matters because it is the "n" in the APY formula. As the math section shows, its benefit flattens out quickly.

    What could go wrong: stalled keepers mean rewards stop compounding. Your action: check the vault page or explorer for recent harvest transactions.

    Step 6: Fees Are Skimmed

    What happens on-chain: Before anything is reinvested, fees are taken from the harvested rewards and sent to recipients such as the protocol treasury, the strategist, and the harvest caller. Common fee types include:

    • Performance fee: a percentage of profit or harvested rewards.
    • Management fee: a percentage of assets per year, used by some vaults.
    • Call fee: the harvest caller's payment.
    • Deposit or withdrawal fees: charged on some vaults when you enter or exit.

    Many platforms say their displayed APY is already net of performance fees, but presentation differs. Read each platform's docs to confirm.

    What could go wrong: fees raised without notice. Your action: check whether fee changes are timelocked (checklist items 3 and 6).

    Step 7: Rewards Are Swapped

    What happens on-chain: The strategy sells the reward tokens through a DEX route into the LP pair's underlying tokens.

    This step carries real execution risk:

    Common defenses include minimum-output parameters on swaps, private transaction routing, and frequent smaller harvests. For the routing side, see How to Use Private RPCs to Protect DeFi Swaps from MEV.

    Step 8: Rebuild the LP and Reinvest

    What happens on-chain: Zap logic splits the swap proceeds into roughly equal values of the two pool tokens. It adds liquidity to mint new LP tokens and stakes them back in the gauge.

    Small rounding leftovers, called "dust," may remain in the strategy. They are usually included in the next harvest.

    What could go wrong: a bug in the reinvest logic can strand funds or misprice the deposit. Your action: confirm that the audit covers the current strategy code (checklist item 1).

    Step 9: Price Per Share Increases

    What happens on-chain: Total assets in the vault go up, while total shares stay the same. As a result, PPS rises. In the hypothetical example from Step 2, PPS moved from 1.05 to 1.12, and the same 95.24 shares became a claim on 106.67 LP tokens.

    🚩 Red flag to remember: More LP tokens does not automatically mean more dollars. LP token value still depends on the prices of both pool assets, and impermanent loss still applies. See Navigating Impermanent Loss.

    Step 10: Withdraw

    What happens on-chain: You call withdraw() or redeem(). The vault burns your shares, the strategy unstakes the matching LP tokens if needed, and the underlying tokens return to your wallet.

    Some vaults charge a small withdrawal fee, and the rate varies by vault. If strategy funds are locked or illiquid, withdrawals can be delayed or limited.

    Your action: always test a small withdrawal before you size up (checklist item 12).

    With the loop covered, the next question is what it is worth in numbers.

    Auto-Compounding Math, Explained Simply

    Compounding works like a snowball rolling downhill. It grows on every turn. Fees and gas are friction that melt some snow each time you push it. This section uses one formula, one table, and one "price tag vs receipt" example. To try your own numbers, use DeFi APR vs. APY Calculator: How Staking Compounding.

    APR vs APY: The Compounding Formula

    The standard conversion is:

    APY = (1 + APR / n)n − 1, where n is the number of compounds per year.

    For example, at an illustrative 20% APR:

    CompoundingnWorkingAPY
    None (simple)1(1 + 0.20)1 − 120.00%
    Monthly12(1 + 0.20/12)12 − 1≈ 21.94%
    Weekly52(1 + 0.20/52)52 − 1≈ 22.09%
    Daily365(1 + 0.20/365)365 − 1≈ 22.13%

    A higher APR widens the gap. For example, at a 60% APR, monthly compounding gives (1 + 0.60/12)12 − 1 = 1.0512 − 1 ≈ 79.59%. Daily compounding gives about 82.13%.

    Why Harvest Frequency Has Diminishing Returns

    Using the same 20% APR, moving from monthly to weekly compounding adds 22.09 − 21.94 = 0.15 percentage points. Moving from weekly to daily adds only 22.13 − 22.09 = 0.04 points.

    Beyond a certain point, extra harvests mostly burn gas. Well-run vaults balance harvest frequency against cost instead of harvesting as often as possible.

    Where the Displayed APY Can Mislead You

    The displayed APY is like the price tag in a shop window. Your realized return is the receipt. Six things push the two apart:

    1. Trailing vs projected APY: a past-period rate, such as the last 7 days, may be projected forward as if it will continue.
    2. Reward-token price decline: APR is quoted at today's reward-token price. Vaults that sell rewards continuously add selling pressure.
    3. Emissions that end or shrink: reward programs often follow a schedule. For example, Uniswap's UNI announcement described "a perpetual inflation rate of 2% per year" starting "after 4 years" (Uniswap blog). Published schedules like this tell you how emissions will change.
    4. TVL dilution: when new money floods in, a fixed reward stream is split among more depositors.
    5. Fee treatment: the figure may or may not already include all fees.
    6. Impermanent loss: APY figures generally do not include it.

    Hypothetical example (price tag vs receipt): Suppose you deposit $1,000 into a vault showing a 30% APY. Assume 25 points come from reward emissions and 5 points from trading fees. Simple, non-compounded arithmetic is used for clarity, and all figures are illustrative.

    Price tag: $1,000 × 0.30 = $300.

    Suppose the reward token falls 40% steadily over the year, so it sells at an average of 80% of its starting price ((100% + 60%) ÷ 2 = 80%). Reward income = $1,000 × 0.25 × 0.80 = $200. Fee income = $1,000 × 0.05 = $50. Suppose impermanent loss costs $30.

    Receipt: $200 + $50 − $30 = $220, or 22% instead of the 30% on the tag.

    🚩 Red flag: Triple-digit APYs that come mostly from a new, illiquid reward token. In that setup, the receipt can end up very far from the price tag.

    Manual Compounding vs Vault Auto-Compounding

    This comparison decides whether a vault is worth it for you. One difference drives it: a vault's fees are a percentage of yield, so they grow with your position. Manual gas is a fixed cost per compound, regardless of position size.

    The Hidden Cost: Gas per Compound

    A manual compound usually takes about four transactions: claim rewards, swap, add liquidity, then stake the new LP tokens. The first time, you may also need token approvals. Multiply that by your compounds per year.

    This is where the bus comparison matters. The vault pays for one harvest on behalf of every depositor. To estimate your own gas costs, see How to Minimize Gas Fees and Optimize DeFi Transactions.

    Worked Example: $1,000, $10,000, and $100,000 on Mainnet vs an L2

    Real gas costs vary widely by network conditions, so check a current gas tracker for your chain. The assumptions below are only there to show how the comparison works.

    Hypothetical example: Suppose a farm pays a 20% APR. A vault charges a 10% performance fee (0.10 × 20 = 2 points), leaving an 18% net APR compounded daily: (1 + 0.18/365)365 − 1 ≈ 19.72%. Suppose one manual compound (4 transactions) costs $40 on Ethereum mainnet and $0.40 on an L2. Gas = compounds per year × cost per compound. This is a slightly conservative count, since the final compound overlaps with your exit. Entry and exit transactions are ignored for both paths. All figures are illustrative.

    PositionNo compoundingVault (≈19.72%)Mainnet manual (best cadence)L2 manual
    $1,000$200.00$197.16Don't compound: $200.00Monthly: $219.39 − (12 × $0.40) = $214.59
    $10,000$2,000.00$1,971.64Twice a year: (1.102 − 1) × $10,000 = $2,100 − (2 × $40) = $2,020.00Every 2 weeks: $2,204.68 − (26 × $0.40) = $2,194.28
    $100,000$20,000.00$19,716.428× a year: (1.0258 − 1) × $100,000 = $21,840.29 − (8 × $40) = $21,520.29Weekly: $22,093.43 − (52 × $0.40) = $22,072.63

    A higher APR changes the picture. At a 60% APR with the same 10% fee (54% net), a $1,000 vault position compounding daily earns about $715.32. Mainnet manual compounding twice a year earns (1.302 − 1) × $1,000 − $80 = $690 − $80 = $610.

    Takeaways from these illustrative numbers:

    • On a cheap chain, disciplined manual compounding beat the fee-taking vault at every position size in this model.
    • At a moderate APR, the vault's fee roughly cancelled its compounding benefit. Its value there is mostly time saved and convenience.
    • The vault's advantage grows with APR and shrinks as position size rises, and it is largest for small positions on expensive chains.

    Finding Your Break-Even Position Size

    The rule: compound only when the extra yield from reinvesting your accrued rewards clearly exceeds the gas you will spend. A standard approximation for the best interval, when each compound has a fixed cost, says to compound when:

    unclaimed rewards ≈ √(2 × gas cost per compound × position size)

    Using the same illustrative assumptions as the table above:

    • $10,000 on mainnet with $40 gas: √(2 × 40 × 10,000) = √800,000 ≈ $894. At 20% APR, rewards accrue $2,000 a year, so $894 ÷ $2,000 ≈ 0.45 years, or about every 5.4 months. That matches the twice-a-year result.
    • $1,000 on an L2 with $0.40 gas: √(2 × 0.40 × 1,000) = √800 ≈ $28. At $200 a year, $28 ÷ $200 ≈ 0.14 years, or about every 7 weeks.

    Once you have your best manual result, compare it with the vault's net APY. Remember that the vault also adds contract risk, covered below.

    Comparison Table: Manual vs Vault

    FactorManual compoundingVault auto-compounding
    Cost modelFixed gas per compoundPercentage fee on yield (plus possible management, deposit, or withdrawal fees)
    ControlFull control over timing and what to do with rewardsDelegated to the strategy
    Time requiredOngoing attentionMinimal after deposit
    Fee dragHeavy for small positions on expensive chainsProportional at every position size
    Smart contract riskFarm and pool onlyFarm + pool + vault + strategy (+ zap)
    Tax eventsYou choose the timingPossibly at every harvest, depending on jurisdiction
    Swap/MEV exposureYou can set slippage and use private routingDepends on the strategy's swap protections
    FlexibilityHold, sell, or redirect rewards freelyRewards are always sold and reinvested

    When Manual Compounding Wins (and When the Vault Wins)

    Manual tends to win for large positions, on cheap chains, and when you want full control. That includes holding rewards instead of selling them, avoiding extra contract layers, or choosing when taxable events happen.

    The vault tends to win for small positions on expensive chains, at very high APRs, when you have no time to manage positions, and when the vault is reputable with a long track record.

    If the vault still looks like the right tool, the next step is to evaluate the specific platform.

    Choose Your Path: Which Vault Platform Are You Evaluating?

    Which platform are you looking at?

    Yearn Beefy Other aggregator or fork

    Each branch follows the same template: where to find fees, the strategy address, and the multisig and timelock details, plus one platform-specific red flag. Fee structures change over time, so always verify on the live vault page and in the docs.

    Evaluating a Yearn Vault

    • Strategies: open the vault page and find its strategy list. When a vault allocates across several strategies, each one is its own risk.
    • Fees: Yearn's fee model has changed across vault generations. Read the fee details on the vault page and in the Yearn docs, and don't rely on figures from older articles.
    • Control: find the governance multisig and any timelocked roles listed in the docs, then confirm them on the explorer.
    • Red flag to keep in mind: a long track record does not mean zero risk. Yearn has been exploited before (the yDAI incident is covered below), so check the current strategy every time.

    Evaluating a Beefy Vault

    • Contracts: on the vault page, follow the links to the "Vault" and "Strategy" contracts.
    • Fees: Beefy's docs describe fees taken at harvest and split among parties such as the treasury, the strategist, and the harvest caller. Some vaults add deposit or withdrawal fees. Read the fee breakdown on the vault page and in the Beefy docs.
    • Risk labels: review the safety score and risk tags shown on the vault page.
    • Control: check the docs for timelock and multisig details, then confirm them on-chain.
    • Red flag to keep in mind: because Beefy is multichain, each vault also inherits the risk of the underlying platform and chain it uses.

    Evaluating Other Aggregators and Forks

    A fork copies the code but not the security culture behind it. Add these checks:

    • Is the codebase verified, and is it an unmodified fork? If it was modified, was it audited after the changes?
    • Is the team anonymous, and is there a timelock at all?
    • What TVL history and age does DeFiLlama show?
    • Is there a bug bounty, and how large is it?

    🚩 Red flag: a fork with modified deposit logic and no new audit. That is the Grim Finance pattern described below.

    The Risk Stack: Every Layer That Can Fail

    Risks come in layers, stacked like a Jenga tower. A vault adds blocks on top of the farm, so more automation means a taller tower. The better question is not "Are vaults safe?" but "Is the extra layer worth the automation?"

    Each layer below ends with a "Your action" line that points to a checklist item.

    Layer 1: Vault and Strategy Contract Risk

    Bugs, reentrancy, flawed share accounting, and unvalidated inputs live at this layer. Your action: confirm that audits cover the current strategy, that the code is verified, and that the vault has a track record (items 1, 2, 7).

    Layer 2: Underlying Protocol Risk

    The farm, DEX, or lending market the strategy uses can be exploited or rugged independently of the vault. Your action: look up the underlying protocol on DeFiLlama and Rekt.news (item 8).

    Layer 3: Asset Risk

    This layer covers stablecoin depegs, reward-token collapse, and impermanent loss. Because vaults sell rewards automatically, they can make a falling token fall further. Your action: check reward liquidity and emissions (item 10).

    Layer 4: Admin and Governance Risk

    Malicious or buggy strategy upgrades, compromised signer keys, low multisig thresholds, and missing timelocks belong here. Your action: run items 3, 4, and 5.

    Layer 5: Oracle, Flash Loan, and MEV Risk

    Attackers can borrow huge sums within one transaction (a flash loan) to distort spot prices that a vault relies on. Harvest swaps can also be sandwiched. Your action: favor strategies that don't price assets from a single manipulable pool, and look for audits that address this.

    Layer 6: Chain and Bridge Risk

    Chains can halt, L2 sequencers can go down, and bridged assets depend on bridge security. L2BEAT shows how L2s differ in these risks. For example, it lists Base as a Stage 1 optimistic rollup built on the OP Stack (L2BEAT: Base). It lists Celo as a Stage 0 Optimium, with "Cannot withdraw" noted under proposer failure (L2BEAT: Celo). Your action: check the chain's L2BEAT page, diversify across chains, and prefer native assets where possible.

    Lessons from Real Exploits

    The cases below are summarized qualitatively. Loss figures differ between sources, so read the linked post-mortems for amounts and details.

    • Harvest Finance: an attacker used flash loans to push stablecoin prices in Curve pools back and forth while entering and leaving the vault at distorted share prices (Rekt post-mortem). Maps to: items 1 and 8, plus Layer 5 oracle risk.
    • Pickle Finance: an attacker passed a fake "evil jar" contract into a function that did not validate its inputs, draining DAI from the protocol (Rekt post-mortem). Maps to: items 1 and 9.
    • Yearn yDAI vault: manipulation of Curve's stablecoin pool drained funds from the vault, and the attacker's own profit was smaller than the vault's loss (Rekt post-mortem). Maps to: items 1 and 5.
    • Grim Finance: a Beefy-style fork allowed reentrancy through an attacker-supplied token in a deposit function (Rekt post-mortem). Maps to: fork caution and items 1 and 2.

    The 12-Point Vault Safety Due Diligence Checklist

    This is the core of the guide. Score each item green, yellow, or red. Plan for about 15 minutes per vault.

    Suggested verdict rule (a framework, not a guarantee): any red in items 1–5 means don't deposit. Three or more yellows anywhere means keep the position small.

    The 12 Checks

    1. Audits. How to check: open the audit reports linked in the docs. Note the auditor, the date, and the commit or contract addresses covered. Red flag: the audit predates the current strategy.
    2. Verified contract. How to check: on the explorer, open the "Contract" tab and look for the green checkmark with readable source code. Red flag: unverified bytecode.
    3. Timelock. How to check: follow the mini guide below. This guide's suggested scoring: green if the delay is at least 48 hours, yellow if it is shorter, red if there is no timelock.
    4. Multisig. How to check: find the signer count and threshold in the Safe app or on the explorer. Red flag: a single wallet (EOA) in control, or a low threshold with anonymous signers.
    5. Strategy upgradability. How to check: see who can call functions like setStrategy, and whether the explorer shows "Read as Proxy," which means upgradable code. Red flag: one key can swap strategies instantly.
    6. Full fee breakdown. How to check: list the performance, management, deposit, withdrawal, and call fees. Red flag: undisclosed fees, or fees that can change without a timelock.
    7. TVL and time live. How to check: review the TVL history on DeFiLlama. Code that has held funds safely for a long time has survived more attempts. Red flag: a brand-new vault with sudden TVL spikes.
    8. Underlying protocol. How to check: review its audits and its record on DeFiLlama and Rekt. Red flag: past exploits with no clear fix.
    9. Bug bounty. How to check: search Immunefi or the protocol's own program, and note the size and scope. Red flag: no bounty at all.
    10. Reward token health. How to check: look at DEX liquidity depth, upcoming unlocks, and the emission schedule. Red flag: thin liquidity that the vault's own selling could crash.
    11. Third-party ratings. How to check: look at DeFiSafety scores, DeFiLlama, and Rekt history. Red flag: poor ratings or no coverage at all.
    12. Withdrawal test. How to check: deposit a small amount, withdraw it, and confirm the fees match what was disclosed. Red flag: unexpected fees or failed withdrawals.

    How to Check a Timelock on a Block Explorer

    1. Copy the vault or strategy address from the official docs or vault page, never from a social media link.
    2. Paste it into Etherscan, Arbiscan, Basescan, or the explorer for your chain. Open the Contract tab and confirm the source is verified.
    3. Click Read Contract (or Read as Proxy). Find functions such as owner(), governance(), or admin roles, and query them.
    4. Click the returned address. Its contract name tells you whether it is a TimelockController, a Safe multisig, or a plain wallet with no contract code (an EOA).
    5. If it is a timelock, read getMinDelay() or the delay variable. The value is in seconds: 86,400 = 1 day, and 172,800 = 2 days.
    6. If it is a Safe, read getThreshold() and getOwners() to see how many signers are required out of how many.
    7. Optionally, open the timelock's Events tab to see queued or executed changes.

    Explorer values are raw integers. A token with 18 decimals, such as DAI (Maker source), shows 1 token as 1 followed by 18 zeros. The Etherscan documentation explains these tabs in more detail.

    🔎 Check this on-chain: Some protocols publish their admin addresses in their docs. Cross-check that the docs match what the contract returns on-chain.

    How to Read a Vault's Fee Structure Without Getting Fooled

    Ask five questions:

    • Is the displayed APY shown before or after fees?
    • Is the performance fee charged on all rewards or only on profit?
    • Does a management fee apply to principal even in losing periods?
    • Do deposit or withdrawal fees penalize short stays?
    • Can the admin raise fees without notice?

    The fee type changes the cost. For example, a 10% performance fee on a 20% APR strategy removes 0.10 × 20 = 2 percentage points, leaving 18%. A 2% annual management fee instead takes 2% of principal every year, including a year when the strategy earns nothing.

    Your Traffic-Light Scorecard

    Copy this template into a spreadsheet or notes app and fill in one row per item:

    ItemHow to checkGreen / Yellow / RedNotes
    1. AuditsAudit reports vs current strategy
    2. Verified codeExplorer "Contract" tab
    3. TimelockgetMinDelay()
    4. MultisiggetThreshold() / getOwners()
    5. UpgradabilityProxy / setStrategy permissions
    6–12Fees, TVL, underlying, bounty, reward token, ratings, test withdrawal

    A checklist only helps if your own setup is secure, so wallet habits come next.

    Security Best Practices

    • Use a hardware wallet for meaningful amounts, and keep a separate "hot" wallet for experiments.
    • Revoke unused approvals on a regular schedule, such as monthly. On Revoke.cash, enter your address, select the chain, review the approval list, and click Revoke on anything you no longer use.
    • Bookmark official URLs and open front-ends only through those bookmarks. Phishing sites, fake search ads, and impersonator links in Discord or X are common.
    • Verify contract addresses in your wallet popup against the official docs before signing.
    • Size positions sensibly. Deposit only what you could afford to lose to a smart contract failure, and use smaller sizes for younger or yellow-rated vaults.
    • Diversify across platforms, strategies, and chains, so one failure in the Risk Stack doesn't take everything.
    • Monitor governance announcements and timelock queues. Review monthly, and immediately whenever a strategy changes.
    • Use transaction simulation, such as Rabby's preview, to see what a transaction will do before you sign.
    • Know your exit plan (advanced, use carefully): if the front-end goes down, withdrawals can be made through the explorer's Write Contract tab after you connect your wallet. Practice this only with a tiny amount first.

    ⚠️ Common Mistakes to Avoid

    Each of these mistakes is common and avoidable. Every one comes with a simple fix.

    • Chasing the highest APY
    • Ignoring the reward token's sell pressure
    • Leaving unlimited token approvals active
    • Depositing into unaudited forks
    • Forgetting that harvests may be taxable events
    • Over-concentrating in one vault or chain

    Chasing the Highest APY

    The top APY on a list often belongs to the riskiest token or the newest contract. Do this instead: compare risk-adjusted yields within the same asset class, such as stablecoin vaults against other stablecoin vaults.

    Ignoring the Reward Token's Sell Pressure

    Vaults sell rewards automatically. When many vaults sell the same token, its price can keep falling. Do this instead: check emissions, unlock schedules, and liquidity depth before depositing.

    Leaving Unlimited Token Approvals Active

    Depositing into Unaudited Forks

    As the Grim Finance case shows, small code changes can open large holes. Do this instead: apply checklist items 1–5 strictly, with no exceptions for forks.

    Forgetting That Harvests May Be Taxable Events

    Over-Concentration in One Vault or Chain

    A single exploit or chain halt can wipe out a concentrated position. Do this instead: set position limits per vault, per platform, and per chain.

    Frequently Asked Questions

    How do DeFi yield vaults work?

    You deposit a token and receive vault shares. A strategy contract puts the funds into a farm or market, harvests rewards, takes fees, swaps the rewards back into the deposit asset, and reinvests. Your share count stays the same while the price per share rises. See the 10-step walkthrough above.

    What is auto-compounding in DeFi?

    Auto-compounding means rewards are reinvested automatically by a contract instead of by you. Reinvested rewards then earn their own rewards, which turns a simple APR into a higher APY. Vaults share the gas cost of each harvest across all depositors, which makes frequent compounding affordable for small positions.

    Beefy vs Yearn: what's the difference?

    Yearn is an Ethereum-native vault pioneer that issues yvTokens, and its newer vaults can allocate across several strategies. Beefy is a multichain aggregator that issues mooTokens, with many single-strategy LP auto-compounders. Fee models and risk labels differ, so compare them on each live vault page.

    Are DeFi yield vaults safe?

    No vault is risk-free. A vault adds contract and admin risk on top of the underlying farm's risk. The useful question is whether the extra layer is worth the automation. Run the 12-point checklist, start small, and test a withdrawal before committing more.

    What are the main smart contract risks in DeFi vaults?

    Common risks include reentrancy, unvalidated inputs, flawed share-price accounting, price manipulation through flash loans, and malicious or buggy strategy upgrades. The Harvest Finance, Pickle Finance, Yearn yDAI, and Grim Finance incidents each show one of these patterns. Audits, timelocks, and verified code reduce, but don't eliminate, these risks.

    Can I lose money in an auto-compounding vault?

    Yes. Losses can come from exploits, a falling reward token, stablecoin depegs, impermanent loss, and fees that outweigh the yield. A rising share price measures growth in underlying tokens, not necessarily in dollar value.

    How often do vaults compound?

    It varies by vault and chain. Harvest frequency depends on gas costs compared with accrued rewards. Some vaults harvest several times a day and others much less often. Because returns from extra compounding shrink quickly, more frequent harvests are not automatically better.

    What fees do yield vaults charge?

    Typical fee structures include performance fees on harvested rewards or profit, management fees on assets, call fees for harvesters, and sometimes deposit or withdrawal fees. Rates differ by platform and change over time, so always verify the exact figures on the live vault page and in the docs.

    Is a vault better than compounding manually?

    It depends on position size, chain, and APR. In this guide's illustrative math, manual compounding beat a fee-taking vault on cheap chains. The vault came out ahead for small positions on expensive chains at high APRs. Apply the break-even rule to your own numbers.

    What happens to my funds if a vault is exploited?

    Outcomes vary. Funds may be partially or fully lost, frozen during a pause, or partly recovered through negotiation or treasury compensation. Nothing guarantees recovery. Diversification, sensible position sizing, and reading the official post-mortem are your best protection.

    What's Next?

    Now that you've completed this guide, you can explain the auto-compounding loop, run the numbers, read a vault page, verify on-chain safety signals, and place any threat on the right layer of the Risk Stack. That is how DeFi yield vaults work in practice. Put it into action with the plan below.

    Your 5-Step Action Plan

    1. Shortlist 3 vaults on the same asset from the DeFiLlama Yields dashboard.
    2. Run the 12-point checklist on each and score it with the traffic light.
    3. Run the break-even math against manual compounding for your position size and chain.
    4. Test with a small deposit and a full withdrawal.
    5. Size up gradually, and set a monthly review cadence plus a review on any strategy change.

    Related Guides

    Sources and Further Reading

    The APY is the price tag. You now know how to read the receipt.

    This guide is educational and is not financial, investment, or tax advice. All figures are illustrative assumptions. Always verify fees, strategies, and contract settings on the live vault page and official documentation before depositing.

    Further reading

    Keep learning