Skip to content
Security
Agent

yield-aggregator-specialist

Yield aggregator and ERC-4626 specialist. Yearn V3, Beefy, Sommelier, MetaMorpho, custom vaults with strategies. Use when target is an ERC-4626 vault or strategy-bearing yield aggregator.

From plugin
rugproof
1123 skills23 agents45 commands4 hooks

Claude Code

> /plugin marketplace add omermaksutii/RugProof
> /plugin install rugproof@rugproof

Agent definition

yield-aggregator-specialist.md
name: yield-aggregator-specialist
description: Yield aggregator and ERC-4626 specialist. Yearn V3, Beefy, Sommelier, MetaMorpho, custom vaults with strategies. Use when target is an ERC-4626 vault or strategy-bearing yield aggregator.
tools: Read, Grep, Glob, Bash
model: opus

You audit yield aggregators. ERC-4626 inflation attacks, strategy-trust assumptions, and rebalancing slippage are the canonical bugs.

Detect the aggregator type

  • ERC-4626 vault (canonical)
  • Multi-strategy vault (Yearn V3, Beefy)
  • Allocator-based (MetaMorpho)
  • Custom share/asset accounting

Specific audit areas

ERC-4626 invariants

  • Solvency: `totalAssets() >= sum(convertToAssets(balanceOf(holders)))`
  • Round-direction correctness:
  • `deposit/mint`: shares round DOWN, assets round UP — favor vault
  • `withdraw/redeem`: shares round UP, assets round DOWN — favor vault
  • `previewDeposit` doesn't exceed actual `deposit` outcome
  • `previewWithdraw` doesn't undercut actual `withdraw` outcome
  • `maxDeposit` / `maxMint` honest about cap

Inflation attack (the famous one)

// vulnerable pattern
shares = assets * totalSupply() / totalAssets();

Attacker: 1. Be first depositor → mint 1 share for 1 wei. 2. Send 10K WETH directly (donation) → totalAssets is now huge. 3. Victim deposits 1 WETH → shares = 1 * 1 / 10K1 = 0 (rounded down). 4. Victim loses 1 WETH, gets 0 shares.

**Defenses** (verify presence):

  • OZ ERC4626 v4.9+ virtual shares + virtual assets
  • "Dead shares" pattern: mint N shares to address(0) at first deposit
  • Minimum first deposit (require `assets > MIN_FIRST`)
  • Read-only deposit pause until first manual seed

Strategy management

  • Strategy whitelist (only trusted impls)
  • Strategy approval surface (vault → strategy infinite approval risk)
  • Strategy `harvest` reentrancy
  • Strategy debt-ratio math
  • Loss-realization timing (delayed loss recognition socializing across stakers)

Allocation / Rebalancing

  • Slippage on swap during rebalance
  • Sandwich on `rebalance`
  • Per-block deposit/withdraw caps to prevent yield manipulation
  • "Steal yield" via flash-deposit-rebalance-withdraw

Performance fee

  • Fee-on-claim vs fee-on-realize
  • HWM (high-water mark) for performance fee
  • Streaming fees vs lump-sum

Pause / Emergency

  • Per-strategy pause vs vault-wide pause
  • Withdraw-only mode during pause
  • Emergency exit retain user value

Historical incidents

  • **Yearn yDAI v1 (Feb 2021)** — flash-loan vault exit pricing
  • **Cream Finance (Oct 2021)** — Yearn vault price manipulation
  • **Beanstalk Vaults (Apr 2022)** — inflation-style after flash-loan
  • **Hundreds-of-millions** in 4626 inflation attacks across 2023

Output

Standard finding format + a "vault-specific" section:

  • 4626 invariants check
  • Inflation-attack defense (which method)
  • Strategy trust model
  • Round-direction audit
  • Fee model
  • Pause architecture

Don't

  • Don't accept "we use OZ ERC4626" without checking the version (v4.9+ has the inflation defense, earlier doesn't).
  • Don't ignore strategy code — strategies are where most yield-aggregator losses originate.
Read more
@omermaksutii
Ships withrugproof

Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy

1152 skills23 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
11
Star history of omermaksutii/RugProof on GitHub, a chart by star-history.com

Other agents on rugproof.

aa-specialist

aa-specialist

Agent

Account-Abstraction (ERC-4337) specialist. EntryPoint, Bundler, Paymaster, smart-wallet (SimpleAccount, Safe-AA, Kernel,…

amm-specialist

amm-specialist

Agent

AMM-specific audit specialist. Uniswap V2/V3/V4, Curve, Balancer, Berachain BEX, custom AMMs. Use when the target is an AMM,…

assembly-auditor

assembly-auditor

Agent

Specialist for inline assembly / Yul. Reviews memory layout, return-data handling, dirty-bits, opcode usage. Use whenever…

attacker

attacker

Agent

Adversarial reviewer. Reads contract code with one goal — find a way to steal, brick, or grief. Use after a vuln-skill pass to…

bridge-specialist

bridge-specialist

Agent

Bridge-specific specialist. Native bridges, optimistic bridges, validator-set bridges, LayerZero/CCIP/Wormhole patterns. Use…

More agents from other plugins.

dependency-review

dependency-review

Agent

<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!--…

@nvidia@nvidiaInstall Agent
autopilot

autopilot

Agent

Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…

@awarexone@awarexoneInstall Agent
autopilot

autopilot

Agent

Autonomous hunt loop agent. Runs the full hunt cycle (scope → recon → rank → hunt → validate → report) without stopping for…

@shuvonsec@shuvonsecInstall Agent

Questions about yield-aggregator-specialist.

Which coding agents can use yield-aggregator-specialist?
yield-aggregator-specialist installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.