Back to Learn
DeFi7 min·

Inside Apyee Vault: How Auto-Rebalancing Stablecoin Yield Actually Works

A walkthrough of the Keeper logic that moves USDC between Aave, Compound, Morpho, Spark, and Fluid across 4 chains — with the 15% fee model laid bare.

Most stablecoin vaults sell themselves as "set and forget". What they actually do under the hood — when they rebalance, why, who pays the gas — is rarely spelled out. Here is what Apyee does, exactly.

The basic architecture

When you deposit USDC into the Apyee Vault, three things happen in one transaction:

  1. USDC enters the vault smart contract (ERC-4626 standard)
  2. The vault mints you apUSDC share tokens
  3. The Keeper, an off-chain service, sees the new deposit and queues the next allocation cycle

apUSDC is not 1:1 with USDC. It is a share token whose price grows as the vault earns yield. One apUSDC today might be worth 1.0006 USDC; in a year it might be 1.04. You hold the shares; the underlying USDC stays in the vault.

How allocation gets decided

Every 5 minutes the Keeper runs a cycle:

  1. Read APY from each strategy (Aave V3, Compound V3, Morpho, Spark, Fluid). Sources: DefiLlama 7-day average as primary, on-chain currentAPY() as fallback.
  2. Filter strategies with APY ≥ 3%. If fewer than two pass, fill with the next-highest until we have at least two. Never put 100% in one place.
  3. Calculate ideal allocation weighted by APY: a strategy paying 6% gets twice the weight of a 3% strategy. Cap any single strategy at 40% — even a great-looking pool never gets the whole portfolio.
  4. Reserve 10% idle for instant withdrawals. The vault always keeps a buffer so you can pull out without triggering a chain of strategy unwinds.

This means: if Aave is paying 5.5% and Spark is paying 4.8%, both get capital. The Aave allocation will be larger because its APY is higher, but Spark still gets a share. Concentration risk gets dampened.

When and why rebalances happen

A rebalance only fires when all four gates pass:

GateRule
APY spreadNew strategy must pay ≥ 0.1% more than the one we are leaving
Gas ROIExpected annual gain must exceed gas cost × 3
Minimum sizeMove size ≥ $500 (no dust rebalances)
CooldownAt least 6 hours since the last rebalance on that chain

The rebalance is also direction-locked: capital only moves from lower-APY to higher-APY. The reverse — moving capital to a lower yield — is never executed; it implies a bug in the input data and gets aborted with an alert to the team.

What you actually pay

Apyee charges a 15% performance fee on profits only. The mechanism:

  • The vault tracks each user's deposit basis (principal)
  • At each Keeper harvest cycle (roughly daily), 15% of the profit accrued since the last harvest is taken
  • The fee is realized through share-price dilution — the vault mints new shares to the treasury equal to 15% of accumulated yield, which slightly dilutes existing shareholders
  • You see the effect as: your share count stays the same, but the price-per-share grows 15% slower than the gross strategy yield

No deposit fee. No withdrawal fee. No fee on principal. If the vault loses money on a depeg or exploit, no fee is charged on the loss.

What happens in an emergency

The Keeper watches signals continuously. The logic is two-tier:

Confirmed-exploit triggers — any one of these fires an immediate withdrawal:

  • PeckShield / BlockSec / Forta security alert with a verified exploit
  • The underlying protocol's own Paused() event
  • A manual multi-sig decision

Ambient signals — these fire a withdrawal only when two or more occur within a 10-minute window:

  • Stablecoin depeg of ±2% or more from $1
  • Underlying protocol TVL drops 20%+ in one hour
  • A single transaction of $50M+ in unusual borrow activity
  • Gas spikes to 5× the rolling baseline

A single ambient signal sends an alert to the team but does not move capital. The reasoning: any one signal can be a false positive (a whale withdrawing $50M does not mean Aave is hacked). When two unrelated signals fire together, the noise hypothesis dies.

The trade-off you are making

Apyee saves you from babysitting yield across 4 chains and 15 strategies. In exchange:

  • You give up 15% of profits
  • You hold a share token instead of raw USDC
  • You inherit the vault's smart-contract risk on top of the underlying protocols' risk

If you have less than $5,000 in stablecoins, the savings probably do not justify any aggregator — the gas to move $1,000 once cancels half a year of optimization. For positions over $10,000, where missing a 50-basis-point rotation costs more than $50 a year, auto-rebalancing tends to pay for itself within the first quarter.

Apyee's V2 Vault contracts are audited by Soken (PASS, 91/100) — an audit lowers risk but is not a guarantee. Deposits are subject to a per-address cap while TVL grows. Read Terms and Privacy before depositing.