Yield Farming Calculator
Project farming returns from pool APR, compounding frequency and fees, with impermanent loss taken into account.
A pool's advertised APR answers a narrower question than the one a liquidity provider is actually asking. It describes the rewards the pool emits and stops there, saying nothing about the vault's cut, nothing about the gas spent getting in and out, and nothing at all about the divergence between the two pooled assets, which is frequently the largest single line in the outcome. This yield farming calculator works out what the liquidity pool returns come to once those three are set against the rewards.
Formula: net yield = compounded pool return - impermanent loss - fees
Your figures
The value put into the pool at deposit, in the currency selected above.
The pool's advertised nominal rate, before impermanent loss and before any fee. Pool rates move with the total value deposited.
How often rewards are claimed and put back in. Enter 0 if they are never compounded — each harvest costs gas, which is entered separately below.
How long the position is held, from deposit to withdrawal.
The vault's or aggregator's cut of the yield, as a percentage. Zero if you farm the pool directly.
How far the two pooled assets moved against each other. 1 means they moved together; 2 means one doubled against the other; 0.5 is the same move seen from the other side.
Gas and transaction costs to open the position, including any swap to balance the pair.
Gas and transaction costs to close it. Harvest costs belong here too, one per harvest.
The year length the rate you entered is quoted on. Most DeFi accrual uses 365; plenty of centralised earn products use 360.
Results
Net profit
+US$837.77
+8.378% on US$10,000.00 over 90 days
- Gross pool yield+10.324% of the capital deployed, before every deduction below.
- +US$1,032.42
- Pool APY at this harvest frequencyThe APR entered, compounded as often as it is actually harvested rather than as often as the pool assumed.
- 48.954%
- Harvests over the periodFractional, because the final part-period is prorated rather than dropped.
- 12.822
- Performance feeTaken from the yield, not from the profit. A vault charges its cut on what it harvests whether or not the position as a whole is ahead.
- US$103.24
- Yield after the performance fee
- +US$929.17
- Impermanent loss2√k ÷ (1 + k) − 1 at a price ratio of 1.2, applied to the capital deployed. It measures pooling against holding the same two assets, and is zero only when they move together.
- -0.4141% · -US$41.41
- Entry and exit costs
- US$50.00
- Every deduction togetherThe performance fee, the transaction costs and the impermanent loss added up as positive figures.
- US$194.65
- Value at the endCapital plus the net result, measured against holding the same two assets rather than against cash.
- US$10,837.77
- Return over the period
- +8.378%
- Annualised net returnThe result above scaled to a full year on a 365-day count.
- +38.580%
- Break-even pool APRThe APR the pool would have had to pay for this position to come out level, given the price move and the costs entered. Comparing it with the advertised APR is the same comparison as the profit figure, stated as a rate.
- 4.100%
- Yield covers the impermanent loss and the costsWhether the net result above is at or above zero.
- Yes
- Period measured
- 90 days on a 365-day year
What this means
A 40.000% pool APR harvested 52 times a year pays US$1,032.42 on US$10,000.00 over 90 days. Taking off US$103.24 of performance fee, US$50.00 of transaction costs, and an impermanent loss of -0.4141% on the capital at a price ratio of 1.2, leaves +US$837.77, or +8.378%. Read the other way round, the pool would have had to advertise 4.100% for the same price move and the same costs to come out level.
- Every rate, price, fee and commission above is yours to enter. Nothing is fetched, and no validator's, pool's, wallet's or exchange's figure is preset — where a field opens with a number it is a round illustration to overwrite, because the figure that applies to a position is the one that account is actually paid or charged.
- Impermanent loss is measured against holding the same two assets, not against cash. The price ratio says how far the two moved apart and nothing about where the pair itself went, so if both assets halve this figure is unchanged and the position still lost money — that part of the outcome belongs to the assets rather than to the decision to pool them.
- The performance fee is charged on the yield, so it is charged on a position that impermanent loss has put behind. Deducting it from the profit instead would understate what a vault actually takes.
- Assumes a 50/50 pool, one price ratio for the whole period, and rewards sold at the moment they are harvested. A reward token whose own price moves between harvest and sale is not this arithmetic, and neither is a weighted pool.
- Harvest costs are not counted per harvest. Add them to the entry and exit costs above — at 52 harvests a year they are frequently the largest deduction on the page.
- Excludes borrowed capital, pool token price impact on the way in and out, protocol risk, and tax.
Net profit: +US$837.77
The link reopens this calculator with the same numbers. Nothing you enter is sent to a server.
Continue with these figures
About the Yield Farming calculation
As a DeFi yield calculator it does the whole sum. It compounds the pool APR at the harvest frequency you actually intend rather than the one the pool assumed, takes the performance fee off the yield, applies impermanent loss to the capital deployed, subtracts the entry and exit costs, and reports the LP return that is left, both as a figure over the period and annualised.
Impermanent loss is measured against holding the same two assets, not against cash, and it is realised only when the position is withdrawn. While the liquidity is still in the pool the loss is a paper comparison that reverses completely if the price ratio returns to where it started. The moment the position is closed at a different ratio it stops being impermanent in any sense that matters.
The output that makes the trade legible is the break-even pool APR. Every other figure on the page is a projection with a rate in it that the reader half believes. The break-even inverts the question: given the price move that actually happened and the costs actually paid, what would the pool have had to advertise for this position to come out level? Setting that against the rate on the pool's own page is the entire comparison in one line.
Yield Farming formula
t = days ÷ day count n = harvests a year
harvested gross = C × ((1 + APR ÷ n)^(n × t) − 1)
not harvested gross = C × APR × t when n = 0
pool APY = (1 + APR ÷ n)^n − 1
performance fee = gross × fee rate
IL = 2√k ÷ (1 + k) − 1
IL amount = C × IL negative or zero
net profit = gross − performance fee + IL amount − entry − exit
annualised = (1 + net profit ÷ C)^(day count ÷ days) − 1
required gross = (entry + exit + |IL amount|) ÷ (1 − fee rate)
break-even APR = n × ((1 + required gross ÷ C)^(1 ÷ (n × t)) − 1)- C
- The capital deployed at the moment of the deposit, in the currency selected. Impermanent loss is applied to this figure, because it is what the fees and rewards accrue on.
- k
- The price ratio change: how far the two pooled assets moved against each other. 1 means they moved together, 2 means one doubled against the other, and 0.5 is that same move seen from the other side.
- IL
- Impermanent loss as a fraction, always zero or negative. It is symmetric in k, so a doubling and a halving cost exactly the same, and it is zero only at k = 1.
- n
- Harvests a year — how often rewards are claimed and put back into the pool. Zero means they are never compounded, which switches the yield line from a power to a straight multiplication.
- fee rate
- The vault's or aggregator's share of the yield, as a fraction. Charged on what is harvested rather than on what the position ends up making.
- required gross
- The yield that exactly offsets the transaction costs and the impermanent loss once the vault has taken its share. The intermediate step between a break-even in money and a break-even expressed as a rate.
The performance fee comes off the yield rather than off the profit, and that ordering is not a rounding decision. A vault charges its cut on what it harvests, and it charges it whether or not the position as a whole is ahead — a farmer can and routinely does pay a performance fee on a position that impermanent loss has put underwater. Deducting the fee from the profit instead would understate what the vault actually takes, and would make it vanish entirely on any position that lost money, which is not how a single vault on any chain works.
The price ratio is entered instead of two absolute prices because the question this page answers is whether pooling beat holding, and that is the only part of the outcome the decision to provide liquidity was responsible for. If both pooled assets halve, the position loses money and no yield calculation was ever going to say otherwise; that loss belongs to the assets. Impermanent loss is therefore reported as a drag relative to holding the same two assets, which also means the figure is unchanged whether the pair as a whole rose or fell.
The 2√k ÷ (1 + k) shape comes from what a constant-product pool holds. As the ratio moves, the pool automatically sells whichever asset is rising and buys whichever is falling, so it ends up holding the geometric mean of the two positions where holding would have given the arithmetic mean. The geometric mean is never the larger of the two, and the gap between them is the loss. It grows far more slowly than the price move that causes it: a 1.5× divergence costs 2.02%, a doubling costs 5.72%, and a tenfold divergence costs about 42%.
The break-even APR is the whole thing solved backwards. Setting net profit to zero and rearranging for the gross yield gives (entry + exit + |IL amount|) ÷ (1 − fee rate), which is the yield that exactly covers the hurdle after the vault's share, and inverting whichever compounding was selected turns that quantity of money into a rate. It is the same comparison as the profit figure, restated in the units the pool advertises itself in, which is what makes it easy to carry away and hard to fool yourself about.
Yield Farming: a worked example
$8,000 into a 50/50 pool advertising 24% APR, harvested fortnightly for 120 days, with a vault taking 10% of the yield, $18 of gas each way, and the two pooled tokens finishing 1.5 times apart.
- Period in years120 ÷ 365 = 0.3288
- Harvests over the period26 × 0.3288 = 8.5479
- Gross pool yield8,000 × ((1 + 0.24 ÷ 26)^8.5479 − 1) = $653.67
- Pool APY at 26 harvests(1 + 0.24 ÷ 26)^26 − 1 = 26.985%
- Performance fee653.67 × 10% = $65.37
- Yield after the fee653.67 − 65.37 = $588.30
- Impermanent loss2√1.5 ÷ 2.5 − 1 = −2.0204%
- Impermanent loss in money8,000 × −2.0204% = −$161.63
- Entry and exit costs18 + 18 = $36
- Net profit588.30 − 161.63 − 36 = $390.67
- Return over the period390.67 ÷ 8,000 = 4.8834%
- Annualised(1.048834)^(365 ÷ 120) − 1 = 15.6067%
- Required gross to break even(36 + 161.63) ÷ 0.9 = $219.59
- Break-even pool APR26 × ((1 + 219.59 ÷ 8,000)^(1 ÷ 8.5479) − 1) = 8.2496%
$390.67 kept out of $653.67 paid: a 4.8834% return over the 120 days, or 15.6067% annualised, from a pool advertising 24%. The $263.00 of deductions split as $65.37 of performance fee, $36 of gas and $161.63 of impermanent loss — so the largest single line is the one the pool's own page does not mention, and it is the only one that would have reversed had the two tokens come back together before the position was closed. Read as a rate, the pool needed to advertise 8.2496% for this to come out level, so the 24% cleared the hurdle roughly threefold.
How to use the Yield Farming calculator
- Enter the capital as the value deployed at the moment of the deposit, including anything spent swapping one token into the other to balance the pair. That figure is what impermanent loss is applied to.
- Enter the pool APR as the nominal rate the pool advertises, before compounding. If the figure you have is described as an APY, convert it back on the APR to APY page first, or this will compound the same effect twice.
- Set the harvests to what you would actually do rather than what the pool assumes: 52 for weekly, 26 for fortnightly, 365 for daily, or 0 if rewards are simply left to sit uncompounded.
- Enter the price ratio as the divergence between the two assets, not the move of either one. Two stablecoins that held their peg are 1; a pair where one token doubled while the other stood still is 2; the same pair seen from the other side is 0.5.
- Put every transaction cost into the entry and exit boxes, including one gas cost per harvest, because the harvest count multiplies quickly and nothing else on the page charges for it.
- Compare the break-even pool APR against the rate the pool advertises. That single comparison contains the profit figure, the impermanent loss and the costs, restated as the kind of number the pool quotes itself in.
Limitations of the Yield Farming calculator
Every calculation makes assumptions. These are the ones that matter here.
- Harvest costs are not charged per harvest. They belong in the entry and exit boxes, and at 52 harvests a year they are frequently the largest deduction on the page.
- Assumes a 50/50 constant-product pool. Weighted pools such as 80/20 sit on a different curve, and a concentrated-liquidity position can lose considerably more than this within its range and stops earning entirely outside it.
- Applies one price ratio to the whole period. A pair that diverged, converged and diverged again produces a path this cannot see, and only the ratio at the moment of withdrawal is realised.
- Assumes reward tokens are sold the instant they are harvested. A reward whose own price moves between the harvest and the sale is a second position that this arithmetic does not model.
- Says nothing about where the pair itself went. If both assets halve, the impermanent loss figure is unchanged and the position still lost money, because that part of the outcome belongs to the assets rather than to the decision to pool them.
- Excludes borrowed capital, price impact on the way into and out of the pool, protocol and smart-contract risk, and tax. It also assumes the advertised APR held for the whole period, which pool rates rarely do as capital arrives.
Frequently asked questions about Yield Farming
Why does the calculator want a price ratio rather than the two token prices?
Because impermanent loss depends only on how far the two assets moved relative to each other, not on where the pair as a whole went. A ratio of 1.5 costs 2.0204% whether both tokens rose, both fell or one stood still. Asking for the ratio makes it explicit that this page measures pooling against holding the same two assets, and does not pretend to tell you whether holding them was a good outcome.
Is impermanent loss real if I have not withdrawn?
It is real as a comparison and unrealised as a result. While the liquidity stays deposited, the gap reverses completely if the price ratio returns to where it started, which is the whole reason for the word impermanent. It becomes permanent at the moment of withdrawal at a different ratio, and for most providers exiting after a large divergence it is entirely real by then.
Why is the performance fee charged even when the position lost money?
Because a vault takes its cut of what it harvests, not of what you end up with. The rewards were genuinely collected and the fee is genuinely charged on them, regardless of what impermanent loss did to the capital underneath. In the worked example the vault takes $65.37 of a $653.67 yield, and it would still have taken it had the price divergence been large enough to leave the position behind.
How often should rewards be harvested, and what does that do to the farming APY?
There is a trade-off with a break-even in it rather than an answer. Harvesting more often compounds the rewards sooner — 24% APR becomes 26.985% at 26 harvests a year and 27.11% at 365 — but each harvest is a transaction with a gas cost. Price one harvest on the gas fee calculator, multiply by the count, add it to the exit cost here, and the comparison settles itself for your position size.
What does the break-even pool APR tell me that the profit figure does not?
The same thing, in the units the pool advertises in. It reports the rate the pool would have had to pay for this position to come out level given the divergence that happened and the costs paid, so it can be set directly against the number on the pool's own page. At $8,000, a 1.5 ratio and $36 of gas, that hurdle is 8.2496% — and a pool paying under it is one where the rewards never covered the divergence.
How does this differ from the impermanent loss calculator?
That page isolates one effect: it takes the four token prices, computes the divergence loss and reports the fee yield that would offset it. This one takes the whole position, compounding the pool APR at your harvest frequency, subtracting the vault's fee and the gas, and reporting a net figure plus the break-even APR. Use that page to understand the loss itself and this one to price the position it sits inside.
Last reviewed . See our methodology and editorial policy.
More crypto calculators