{"description":"Impermanent loss for constant-product AMM (x·y=k) liquidity providers: LP vs HODL value, exit balances, fee break-even, scenario table.","example_post":"curl -X POST https://impermanent-loss-formatho.filesformatho.workers.dev/api -H 'Content-Type: application/json' -d '{\"amount_a\":1,\"amount_b\":4000,\"p1\":8000}'","example_get":"https://impermanent-loss-formatho.filesformatho.workers.dev/api?price_change=100","params":{"amount_a":"deposit quantity of token A (positive number)","amount_b":"deposit quantity of token B (positive number); with amount_a this sets p0 = amount_b/amount_a","p0":"initial price of token A in token B (alternative to amounts)","p1":"exit price of token A in token B (required unless price_change given)","price_change":"percent change of token A vs token B at exit, e.g. 50 = +50%, -75 = −75% (alternative to p1)"},"known_values":{"1.25x":"-0.62%","1.5x":"-2.02%","2x":"-5.72%","3x":"-13.40%","4x":"-20.00%","5x":"-25.46%"},"full_tool":"https://formatho.com/tools/impermanent-loss"}