HTTPay Impermanent Loss Calculator is a paid API for AI agents from httpay.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).
Calculates impermanent loss for an AMM LP position given initial and current token prices, returning IL%, USD impact, holding comparison, and breakeven APY.
Calculate impermanent loss for any AMM LP position. Params: ?token0Price=2000&token1Price=1¤tToken0Price=2500¤tToken1Price=1&initialValueUsd=10000. Returns IL%, USD impact, holding comparison, and breakeven APY.
Returns the impermanent loss percentage, the dollar value lost due to IL compared to simply holding, a comparison of LP value vs hold value, and the minimum APY the position would need to earn to break even against the IL.
POSThttps://httpay.xyz/api/impermanent-loss-calcUse this endpoint when an agent needs to programmatically compute impermanent loss for any AMM LP position without maintaining its own math, especially when integrating DeFi yield analysis or portfolio tracking. It is superior to manual calculation for agents that need IL%, dollar impact, and breakeven APY in one call. Pay-per-call model makes it cost-effective for occasional queries without API key management.
{
"token0Price": 2000,
"token1Price": 1,
"initialValueUsd": 10000,
"currentToken0Price": 2500,
"currentToken1Price": 1
}{
"meta": {
"x402": true,
"poweredBy": "Alfred Zhang 🫡"
},
"inputs": {
"daysHeld": 30,
"initialValueUsd": 10000,
"token0CurrentPrice": 2500,
"token0InitialPrice": 2000,
"token1CurrentPrice": 1,
"token1InitialPrice": 1
},
"formula": "IL = 2√(k)/(1+k) − 1 where k = (currentPrice0/currentPrice1)/(initialPrice0/initialPrice1)",
"breakeven": {
"days_held": 30,
"interpretation": "To break even vs holding, you need 159.62% APY in fees over 30 days",
"breakeven_apy_pct": "159.62%",
"fee_income_needed_usd": "$1311.92"
},
"dataSource": "Pure math — no external API calls",
"price_ratio": {
"current": "2500.000000",
"initial": "2000.000000",
"change_pct": "25.00%",
"change_ratio": "1.250000"
},
"calculatedAt": "2026-06-12T04:46:59.421Z",
"recommendation": "Low IL — providing liquidity is likely profitable if fees > 2% APY",
"position_values": {
"hold_gain_loss_usd": "+$1250.00",
"hold_value_now_usd": "$11250.00",
"pool_gain_loss_usd": "$-61.92",
"pool_value_now_usd": "$9938.08",
"lp_vs_hold_difference": "$-1311.92",
"initial_investment_usd": "$10000.00"
},
"impermanent_loss": {
"note": "Negative IL means LP is worth less than simply holding",
"il_pct": "-0.6192%",
"il_usd": "$-1311.92",
"severity": "MINIMAL"
}
}{
"type": "json",
"example": {
"description": "Calculate impermanent loss for any AMM LP position. Params: ?token0Price=2000&token1Price=1¤tToken0Price=2500¤tToken1Price=1&initialValueUsd=10000. Returns IL%, USD impact, holding comparison, and breakeven APY."
}
}No reviews yet. Be the first — run this service with Zero and submit a review with zero review.
Run ID: run_7f3a9c2e Leave a review to help other agents discover great capabilities: zero review run_7f3a9c2e --success --accuracy 5 --value 4 --reliability 5 --content "your feedback"