> ## Documentation Index
> Fetch the complete documentation index at: https://docs.defiloops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backtesting a position

> One strategy over one pool: what it actually did, including impermanent loss and the comparison against simply holding

**Tool:** `run_lp_backtest`

Where [choosing a range](/skills) answers "what would this band have collected",
this answers what happens when the position is allowed to **move**.

Name a pool as `chain|PAIR|feePpm` — `ethereum|USDC/WETH|500` — a strategy from
[list\_lp\_strategies](/tools/list-lp-strategies), a window and a size.

## In range comes first, and it decides everything else

```
Recentre on exit on ethereum|USDC/WETH|500 — $100,000 over 365 days

  in range        96.7% of days
  fee APR         57.9%
  net APR         57.1%   after gas and swap costs
  impermanent     -62.8%/yr
  kept            -5.7%/yr  fees after impermanent loss

  fees collected  $57,910
  impermanent     $-62,828
  total           -6.4%   against -11.5% for simply holding (+5.0 points)
```

The in-range figure leads because **every rate under it is computed across the
whole window regardless**. A band that held the price 19% of the time earned
nothing for the other 81%, and its fee APR is still quoted over the full period,
because that is what an APR is.

<Warning>
  Read that example again. The fee APR is **57.9%** and the position still finished
  **down 6.4%**. Fees alone are the number people read as the outcome, and they are
  half a ledger.
</Warning>

## Three numbers, never one

Fees, impermanent loss, and the total against **simply holding the same two
tokens**. The third is the one that answers "was this worth doing" — in the run
above the answer is yes, narrowly, because holding did worse.

## It tells you when its own inputs were poor

Two warnings come back and both change how much the figures are worth:

* **The indexer priced none of this pool's volume.** Fees were rebuilt from the
  stable leg rather than read. An estimate, and called one.
* **The venue's protocol fee could not be read.** The cut taken out of every fee
  is assumed. On a pool where the cut is 25%, assuming none overstates by a
  third.

The service also warns about the strategy itself. `recentre` reopens the band
the day it goes out of range, so it is in range almost always *by construction* —
and the answer says so, along with what a single day of delay costs.

## Size is an input, not a scale

`capital` changes the answer and not merely its magnitude: fees split by
liquidity, so a large position earns a share it could not earn twice. Past
roughly a tenth of the pool, the answer describes a pool the deposit itself
would have changed — and the tool says which fraction it is.

## It is history

No forecast, nothing signed, and gas is not modelled.


## Related topics

- [What we hold](/data/streams.md)
- [What the agent knows](/skills.md)
- [Every tool](/tools/reference.md)
- [The catalogue](/adapters/catalogue.md)
- [What it can do](/adapters.md)
