Skip to main content
Glama

evm_compound_rewards

Automatically harvest pending DeFi farming rewards and re-stake them in the same vault or pool to compound returns across supported EVM chains.

Instructions

Auto-compound DeFi yield farming rewards for optimized returns.

Automatically harvests pending rewards and re-stakes them in the same vault/pool to maximize compound interest. Supports major yield aggregators across all 7 EVM chains.

CRITICAL RULES:

  • Requires gas in native token for transaction

  • May require multiple protocol interactions (harvest + stake)

  • Some protocols auto-compound (no action needed)

  • Minimum reward threshold prevents dust compounding

  • Transaction irreversible once confirmed

PARAMETERS:

  • chain: EVM chain to execute on (required)

    • Protocol must be deployed on this chain

    • Requires gas in native token

  • vaultOrPool: Vault or pool address (required)

    • Format: 0x followed by 40 hex characters

    • Must be valid farming contract

  • privateKey: Transaction signer's private key (required, KEEP SECRET)

    • Must be address with staked position

    • Never expose, share, or log

  • strategy: Compound strategy (optional, default: auto_compound)

    • claim_and_restake: Harvest rewards then deposit

    • auto_compound: Call protocol's compound function

    • harvest_only: Just claim rewards without re-staking

  • minReward: Minimum reward to compound (optional)

    • Prevents compounding dust amounts

    • In reward token units

    • Example: "0.1" to only compound if rewards > 0.1

EXAMPLES: ✅ Auto-compound Beefy vault: {chain: "polygon", vaultOrPool: "0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE", privateKey: "0xac0974...", strategy: "auto_compound"}

✅ Harvest and re-stake on Yearn: {chain: "ethereum", vaultOrPool: "0x...", privateKey: "0x...", strategy: "claim_and_restake", minReward: "0.5"}

✅ Just harvest rewards: {chain: "avalanche", vaultOrPool: "0x...", privateKey: "0x...", strategy: "harvest_only"}

❌ Invalid - insufficient gas: {chain: "polygon", ...} // No POL for gas

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating operation success • transactionHash: Transaction hash for tracking • rewardsHarvested: Amount of rewards claimed • rewardsCompounded: Amount re-staked • compoundBoost: Percentage increase in position • gasUsed: Gas consumed • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Not having gas for transaction

  • Compounding dust amounts (use minReward)

  • Wrong strategy for protocol

  • Not waiting for pending transactions

USE CASES:

  • Maximize yield farming returns

  • Automate reward management

  • Optimize compound frequency

  • Batch harvest from multiple pools

SUPPORTED PROTOCOLS:

  • Beefy Finance: Auto-compounding vaults

  • Yearn Finance: Yield optimization

  • Harvest Finance: Automated farming

  • Autofarm: Multi-chain yield aggregator

  • Adamant Finance: Polygon vaults

  • Benqi: Avalanche lending/staking

  • Yield Yak: Avalanche auto-compounder

  • Alpaca Finance: Leveraged yield farming

  • Jones DAO: Arbitrum strategies

GAS COSTS:

  • Simple compound: 100,000-150,000 gas

  • Claim + restake: 200,000-300,000 gas

  • Ethereum Sepolia: ~0.002-0.003 ETH

  • Polygon: ~0.00005 POL (very cheap)

  • BSC: ~0.0001 BNB

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "vaultOrPool": "<vaultOrPool>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_compound_rewards"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to execute on
strategyNoCompound strategy (default: auto_compound)
minRewardNoMinimum reward amount to compound
privateKeyYesPrivate key for transaction
vaultOrPoolYesVault or pool address to compound

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full disclosure burden, and it does so thoroughly. It warns that transactions are irreversible once confirmed, that gas in the native token is required, that some protocols auto-compound, that multiple protocol interactions may be needed, and that a minimum reward threshold prevents dust compounding. It also gives per-chain gas estimates and expected gas ranges per strategy.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core behavior, but it is padded with redundant sections. Gas costs appear in three places, and the 'SUPPORTED EVM CHAINS' list repeats the schema enum. It also contains irrelevant Linux notes ('apt', 'xdg-open') that have nothing to do with compounding DeFi rewards.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating multi-chain transaction tool with no annotations and no output schema, the description covers what an agent needs: prerequisites, per-chain gas context, strategy semantics, failure modes, and an inline output structure. The irrelevant Linux section and the duplicated gas tables slightly reduce clarity without leaving functional gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema. It explains what each strategy enum value actually does (claim_and_restake, auto_compound, harvest_only), gives the units and a concrete example for minReward ('0.1'), and clarifies that vaultOrPool must be a valid farming contract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: it 'automatically harvests pending rewards and re-stakes them in the same vault/pool.' It also names concrete supported protocols (Beefy, Yearn, Harvest). However, it never explicitly differentiates itself from the sibling evm_claim_farming_rewards, even though its harvest_only strategy overlaps with that tool's purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Use cases ('maximize yield farming returns'), common mistakes, and the meaning of the three strategy values provide implied guidance on how to call it. What is missing is an explicit statement about when to use this tool versus evm_claim_farming_rewards or evm_get_farming_rewards, and no exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools