Glossary

Auto-Compounding

Auto-compounding automatically reinvests earned yield back into the principal position, maximizing returns through compound interest without manual action.

Key Takeaways

  • Auto-compounding is a DeFi mechanism where a smart contract automatically harvests earned yield and redeposits it into the original position, turning simple interest (APR) into compound interest (APY) without any manual action from the depositor.
  • Compounding frequency directly affects returns: a 50% APR compounded daily produces roughly 64.8% APY, while the same rate compounded annually yields only 50%. Yield aggregators like Yearn and Beefy optimize this frequency based on deposit size and gas costs.
  • Auto-compounding is only profitable when the additional yield earned per compounding cycle exceeds the transaction cost of executing the harvest: vaults socialize these gas costs across all depositors, making frequent compounding viable even for small positions.

What Is Auto-Compounding?

Auto-compounding is a yield optimization strategy in decentralized finance where a smart contract periodically collects accrued rewards from a staking, lending, or liquidity position and immediately reinvests them back into the same position. This process converts what would otherwise be simple interest into compound interest: each reinvestment increases the principal, which then earns more yield in the next cycle.

In traditional finance, compound interest is automatic: a savings account credits interest to your balance, and the next period's interest calculation includes that credited amount. DeFi protocols work differently. Most yield-generating positions emit rewards as separate tokens that accumulate in a claimable pool. A user staking tokens in a liquidity pool might earn reward tokens every block, but those rewards sit idle until someone claims and reinvests them. Auto-compounding vaults automate this claim-and-reinvest cycle.

How It Works

An auto-compounding vault follows a repeating cycle of harvest, swap, redeposit, and accounting update. The process varies slightly between protocols, but the core loop is consistent:

  1. Users deposit tokens into an auto-compounding vault, receiving share tokens that represent their proportional ownership of the vault's total assets
  2. The vault deploys deposited tokens into a yield-generating strategy: staking, lending, providing liquidity, or a combination
  3. At regular intervals, a "harvest" function is triggered (either by a keeper bot, a user, or an automated on-chain mechanism) that claims all accrued reward tokens
  4. The harvested reward tokens are swapped back to the vault's base asset through a DEX
  5. The swapped tokens are redeposited into the same yield strategy, increasing the vault's total principal
  6. Share token values increase proportionally: no new share tokens are minted, so each existing share now represents a larger claim on the vault's growing assets

The Harvest Function

The harvest is the critical on-chain transaction that triggers compounding. A simplified version of the harvest logic looks like this:

// Simplified auto-compound harvest logic
function harvest() external {
    // 1. Claim pending rewards from the strategy
    uint256 rewards = strategy.claimRewards();

    // 2. Deduct performance fee (e.g. 4.5% to vault operator)
    uint256 fee = (rewards * performanceFee) / 10000;
    rewardToken.transfer(feeRecipient, fee);

    // 3. Swap remaining rewards to base asset via DEX
    uint256 netRewards = rewards - fee;
    uint256 baseReceived = router.swap(
        rewardToken, baseToken, netRewards
    );

    // 4. Redeposit into the yield strategy
    strategy.deposit(baseReceived);

    // Share price increases automatically:
    // pricePerShare = totalAssets() / totalShares()
}

Anyone can call the harvest function on most auto-compounding vaults. Many protocols incentivize callers with a small bounty (typically 0.01-0.05% of harvested rewards) to ensure harvests happen regularly without relying on a centralized operator.

Compounding Math

The relationship between APR and APY is governed by the compounding frequency. The formula is:

APY = (1 + APR / n)^n - 1

Where:
  APR = annual percentage rate (simple interest)
  n   = number of compounding periods per year

Example with 50% APR:
  Annual   (n=1):     APY = (1 + 0.50/1)^1     - 1 = 50.00%
  Monthly  (n=12):    APY = (1 + 0.50/12)^12   - 1 = 63.21%
  Daily    (n=365):   APY = (1 + 0.50/365)^365 - 1 = 64.82%
  Hourly   (n=8760):  APY = (1 + 0.50/8760)^8760 - 1 = 64.87%

The marginal benefit of more frequent compounding follows a curve of diminishing returns. Moving from annual to daily compounding at 50% APR adds nearly 15 percentage points of yield. Moving from daily to hourly adds only 0.05 percentage points. This is why most auto-compounding vaults target a daily or multi-daily harvest frequency rather than continuous compounding: the gas cost of more frequent harvests outweighs the negligible extra yield.

Gas Cost Optimization

The profitability of each compounding event depends on whether the additional yield exceeds the gas cost of executing the harvest transaction. This creates an optimization problem:

Optimal compounding frequency:
  Compound if: additional_yield > gas_cost

  additional_yield = vault_tvl * (APR / n)
  gas_cost = harvest_gas_units * gas_price

Example:
  Vault TVL: $1,000,000
  APR: 20%
  Harvest gas cost: $5 (on L2) or $50 (on Ethereum mainnet)

  Daily yield increment: $1,000,000 * 0.20 / 365 = $548/day
  → Compounding daily is profitable on both L1 and L2

  But for a $10,000 vault at 5% APR:
  Daily yield increment: $10,000 * 0.05 / 365 = $1.37/day
  → Profitable on L2 ($5 gas), not on L1 ($50 gas)

Auto-compounding vaults solve this by pooling deposits. Even if an individual depositor holds only $100, the vault might hold $10 million in total. The gas cost of one harvest transaction is shared across all depositors proportionally, making frequent compounding viable for everyone in the pool.

Major Auto-Compounding Protocols

Several protocols have built their core product around automating the compounding process:

ProtocolChainsPerformance FeeApproach
Yearn FinanceEthereum, Arbitrum, Polygon10% of yieldStrategy vaults with professional strategists writing optimized harvest logic
Beefy Finance25+ chains4.5% of yieldPure auto-compounding focus: wraps existing farm positions with automated harvest cycles
Convex FinanceEthereum16% of yieldSpecializes in Curve LP auto-compounding with boosted CRV rewards
Harvest FinanceEthereum, Arbitrum, Base10% of yieldAggregates and auto-compounds across lending and LP strategies

Performance fees are the primary revenue model for auto-compounding protocols. They are deducted from harvested rewards before reinvestment, meaning depositors only pay fees on profits earned, not on principal.

Auto-Compounding vs Manual Compounding

Without an auto-compounding vault, a user must manually execute the compound cycle: claim rewards, swap to the desired token, redeposit into the position. This comparison illustrates the tradeoffs:

FactorManual CompoundingAuto-Compounding Vault
Gas costsPaid individually per transactionSocialized across all vault depositors
FrequencyLimited by user attention and gas economicsOptimized algorithmically, often daily or more
FeesNo performance fee4.5-20% of harvested yield
Optimal forLarge positions where individual gas costs are negligibleSmall-to-medium positions or users who want passive exposure
CustodyTokens stay in user's direct controlTokens are held by the vault smart contract
Tax eventsEach claim and swap is a taxable eventMay be treated as fewer events (varies by jurisdiction)

For large depositors, manual compounding can be more cost-effective because the performance fee on large positions may exceed the gas costs of self-managed harvests. For most retail users, the socialized gas savings and optimized frequency of auto-compounding vaults more than offset the performance fee.

Use Cases

LP Token Compounding

The most common auto-compounding use case involves liquidity pool positions. When a user provides liquidity to a DEX like Uniswap or Curve, they often earn reward tokens (UNI, CRV) on top of trading fees. An auto-compounding vault claims these reward tokens, swaps them for more LP tokens, and adds them back to the pool.

Staking Reward Compounding

Staking rewards from proof-of-stake networks or liquid staking protocols can be auto-compounded. Rather than letting staking rewards accumulate as separate claimable tokens, a vault restakes them automatically to increase the staked principal over time.

Lending Protocol Compounding

Lending protocols like Aave and Compound distribute governance token incentives alongside interest. Auto-compounding vaults harvest these incentive tokens and convert them to the deposited asset, boosting the effective lending yield beyond what the protocol offers natively.

Yield-Bearing Stablecoins

Some yield-bearing stablecoins use auto-compounding internally. The stablecoin's backing assets (Treasury bills, lending positions, or LP tokens) generate yield that is automatically reinvested to increase the stablecoin's redemption value. This is the mechanism behind rebasing stablecoins and tokens like Aave's aTokens, where the balance in a user's wallet grows over time. For a deeper look at how stablecoin yield works, see yield-bearing stablecoins explained.

Risks and Considerations

Smart Contract Risk

Auto-compounding vaults add a layer of smart contract risk on top of the underlying protocol. Users must trust not only the base yield source (lending protocol, DEX, staking contract) but also the vault contract itself. A vulnerability in the vault's harvest logic, swap routing, or access controls could lead to loss of funds. Multiple audits reduce but do not eliminate this risk.

Impermanent Loss Amplification

When auto-compounding LP positions, the vault continuously adds to the liquidity position. If the underlying token pair experiences significant price divergence, impermanent loss applies to a progressively larger principal. The compounded gains may be partially or fully offset by impermanent loss in volatile market conditions.

Slippage on Reward Swaps

Each harvest requires swapping reward tokens on a DEX. Large harvests can suffer from slippage, especially for reward tokens with thin liquidity. If the vault harvests $100,000 in reward tokens but the DEX only has $200,000 in liquidity for that pair, the swap could lose 5-10% to price impact. Well-designed vaults mitigate this by splitting large swaps across multiple routes or using DEX aggregators.

Performance Fee Drag

Performance fees compound against the depositor over time. A 10% performance fee does not simply reduce yield by 10%: it reduces the principal that compounds in future periods. Over a year, a 10% fee on a 50% APR position reduces the effective APY from 64.8% to roughly 56.9%. Comparing vaults requires accounting for both the gross APR and the fee structure.

Reward Token Price Risk

Auto-compounding vaults sell reward tokens immediately upon harvest. If a reward token appreciates significantly after being sold, the vault depositor misses that upside. Conversely, if reward tokens trend toward zero (a common pattern for inflationary governance tokens), the auto-sell strategy protects depositors from holding a depreciating asset.

Why It Matters

Auto-compounding is one of the clearest examples of DeFi improving on traditional yield mechanics. In conventional finance, compound interest is a default feature of savings accounts and fixed-income products. In DeFi, the separation between earning rewards and reinvesting them creates friction that auto-compounding vaults eliminate.

For stablecoin holders and Bitcoin-native yield seekers, auto-compounding is particularly relevant. Protocols in the Bitcoin Layer 2 ecosystem are beginning to offer yield strategies that can benefit from automated compounding. As the stablecoin yield landscape matures, auto-compounding infrastructure will be essential for making yield accessible to users who prefer a hands-off approach.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.