Formula: Impermanent Loss & LP Mathematical Formula
- initialPoolDeposit: Initial Pool Deposit (USD)
- tokenPriceRatioChange: Token Price Ratio Change (×)
- annualPoolFeeAprPct: Annual Pool Fee Apr Pct (%)
- daysInPool: Days In Pool (days)
Compare 50/50 AMM liquidity pool value against HODL across price ratios.
No. It measures how the pool position compares with simply holding the same two tokens. In the default case the pool is $583.59 behind holding before fees, but both are above the starting $10,000 deposit because one token rose. You can show impermanent loss and still be up overall, or show none and be down if both tokens fell together.
Divide one token's new price relative to its start by the other's. If token A rose 50% and token B rose 20%, the ratio is 1.5 divided by 1.2, which is 1.25. The percentage result will then be correct. The dollar lines will not match your wallet, because the tool prices everything as if the second token stayed flat.
Not for the percentage, which is the main figure. A ratio of 2 and a ratio of 0.5 both give -5.72%, because the formula is symmetric. It does matter for the dollar lines, since the holding benchmark is built from the deposit times one plus the ratio, halved. Pick the token you measure value in as the stable one. Doing so keeps the dollar lines meaningful.
With a ratio of 1 the price has not moved, so impermanent loss is exactly zero and the holding benchmark stays at $10,000 exactly. The pool value line still includes $1,183.56 of fees from the default rate over 180 days, so it sits above holding by exactly that amount. The fee is the only difference.
No. The tool treats fees as simple interest on the original deposit: deposit times the annual rate times days divided by a year. It does not reinvest them in the pool and does not grow them with the pool's value. If your pool auto-compounds, the real figure will be slightly higher, assuming the rate actually holds for the whole period.
The engine rejects it with a message. A real ratio has to be above zero, since a ratio of zero would mean one token became worthless. Enter the ratio as a positive multiple: 0.6 for a 40% fall, 1 for no change, 2 for a doubling. The deposit must also be above zero, and days and the fee rate cannot be negative.
Not reliably. The formula assumes liquidity is spread across every possible price, as in a classic constant-product pool. Concentrated positions earn fees only inside a chosen range and suffer a larger loss per unit of price move while inside it. Outside the range they hold one token only. Those behaviours need a different model.
Usually from the pool's own dashboard, which shows a rate based on recent volume. Treat it as a snapshot. A rate measured over a busy week can halve in a quiet month. Try running the calculator at half and double your quoted rate to see how sensitive your comparison with holding is to that one guess.
The summary sentence tells you. With the defaults it says the estimated fees of $1,183.56 cover that loss. Set the ratio to 4 and it says the fees cover only part of it, because the gap against holding is then far larger than the fee income. You can also compare the pool value line with the holding line directly.
Not in this model. The loss depends only on the price ratio at the moment you look, not on how long it took to get there. Time only affects the fee line, which grows in a straight line with days. A longer stay helps only if the fee rate holds and the ratio does not drift further apart.
Because one token in the default case rose to 1.8 times its starting price while the other stayed flat. Half the deposit gained 80%, so the pair is worth $14,000.00 on paper if you never touched it. The pool position grows less than that, and the difference before fees is the impermanent loss the headline reports as a percentage.
Out of the box, this calculator puts $10,000 into a two-token pool split evenly by value, then lets one token's price rise to 1.8 times its starting level against the other. It also assumes the pool pays a combined fee and reward rate of 24% a year and that the money stays in for 180 days.
The headline is an impermanent loss of -4.17%. Below it sit three figures. Holding the two tokens in a wallet instead of the pool would leave you with $14,000.00 on paper. The pool position, with fees added back, is worth $14,599.97. The fees themselves come to $1,183.56.
Read those together and the story is simple. The price move cost the pool position $583.59 relative to holding, which is the -4.17% applied to the $14,000 holding figure. Fees then more than covered that gap, so over this window the pool came out ahead of holding by a little under six hundred dollars. Change any one of the four inputs and that balance can tip the other way.
None of this says whether providing liquidity is a good idea. It is arithmetic on the numbers you type in, and the most important of those numbers, the future price ratio and the future fee rate, are guesses.
The formula on the page is IL = 2 x sqrt(r) / (1 + r) minus 1, where r is the price ratio you enter. It is the standard result for a constant-product pool, the kind where the product of the two token balances stays fixed as traders swap against it.
Try it with the default. The square root of 1.8 is about 1.3416. Doubling it gives 2.6833. Dividing by 2.8 gives 0.9583. Subtract 1 and you get minus 0.0417, which is the -4.17% the tool prints. So the engine matches the textbook expression.
A few values are worth knowing because they make good sanity checks. A ratio of 1 gives exactly zero, since nothing moved. A ratio of 2 gives -5.72%. A ratio of 4 gives exactly -20%, because the square root of 4 is 2 and 4 divided by 5 is 0.8. If your own spreadsheet disagrees with any of those, the spreadsheet is wrong.
Notice how slowly the loss grows at first. Nearly doubling the price costs only about 4% against holding. It takes a fourfold move to reach a fifth of the value, and the curve keeps flattening as you go further out. The loss never reaches 100%, however extreme the ratio gets.
People often expect a price fall to behave differently from a rise. In percentage terms it does not. Enter 2 and you get -5.72%. Enter 0.5 and you get -5.72% again. A ratio of 0.25 gives -20%, the same as 4.
That symmetry comes straight out of the formula. Replace r with 1 divided by r and the expression simplifies back to the same number. What the pool cares about is how far the two prices have drifted apart, not which one moved.
The dollar figures are not symmetric, though. With the default deposit, a ratio of 2 puts the holding benchmark at $15,000 and a ratio of 0.5 puts it below the original $10,000 deposit. The percentage loss is the same in both, but it is a percentage of a smaller number when the price falls, so the dollar gap shrinks too.
One practical consequence is that you cannot read the headline percentage as good news or bad news on its own. A -5.72% result tells you how the pool compares with holding. It says nothing about whether you made or lost money overall.
Look at how the holding figure is built. Half the deposit sits in the token whose price changed and is multiplied by 1.8, while the other half keeps its value. Add the two halves and you get the $14,000 benchmark. The engine computes this as deposit times (1 + r) divided by 2.
That only works if the second token is the unit you measure in, typically a stablecoin, or if you are happy to price everything in that second token. If both tokens moved against the dollar, say one rose 50% and the other rose 20%, the price ratio between them is what drives the impermanent loss percentage, but the dollar values on screen will not match your wallet.
In that case, use the percentage and ignore the dollar lines, or work out the ratio between the two tokens first and treat the dollar results as being in units of the second token.
The same caution applies to the deposit itself. The tool assumes the deposit is split exactly 50/50 by value at entry. Pools that use other weightings, or concentrated liquidity ranges, follow different curves and this formula does not describe them.
The fee line is simple interest on the starting deposit. It takes $10,000, multiplies by 24%, then scales by 180 days out of a full year. That gives $1,183.56. There is no compounding, and the fee is not recalculated as the pool's value changes.
In a real pool, fee income depends on trading volume and on your share of the pool, both of which move every day. A rate quoted on a dashboard is usually a recent figure projected forward. If volume dries up, the fee rate falls. If more liquidity arrives, your share of each trade shrinks. The calculator holds the rate flat for the whole period because it has no way to know any of this.
The field label says the rate is trading fees plus staking rewards. If your pool pays rewards in a separate token, those rewards have their own price risk, and folding them into one flat percentage hides it. A reward rate that looks generous in token terms can be worth much less by the time you sell the tokens.
Setting the fee rate to zero is a useful test. With no fees, the pool value drops to the holding value minus $583.59, and you see the bare cost of the price move.
Because the impermanent loss percentage does not depend on time in this model, while fees grow in a straight line with days, there is always a holding period where the two cancel. You can find it by dividing the dollar loss by the daily fee.
With the defaults, the daily fee is $10,000 times 24% divided by the days in a year, a little over $6.50. Dividing $583.59 by that gives roughly 89 days. Run the calculator at 90 days and the fee income only just beats the loss, by under ten dollars. At 180 days the margin is comfortable.
This is the most useful way to use the tool. Instead of asking what the pool will earn, ask how long the fee rate would have to hold for a given price move to be paid for. If the answer is longer than you expect the fee rate to last, the comparison with holding probably favours holding.
Bigger moves stretch that time quickly. At a ratio of 4 the loss is a full fifth of the holding value, which on the default deposit is several thousand dollars, so fees at the same rate would take years rather than months to cover it.
The three presets change only the deposit, from $6,000 to $10,000 to $15,000 in turn. Every one of them returns -4.17%. The dollar loss scales in proportion: $350.16, then $583.59, then $875.39. Fee income scales the same way, to $710.14 and $1,775.34 at the two ends.
So the deposit size never changes whether the pool beats holding in this model. It only changes how many dollars ride on the answer. The inputs that change the verdict are the price ratio, the fee rate and the number of days.
In practice, deposit size can matter through things the tool leaves out. Network transaction costs are a fixed amount per transaction, so on a small deposit they can eat a large share of the fee income. A large deposit in a thin pool can also dilute the fee rate you were counting on.
The calculator compares two clean scenarios: tokens in a pool versus the same tokens in a wallet. Real positions carry extra costs and risks that it does not touch.
There are network fees to deposit, to claim rewards and to withdraw. There may be slippage if you swap into the pair before depositing. There is smart contract risk, where a bug or exploit can drain the pool regardless of what prices do. And gains, rewards and swaps may have tax consequences that vary by country and are not modelled here.
The word impermanent is also a little misleading. The loss is only reversed if the price ratio returns to where it started while you are still in the pool. Withdraw at a ratio of 1.8 and the -4.17% is realised. Treat the result as one input to your own judgment, and talk to a qualified adviser before committing money you cannot afford to lose.