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
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | EVM chain to query | |
| protocol | Yes | DeFi protocol name | |
| poolAddress | Yes | Pool or vault address | |
| includeRewards | No | Include reward token APY (default: true) |