{"uid":"cap_I_Idg86Nf4K8KO11M07Qz","slug":"api-quantoracle-dev-3628c94c","name":"QuantOracle Impermanent Loss Calculator","description":"QuantOracle: crypto/impermanent-loss","url":"https://api.quantoracle.dev/v1/crypto/impermanent-loss","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"amm_type":{"enum":["v2","v3"],"type":"string","title":"Amm Type","default":"v2","description":"AMM type: v2 (full range) or v3 (concentrated)"},"lower_tick":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lower Tick","description":"Lower price bound (v3 only)"},"upper_tick":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Upper Tick","description":"Upper price bound (v3 only)"},"initial_investment":{"type":"number","title":"Initial Investment","default":1000,"description":"Initial investment value in USD"},"current_price_ratio":{"type":"number","title":"Current Price Ratio","description":"Current price ratio of token A to token B","exclusiveMinimum":0},"initial_price_ratio":{"type":"number","title":"Initial Price Ratio","default":1,"description":"Initial price ratio of token A to token B","exclusiveMinimum":0}}},"responseSchema":null,"example":{"request":{"initial_investment":5000,"current_price_ratio":1.5,"initial_price_ratio":1},"response":{"ms":8.41,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","calculator":"https://quantoracle.dev/impermanent-loss-calculator","powered_by":"QuantOracle"},"amm_type":"v2","lp_value":6123.72,"hold_value":6250,"loss_amount":-126.28,"price_ratio":1.5,"fee_breakeven_apy":24.5817,"impermanent_loss_pct":-2.0204}},"exampleRequest":{"initial_investment":5000,"current_price_ratio":1.5,"initial_price_ratio":1},"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9cklp6UrDedmLSzrUrSYG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","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 AMM liquidity providers given an initial investment, initial price ratio, and current price ratio, returning LP value, hold value, loss amount, loss percentage, and fee breakeven APY.","exampleAgentPrompt":"I put $5,000 into a Uniswap v2 liquidity pool when the price ratio was 1.0 — now the price ratio is 1.5. Can you calculate my impermanent loss, what my LP position is worth versus if I had just held, and what fee APY I'd need to break even?","exampleUseCases":null,"resultDescription":"Returns the current LP value in USD, the equivalent hold value had the user kept both tokens, the absolute loss amount in USD, the impermanent loss as a percentage, and the fee breakeven APY required to offset the loss — all for the given AMM type and price ratio change.","failureModes":["Invalid amm_type value (only 'v2' supported, v3 may require additional params)","Negative or zero price ratios causing mathematical errors","Missing required fields (initial_investment, current_price_ratio, initial_price_ratio) returning 400","Extreme price ratios (e.g. 1000x) may produce valid but extreme results","Payment failure via x402 protocol returning 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need a precise, fast impermanent loss computation for AMM liquidity positions, especially when you need the fee breakeven APY alongside IL percentage and absolute loss figures. Prefer over manual spreadsheet calculations or generic DeFi dashboards when integrating IL risk analysis into automated DeFi portfolio management or agent-driven LP strategies.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:02.215Z","isFirstParty":false}