Yield Aggregator Smart Contract

Yield Aggregator Smart Contract

Solidity / Aave / Compound / OpenZeppelin

Overview

YieldAggregator is a DeFi smart contract that dynamically allocates user deposits (in WETH) to either Aave or Compound based on which offers the best yield. It supports rebalancing, fee structures, and emergency withdrawals — all governed by roles.

  • Deposits WETH and allocates based on current APYs.
  • Switches between Aave and Compound automatically.
  • Supports annual management and performance fees.
  • Rebalance and emergency withdrawal access for admins.
  • SafeERC20 used for secure transfers, with Foundry tests.

Hardhat version available: View here

Technologies

Solidity

Aave V3

Compound

OpenZeppelin

Foundry

SafeERC20

Back