Skip to main content
Glama

evm_stake_lp

Stake LP tokens in EVM yield farms to earn farming rewards. Automatically approves tokens, deposits them into staking contracts, and returns transaction details.

Instructions

Stake LP tokens in yield farms to earn farming rewards.

Deposits liquidity provider (LP) tokens into farming contracts to earn additional yield beyond trading fees. Automatically approves LP tokens before staking.

CRITICAL RULES:

  • Must hold LP tokens to stake

  • Requires gas in native token

  • Must approve LP tokens for farm contract

  • Staked LP tokens cannot be used elsewhere

  • Transaction irreversible once confirmed

PARAMETERS:

  • chain: EVM chain to execute on (required)

    • Farm must be deployed on this chain

    • Requires gas in native token

  • protocol: Yield farming protocol (required)

    • Examples: "uniswap", "sushiswap", "curve", "pancakeswap"

    • Must support the LP token

  • lpToken: LP token address to stake (required)

    • Format: 0x followed by 40 hex characters

    • Must be valid ERC-20 LP token

  • amount: Amount of LP tokens to stake (required)

    • Human-readable format: "100" = 100 LP tokens

    • Must have sufficient balance

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

    • Must be address holding LP tokens

    • Never expose, share, or log

  • poolId: Pool/Farm ID (optional)

    • Required for protocols with multiple farms

    • Check protocol docs for pool IDs

EXAMPLES: ✅ Stake LP tokens on SushiSwap: {chain: "polygon", protocol: "sushiswap", lpToken: "0x...", amount: "100", privateKey: "0xac0974...", poolId: 0}

✅ Stake on Curve (no poolId): {chain: "ethereum", protocol: "curve", lpToken: "0x...", amount: "50.5", privateKey: "0x..."}

✅ Stake on PancakeSwap: {chain: "bsc", protocol: "pancakeswap", lpToken: "0x...", amount: "1000", privateKey: "0x...", poolId: 12}

❌ Invalid - insufficient LP tokens: {amount: "1000"} // Only have 100 LP tokens

❌ Invalid - missing poolId for multi-pool protocol: {chain: "polygon", protocol: "sushiswap", lpToken: "0x...", amount: "100", privateKey: "0x..."} // Need poolId

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 staking success • transactionHash: Transaction hash for tracking • lpTokenStaked: Amount of LP tokens staked • farmingContract: Farm contract address • estimatedAPY: Expected farming APY • gasUsed: Gas consumed • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Not having gas for transaction

  • Forgetting LP tokens need approval

  • Wrong poolId for farm

  • Staking when better yields available elsewhere

  • Not tracking staked positions

USE CASES:

  • Maximize LP token yield

  • Earn farming rewards

  • Participate in liquidity mining

  • Access protocol governance tokens

  • Bootstrap new DEX pairs

SUPPORTED PROTOCOLS:

  • Uniswap: V2 and V3 farming

  • SushiSwap: MasterChef farms

  • Curve: Gauge staking

  • QuickSwap: Dragon's Lair

  • Balancer: Gauge staking

  • TraderJoe: MasterChef farms

  • Pangolin: PNG rewards

  • PancakeSwap: Syrup pools

  • Biswap: Farming pools

  • Camelot: Nitro pools

  • BaseSwap: Farming

  • Aerodrome: Gauges

STAKING PROCESS:

  1. Check LP token balance

  2. Approve LP tokens for farm

  3. Call stake/deposit function

  4. Rewards start accruing immediately

  5. Track position in farm

GAS COSTS:

  • Approval: 45,000-50,000 gas

  • Staking: 80,000-120,000 gas

  • Total: ~125,000-170,000 gas

  • Ethereum Sepolia: ~0.002-0.003 ETH

  • Polygon: ~0.00005 POL

  • BSC: ~0.0001 BNB

REWARDS:

  • Accrued per block or second

  • Claimable anytime

  • May be auto-compounded

  • Often protocol governance tokens

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>",
      "lpToken": "<lpToken>",
      "amount": "<amount>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_stake_lp"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to execute on
amountYesAmount of LP tokens to stake
poolIdNoPool/Farm ID for protocols with multiple pools
lpTokenYesLP token address to stake
protocolYesYield farming protocol (e.g., uniswap, sushiswap)
privateKeyYesPrivate key for transaction

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses that LP approval happens automatically, that the transaction is irreversible once confirmed, that staked LP tokens become unavailable elsewhere, that all chains are testnets with no real value, and it gives a step-by-step staking flow. It stops short of stating error/retry behavior or whether partial failures are rolled back.

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?

Strong front-loading with purpose and CRITICAL RULES first, but the body is heavily padded: full per-chain block-time table, gas cost tables, 12-protocol list, rewards section, and duplicated gas warnings. Most damaging, the trailing 'Running on Linux' and package-manager notes are entirely unrelated to staking and add genuine noise to an agent's context.

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 6-parameter, 5-required mutation tool with no annotations and no output schema, the definition covers gas economics, chain support, protocol support, an explicit output field list, and failure modes, so an agent has nearly everything needed. The unrelated Linux/tooling section is contamination rather than a completeness gap, but it slightly dilutes an otherwise thorough definition.

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 already 100%, so the baseline is 3, but the description genuinely adds meaning: amount is defined as human-readable decimal ('100' = 100 LP tokens), poolId is flagged as conditionally required for multi-pool protocols with a failing example, and privateKey is marked secret and tied to the LP-holding address. The worked examples with mixed protocols/chains further anchor parameter values.

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?

States a specific verb and resource: 'Stake LP tokens in yield farms' and 'Deposits liquidity provider (LP) tokens into farming contracts', which is clearly distinct from a plain token-stake or unstake operation. It never names a sibling (evm_stake_tokens, evm_unstake_lp) explicitly, so the differentiation is inferable rather than stated.

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?

Preconditions are spelled out clearly (must hold LP tokens, need native gas, approval required, poolId needed for multi-pool farms) and the invalid examples reinforce them. However, there is no explicit when-to-use/when-not guidance relative to alternatives such as evm_stake_tokens or evm_unstake_lp, and 'Common Mistakes' offers generic advice rather than routing rules.

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