{"uid":"cap_VWBVqnEaowMm6cUYBf53D","slug":"x402toll-impermanent-loss-calculator-a0d74753","name":"x402toll Impermanent Loss Calculator","description":"Impermanent loss for a 50/50 constant-product LP position vs simply holding, given the price change of the volatile asset.","url":"https://x402toll.com/v1/crypto/impermanent-loss","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"currentPrice":{"type":"number"},"initialPrice":{"type":"number"},"positionValueUsd":{"type":"number","default":0}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TmsXDX7Re4F7Jp1IZN7cB","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates impermanent loss for a 50/50 constant-product AMM LP position versus simply holding, given initial price, current price, and optional position size.","exampleAgentPrompt":"I entered an ETH/USDC Uniswap pool when ETH was at $2,000 and now it's at $3,200 — my position was worth $10,000 at entry. How much am I down to impermanent loss compared to just holding?","exampleUseCases":null,"resultDescription":"Returns the impermanent loss percentage and, if positionValueUsd is provided, the dollar amount lost versus simply holding the assets outside the pool — enabling a direct comparison between LP strategy and holding strategy for a 50/50 constant-product AMM.","failureModes":["Missing required currentPrice or initialPrice fields returns a 400 error","Passing zero or negative prices causes invalid computation or error response","Payment not included or insufficient USDC results in 402 Payment Required","currentPrice equal to initialPrice returns 0% impermanent loss (valid edge case)"],"whenToPreferThis":"Use this endpoint when you need a precise, formula-based impermanent loss figure for a classic 50/50 constant-product AMM pool (e.g. Uniswap v2, SushiSwap). Ideal when the user wants to compare LP yield vs holding returns, or when quantifying DeFi liquidity risk for a given price movement.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:49:50.002Z","isFirstParty":false}