GRIMOIRE · FARMING · COMPOUND
Keeper of the Vault
Auto-compounds farming positions on impact-aware schedules. Sells emissions into principal without moving the market against itself.
What it does
Farming positions accrue reward tokens that must be claimed, sold, and reinvested to compound. Do it too often and gas eats the gain; do it too rarely and the rewards depreciate or get diluted. The Keeper times it correctly.
Strategy
- Every
harvestEveryHours, read the claimable rewards. - If claimable value <
minHarvestUsd, skip. - Claim, then route the sale through the best of the permitted aggregators with impact ≤
maxImpactBps. - Re-deposit the proceeds into the underlying position.
For positions with vote-escrow accruals (e.g. veAERO), the Keeper respects an optional lockShare that re-locks a fraction of rewards rather than selling them.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
harvestEveryHours | 12 | Cadence for the harvest sweep. |
minHarvestUsd | 10 | Skip if claimable value is below this. |
maxImpactBps | 50 | Cap on aggregator impact for the sale. |
lockShare | 0 | Optional fraction of rewards to re-lock instead of sell. |
Venues
- Aerodrome — primary Base farm venue.
- Velodrome — supported for cross-chain Optimism farms.
- Extra Finance — leveraged farm support.
Aggregators used for the sell leg:
Risks
Example intent
typescriptimport { defineIntent, AERO, BASE } from "@magicscodes/sdk";
import { keeperOfTheVault } from "@magicscodes/spells";
export const aeroFarmIntent = defineIntent({
goal: "Compound AERO emissions into the underlying position",
budget: { positions: ["aerodrome:vAMM-WETH-AERO"] },
bounds: {
chains: [BASE],
sellVenues: ["1inch", "cowswap"],
maxImpactBps: 50,
minHarvestUsd: 25,
},
cadence: {
harvestEveryHours: 12,
notifyOn: ["harvest", "halt"],
},
agentHint: keeperOfTheVault,
});