{"uid":"cap_F21W923wK471Ponz2yBt_","slug":"chainray-online-97c62ac9","name":"ChainRay Impermanent Loss Calculator","description":"Computes impermanent loss for liquidity providers using entry and current token prices on a specified chain (supports Base).","url":"https://chainray.online/impermanent-loss","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"chain":{"type":"string"},"entryPrice":{"type":"string","description":"Token price at LP entry"},"currentPrice":{"type":"string","description":"Current token price"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"chain":"ethereum","entryPrice":"1500","currentPrice":"2250"}}},"response":{"note":"IL is the opportunity cost vs simply holding. Actual profit depends on fees earned.","_proof":{"chain":"ethereum","dataHash":"9f16bb6fb89645c5e20c33a3e9290dd779a71357b7a92936e1ad207cfab99979","blockHash":"0x0890e3943c13bc966a20951a8ef0ccbc8f3e868026144683d03342692be28da6","chainName":"Ethereum","blockNumber":25306096,"proofVersion":"3.0","blockTimestamp":1781324063,"proofTimestamp":1781324071276},"formula":"IL = 2√(p₁/p₀) / (1 + p₁/p₀) - 1","riskLevel":"HIGH","scenarios":[{"price":750,"ilPercent":"5.719%","lossPerTenK":"$571.91","priceChange":"-50%"},{"price":1050,"ilPercent":"1.569%","lossPerTenK":"$156.94","priceChange":"-30%"},{"price":1200,"ilPercent":"0.619%","lossPerTenK":"$61.92","priceChange":"-20%"},{"price":1350,"ilPercent":"0.139%","lossPerTenK":"$13.86","priceChange":"-10%"},{"price":1500,"ilPercent":"0.000%","lossPerTenK":"$0.00","priceChange":"+0%"},{"price":1650,"ilPercent":"0.113%","lossPerTenK":"$11.34","priceChange":"+10%"},{"price":1800,"ilPercent":"0.414%","lossPerTenK":"$41.41","priceChange":"+20%"},{"price":1950,"ilPercent":"0.854%","lossPerTenK":"$85.43","priceChange":"+30%"},{"price":2250,"ilPercent":"2.020%","lossPerTenK":"$202.04","priceChange":"+50%"},{"price":3000,"ilPercent":"5.719%","lossPerTenK":"$571.91","priceChange":"+100%"}],"timestamp":1781324071137,"entryPrice":1500,"priceChange":"50.00%","currentPrice":2250,"impermanentLoss":{"raw":-0.020204102886728803,"usdPer10k":"-$202.04 per $10,000 LP","percentage":"-2.0204%"}}},"exampleRequest":{"chain":"ethereum","entryPrice":"1500","currentPrice":"2250"},"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_cJPe1wCiKaFvblcLJya9z","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes impermanent loss percentage and dollar impact for liquidity providers given entry and current token prices on a specified blockchain","exampleAgentPrompt":"What's my impermanent loss on Base if I entered my LP position at $1800 and the token is now at $2700?","exampleUseCases":null,"resultDescription":"Returns impermanent loss as a percentage, dollar loss per $10,000 invested, the IL formula used (2√(p1/p0)/(1+p1/p0)-1), multiple simulation scenarios across price ranges, an on-chain cryptographic proof anchored to a Base block, and the current timestamp.","failureModes":["Missing entryPrice or currentPrice query params returns a tip message with example usage rather than an error","Invalid or non-numeric price values may produce unexpected results","Chain parameter mismatch — service defaults to Base regardless of requested chain","Network timeout or service unavailability returns HTTP error","Negative or zero prices may cause formula errors"],"whenToPreferThis":"Use this endpoint when an agent needs to compute impermanent loss for a DeFi liquidity provider position on Base or other supported chains, especially when on-chain proof of the calculation is desired. Prefer this over manual calculation when you need simulation scenarios across multiple price points in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:58:35.358Z","isFirstParty":false}