evm_add_liquidity
Add liquidity to a DEX pool by approving both tokens and supplying amounts that match the pool ratio; receive LP tokens and earn a share of swap trading fees.
Instructions
Add liquidity to DEX pool to earn trading fees from swaps. Requires both tokens, returns LP tokens.
CRITICAL RULES:
MUST approve both tokenA and tokenB before adding liquidity
Amounts must match pool price ratio (use evm_get_pool_info)
Receives LP tokens representing pool share
Earns fees proportional to share (typically 0.25-0.3%)
Requires gas in native token
PARAMETERS:
tokenA, tokenB: Token pair addresses (required)
amountA, amountB: Token amounts matching pool ratio (required)
slippageTolerance: Price change tolerance "0.5" = 0.5% (required)
privateKey: Must hold both tokens and gas (required)
EXAMPLES: ✅ Add 100 USDC + equivalent WETH to Polygon QuickSwap: {chain: "polygon", dex: "quickswap", tokenA: "0x2791Bca...", tokenB: "0x7ceB23fD...", amountA: "100", amountB: "0.05", slippageTolerance: "0.5", privateKey: "0x..."}
WORKFLOW:
Get pool ratio (evm_get_pool_info)
Calculate matching amounts
Approve both tokens for router
Add liquidity (this tool)
Receive LP tokens
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.
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>",
"dex": "<dex>",
"tokenA": "<tokenA>",
"tokenB": "<tokenB>",
"amountA": "<amountA>",
"amountB": "<amountB>",
"slippageTolerance": "<slippageTolerance>",
"privateKey": "<privateKey>"
},
"name": "evm_add_liquidity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dex | Yes | DEX name (e.g., "uniswap", "quickswap", "traderjoe", "pancakeswap") | |
| chain | Yes | EVM chain to execute on | |
| tokenA | Yes | First token address (0x...) | |
| tokenB | Yes | Second token address (0x...) | |
| amountA | Yes | Amount of first token (in ether units) | |
| amountB | Yes | Amount of second token (in ether units) | |
| privateKey | Yes | Private key to sign transaction (0x...) | |
| slippageTolerance | Yes | Slippage tolerance percentage (e.g., "0.5" for 0.5%) |