{"uid":"cap_8VvaR2f95WiUSqxsb-NmU","slug":"delx-commerce-impermanent-loss-calculator-constant-product-amm-9a3feabf","name":"Delx Commerce — Impermanent Loss Calculator (Constant Product AMM)","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/il-constant-product?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"price_ratio":{"type":"number","description":"New/old price ratio for IL math"}}},"responseSchema":{"type":"json","example":{"il_pct":-2.02041028867288,"schema":"delx/util-il-constant-product/v1","il_fraction":-0.0202041028867288}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QeNvPUExAghsTMyVd8NDx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the impermanent loss percentage and fraction for a constant-product AMM position given a price ratio change","exampleAgentPrompt":"What's my impermanent loss if the price ratio between the two tokens in my constant-product AMM pool has changed by a factor of 1.5 (new price is 1.5x the old price)?","exampleUseCases":[{"title":"LP position risk assessment before entry","prompt":"If ETH price doubles relative to USDC after I deposit into a Uniswap v2 pool, what percentage of value will I lose to impermanent loss? The new-to-old price ratio would be 2."},{"title":"Post-hoc IL calculation after price move","prompt":"ETH dropped to 60% of its price when I entered my liquidity pool. Can you calculate exactly how much impermanent loss I incurred? The price ratio is 0.6."},{"title":"Compare IL across multiple price scenarios","prompt":"I want to understand my IL exposure — can you compute the impermanent loss fraction for a price ratio of 1.25, so I can decide whether staying in this LP is worth it?"}],"resultDescription":"Returns a JSON object with the impermanent loss as a percentage (il_pct, e.g. -2.02) and as a decimal fraction (il_fraction, e.g. -0.0202), along with a schema identifier string. Negative values indicate value lost relative to simply holding the tokens.","failureModes":["Missing price_ratio field returns a validation error","Non-numeric price_ratio causes a bad request response","price_ratio of 0 or negative may cause division errors or undefined math","Payment not settled via x402 protocol results in 402 Payment Required response"],"whenToPreferThis":"Use this endpoint when you need a precise, formula-based computation of impermanent loss for a constant-product (x*y=k) AMM, such as Uniswap v2 or SushiSwap, given a known price ratio change. It is ideal for agents performing DeFi risk analysis, LP position tracking, or portfolio reporting without needing to integrate a full on-chain data provider. Pay-per-call USDC pricing via x402 means no API key management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T03:54:18.804Z","isFirstParty":false,"canonicalSlug":"delx-commerce-impermanent-loss-calculator-constant-product-amm-9a3feabf"}