Crypto & DeFi

Impermanent loss for a 50/50 constant-product LP position vs simply holding, given the price change of the volatile asset.

Impermanent loss for a 50/50 constant-product LP position vs simply holding, given the price change of the volatile asset.

Payment: x402 ($0.05 USDC on eip155:8453). Call unpaid to receive an HTTP 402 with requirements, then retry with the PAYMENT-SIGNATURE header. Method: IL_fraction = 2*sqrt(r)/(1+r) - 1, r = currentPrice/initialPrice; dollar loss = -IL_fraction * positionValue

post/v1/crypto/impermanent-loss

Request

  • Base URL: (relative, and it does not resolve against the document’s source URL)
  • URL: /v1/crypto/impermanent-loss
  • Auth: none declared

Request body

initialPricenumber required
currentPricenumber required
positionValueUsdnumber

Response

Verified result + provenance (formula, sources, reproducible SHA-256 hash).

Changes

No recorded changes to this operation across all 1 revision of this API.