Estimate fees versus impermanent loss
estimate_lpEstimate fees versus impermanent loss. Use this when the user gives a price range or a later price, a holding period, and a fee APR, and wants to know whether fees cover impermanent loss, gas, and exit cost. Pass price_now, holding_days, and fee_apr_percent. Pass price_lower and price_upper for a concentrated range, or omit them for the full-range formula. Optionally pass price_later, capital_usd, gas_usd, and exit_cost_usd. Returns the formula, the fee fraction, the IL fraction, whether fees cover IL and the costs you passed, and break-even prices from a sample. It does not look up gas or recommend a position. Not financial advice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gas_usd | No | Gas you expect to pay. Not looked up | |
| price_now | Yes | Current price, quote per base | |
| capital_usd | No | Position size, so gas and exit cost can be turned into a fraction of the position | |
| price_later | No | A later price to score. Omit to get break-even prices and the range edges only | |
| price_lower | No | Lower bound of a concentrated range. Omit, with price_upper, for the full-range formula | |
| price_upper | No | Upper bound of a concentrated range | |
| holding_days | Yes | How many days the fee APR is applied | |
| exit_cost_usd | No | Other exit cost. Not looked up | |
| fee_apr_percent | Yes | Annualized fee APR in percent, such as the 1-day fee APR from check_pool |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notice | Yes | ||
| status | Yes | ||
| formula | Yes | ||
| gas_usd | No | ||
| assumptions | Yes | ||
| fee_fraction | Yes | ||
| in_range_now | No | ||
| cost_fraction | No | ||
| exit_cost_usd | No | ||
| sampled_edges | No | ||
| fee_apr_formula | Yes | ||
| break_even_prices | Yes | ||
| il_fraction_at_later | No | ||
| fees_cover_il_and_costs | Yes | ||
| net_versus_holding_at_later | No |