Skip to main content
Glama

evm_get_apy

Calculate total APY/APR for DeFi pools and vaults, combining base trading-fee yield with reward token incentives to compare yield opportunities across EVM chains and protocols.

Instructions

Calculate APY/APR for DeFi pools and vaults with reward token analysis.

Computes Annual Percentage Yield including base APY from trading fees and bonus APY from reward tokens. Essential for comparing yield opportunities across protocols and chains.

CRITICAL RULES:

  • Read-only operation (no gas cost)

  • APY fluctuates based on pool activity

  • Includes both base yield and reward incentives

  • Historical data may not predict future returns

  • Different protocols calculate APY differently

PARAMETERS:

  • chain: EVM chain to query (required)

    • Protocol must be deployed on this chain

  • protocol: DeFi protocol name (required)

    • Examples: "uniswap", "aave", "curve", "beefy"

    • Case-insensitive

  • poolAddress: Pool or vault address (required)

    • Format: 0x followed by 40 hex characters

    • Must be valid pool contract

  • includeRewards: Include reward token APY (optional, default: true)

    • true: Returns total APY (base + rewards)

    • false: Returns only base trading fee APY

EXAMPLES: ✅ Get Uniswap V3 pool APY: {chain: "ethereum", protocol: "uniswap", poolAddress: "0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8", includeRewards: true}

✅ Check Beefy vault yield: {chain: "polygon", protocol: "beefy", poolAddress: "0x...", includeRewards: true}

✅ Base APY only (no rewards): {chain: "avalanche", protocol: "traderjoe", poolAddress: "0x...", includeRewards: false}

❌ Invalid - wrong protocol name: {chain: "polygon", protocol: "uniswapv2", ...} // Use "uniswap"

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: • totalAPY: Combined APY (base + rewards) • baseAPY: APY from trading fees • rewardAPY: APY from reward tokens • projectedYields: Object with daily/weekly/monthly/annual estimates • lastUpdated: Timestamp of calculation • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Confusing APY with APR (APY includes compounding)

  • Not accounting for impermanent loss

  • Assuming APY is guaranteed (it fluctuates)

  • Comparing APY across different risk levels

USE CASES:

  • Compare yield opportunities

  • Calculate projected earnings

  • Monitor pool performance

  • Optimize capital allocation

  • Track yield farming ROI

APY CALCULATION METHODS:

  • Trading Fees: Based on 24h volume and liquidity

  • Reward Tokens: Uses emission rate and token price

  • Vault APY: Measures pricePerShare growth

  • Compound APY: Accounts for auto-compounding

PROTOCOLS SUPPORTED:

  • DEXs: Uniswap, SushiSwap, Curve, PancakeSwap, QuickSwap

  • Lending: Aave, Compound, Venus, Benqi

  • Vaults: Beefy, Yearn, Harvest, Autofarm

  • Staking: Various protocol-specific farms

APY vs APR:

  • APR: Simple annual rate (no compounding)

  • APY: Effective annual rate (includes compounding)

  • APY = (1 + APR/n)^n - 1 (n = compounds per year)

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>",
      "protocol": "<protocol>",
      "poolAddress": "<poolAddress>"
    },
    "name": "evm_get_apy"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query
protocolYesDeFi protocol name
poolAddressYesPool or vault address
includeRewardsNoInclude reward token APY (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real behavior: read-only with no gas cost, APY fluctuates with pool activity, historical data is not predictive, protocols compute APY differently, and it documents the calculation methods (fees, emissions, pricePerShare). That is substantive. It loses a point because the gas-consideration section ('Always check gas price before executing transactions') and the Linux notes are irrelevant to a read-only yield query and muddy the behavioral picture.

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 core content is front-loaded and sectioned, but the definition is heavily padded with material that does not earn its place: per-chain gas cost commentary, faucet and testnet-token notes, and an entire 'LINUX-SPECIFIC NOTES' block about apt/yum/xdg-open that has nothing to do with querying APY. These sections inflate the text and compete with the actionable rules.

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 four-parameter read-only tool with no output schema, the description supplies an OUTPUT STRUCTURE block (totalAPY, baseAPY, rewardAPY, projectedYields, lastUpdated, executionTime), worked examples, and common-mistake warnings, which is enough to call it correctly. The completeness is undermined only by the irrelevant gas and Linux content rather than by missing essentials.

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

Parameters5/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 genuine meaning beyond the terse schema strings: protocol names are case-insensitive with concrete examples, poolAddress must be 0x plus 40 hex characters and a valid pool contract, the protocol must be deployed on the given chain, and includeRewards is spelled out as total APY versus base trading-fee APY only.

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 opening sentence states a specific verb and resource: 'Calculate APY/APR for DeFi pools and vaults with reward token analysis.' An agent immediately knows this is a yield-metric computation rather than raw pool data. It does not differentiate itself from the sibling evm_get_pool_info, which is the most plausible confusion point.

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?

The 'USE CASES' block gives contexts (compare yields, projected earnings, monitor performance) that imply when to reach for this tool. However, there is no explicit when-not-to-use guidance and no sibling is named as an alternative, so the agent must infer that evm_get_pool_info or evm_get_farming_rewards cover adjacent needs.

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