replay_pool_tape
Replay recorded DEX swaps through the exact pool curve to backtest an LP position or trading sequence. Returns price, reserves, LP value, impermanent loss, and drift series 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`. |