replay_pool_tape
Backtest a DEX position by replaying recorded swap history through the pool's curve. Returns price, reserves, LP value, impermanent loss, and drift over time.
Instructions
Backtest a DEX position from a recorded pool history. Replays a list of swaps (or decoded Uniswap v2 Swap logs) through the exact curve and returns the price / reserves / LP-value / impermanent-loss / drift series over time. Use this to evaluate an LP position or a trading sequence against a real transcript. Requires the optional flox-py dependency.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pool | Yes | A pool spec: {venue, token0:{symbol,decimals}, token1:{symbol,decimals}, ...venue params} -- the replay's starting state. | |
| swaps | No | Swaps as [ts, 'NUMBER SYMBOL', into?] entries. Supply this or `evm_logs`. | |
| evm_logs | No | Decoded Uniswap v2 Swap log dicts (data word order amount0In, amount1In, amount0Out, amount1Out). Supply this or `swaps`. |