name: impermanent-loss description: Calculate Impermanent Loss (IL) for Liquidity Provider positions. version: 1.0.0 author: SpoonOS Contributor tags: [web3, defi, finance, calculator, yield-farming]
Impermanent Loss Calculator
A financial utility that helps agents quantify the risk of providing liquidity. It calculates the divergence loss experienced when the price ratio of pooled tokens changes.
Quick Start
# Calculate IL if one token doubles in price (200% or 2.0x ratio change)
il_data = await agent.run_tool(
"il_calc",
price_change_ratio=2.0
)
print(il_data)
Scripts
| Script | Purpose |
|---|---|
| il_calc.py | Mathematical calculator for IL scenarios |
Best Practices
- Use to audit active LP positions.
- Combine with 'Yield Calculator' to see if trading fees cover the IL.