calculate_impermanent_loss
Calculate impermanent loss for 50/50 liquidity pools by comparing value changes between tokens, showing USD and percentage losses with net gain/loss including trading fees at different APY levels.
Instructions
Calculate exact impermanent loss for a 50/50 LP pair.
Given price change percentages for both tokens, calculates exact IL in USD and percentage. Also returns: value if held vs value in LP, and net gain/loss including trading fees at various APY levels (5%, 10%, 20%, 50%).
ALWAYS FREE — pure math, no API call needed.
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": {
"token_a_price_change": "<token_a_price_change>",
"token_b_price_change": "<token_b_price_change>"
},
"name": "calculate_impermanent_loss"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token_a_price_change | Yes | ||
| token_b_price_change | Yes | ||
| investment_amount | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||