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%.
Keeper Architecture
The keeper is a dedicated service, separate from the yield agent:| Component | Description |
|---|---|
| Vault Monitor | Reads all vault states from the factory contract |
| Rebalancer | Handles position exit/entry with tick range calculation |
| Compounder | Claims rewards, processes fees, adds liquidity |
| Database Logger | Records all operations for monitoring |
Keeper Permissions
The keeper wallet is set as thekeeper role on each vault contract. Only the keeper can call:
rebalance(slippageBps)— exit and re-enter positioncompound(slippageBps)— claim rewards and add liquiditydepositIdle(slippageBps)— add idle USDC to positionemergencyClose(slippageBps)— exit position entirely
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)
