defi impermanent loss
defi_impermanent_lossImpermanent loss for a liquidity position: for a price move (percent, or entry and current price) get the value in the pool versus simply holding, the loss in percent and money, and the fee APR needed to break even, or whether the fees you pass already cover it. Handles 50/50 constant-product pools, weighted pools (80/20) and Uniswap v3 concentrated ranges, where it also says whether you are still in range. $0.002. Costs $0.002 USDC per call (x402).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "defi_impermanent_loss"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| weight | No | % of the volatile token for weighted pools, default 50 | |
| deposit | No | position value at entry, default 1000 | |
| fee_apr | No | ||
| entry_price | No | ||
| current_price | No | ||
| range_lower_percent | No | v3 range below entry, e.g. -20 | |
| range_upper_percent | No | v3 range above entry, e.g. 25 | |
| price_change_percent | No | e.g. 60 or -40 |