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.
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 | |||