16trust / 100
Impermanent Loss
by Vextorium in Onchain & crypto
x402 APIFailing, checked 1 h ago
Impermanent loss calculator for Uniswap v2 (full range) and v3/v4 concentrated ranges: IL vs holding, out-of-range flag and final token mix.
POST https://api.vextorium.com/v1/impermanent-loss
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 0.0%
- Response time
- - typical, - slowest 5%
- Last check
- 1 h ago: Amount "0.003" is not in atomic token units
- Next check
- any minute now
How to call it
# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://api.vextorium.com/v1/impermanent-loss' \
-H 'content-type: application/json' \
--data-raw '{"final_price":2600,"initial_price":2000,"max_range":2400,"min_range":1800}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fv1%2Fimpermanent-loss
const res = await pay("https://api.vextorium.com/v1/impermanent-loss", {
method: "POST",
headers: { "content-type": "application/json" },
body: "{\"final_price\":2600,\"initial_price\":2000,\"max_range\":2400,\"min_range\":1800}",
});
console.log(await res.json());Example input
{
"final_price": 2600,
"initial_price": 2000,
"max_range": 2400,
"min_range": 1800
}Example output
{
"final_composition": {
"token0_pct": 0,
"token1_pct": 100
},
"impermanent_loss_pct": -10.8289,
"note": "Loss versus holding the tokens, excluding fees. Out of range the position earns no fees.",
"out_of_range": true,
"price_change_pct": 30,
"range": [
1800
],
"type": "concentrated range (Uniswap v3/v4)"
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Amount "0.003" is not in atomic token units | 402 | 96 ms | $0.003 |
| 6 h ago | Amount "0.003" is not in atomic token units | 402 | 75 ms | $0.003 |
| 10 h ago | Amount "0.003" is not in atomic token units | 402 | 75 ms | $0.003 |
| 14 h ago | Amount "0.003" is not in atomic token units | 402 | 274 ms | $0.003 |
| 19 h ago | Amount "0.003" is not in atomic token units | 402 | 115 ms | $0.003 |
| 23 h ago | Amount "0.003" is not in atomic token units | 402 | 78 ms | $0.003 |
| 27 h ago | Amount "0.003" is not in atomic token units | 402 | 87 ms | $0.003 |
| 31 h ago | Amount "0.003" is not in atomic token units | 402 | 71 ms | $0.003 |
| 35 h ago | Amount "0.003" is not in atomic token units | 402 | 78 ms | $0.003 |
| 39 h ago | Amount "0.003" is not in atomic token units | 402 | 92 ms | $0.003 |
| 43 h ago | Amount "0.003" is not in atomic token units | 402 | 104 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 239 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 74 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 77 ms | $0.003 |
| 2 days ago | Amount "0.003" is not in atomic token units | 402 | 81 ms | $0.003 |