Skip to main content
The keeper is a background service that monitors all LP vaults and executes position management operations. It runs continuously, checking vault status every 60 seconds.

What the Keeper Does

On each cycle, the keeper evaluates every vault and takes action based on the current state:

1. No Position + Idle USDC

If the vault has USDC but no active position (e.g. fresh vault or after emergency close), the keeper creates an initial position.

2. Out of Range

If the current pool price has moved outside the position’s tick range, the keeper rebalances:
  • Exits the current position entirely
  • Recalculates the optimal tick range around the current price
  • Creates a new position and stakes in the gauge

3. Compound Rewards

If accumulated AERO rewards exceed the vault’s compound threshold, the keeper triggers a compound:
  • Claims AERO from the gauge
  • Takes the 10% performance fee
  • Swaps AERO to USDC
  • Adds USDC (plus any trading fees) back into the position

4. Idle USDC Deposit

If the vault has idle USDC greater than 5% of TVL (from new deposits or collected fees), the keeper adds it to the existing position without requiring AERO rewards.

Staking vs Holding

Not all pools benefit from gauge staking. The keeper evaluates whether staking the LP position in the Aerodrome gauge or simply holding it for trading fees produces a better return.
  • Stake in gauge — when AERO emissions APR exceeds the cost of the 10% performance fee and compounding overhead. Most pools with active gauge incentives fall into this category.
  • Hold for trading fees — when the pool generates strong trading fee revenue but has low or no gauge emissions. In this case, keeping the position unstaked avoids the performance fee entirely and compounds trading fees at 0%.
The keeper makes this decision per vault based on current emission rates, pool volume, and fee APR. If conditions change (e.g. gauge emissions increase or decrease), the keeper adjusts accordingly on the next cycle.

Keeper Architecture

The keeper is a dedicated service, separate from the yield agent:
ComponentDescription
Vault MonitorReads all vault states from the factory contract
RebalancerHandles position exit/entry with tick range calculation
CompounderClaims rewards, processes fees, adds liquidity
Database LoggerRecords all operations for monitoring

Keeper Permissions

The keeper wallet is set as the keeper role on each vault contract. Only the keeper can call:
  • rebalance(slippageBps) — exit and re-enter position
  • compound(slippageBps) — claim rewards and add liquidity
  • depositIdle(slippageBps) — add idle USDC to position
  • emergencyClose(slippageBps) — exit position entirely
The keeper cannot withdraw user funds, change vault settings, or perform any admin operations.

Monitoring

All keeper operations are logged to a database with:
  • Vault address
  • Operation type (rebalance, compound, deposit_idle, emergency_close)
  • Transaction hash
  • Gas used
  • Status (completed/failed)
  • Error details (if failed)