project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

Uniswap V4 Replayer

An extremely fast tool to replay V3 state transitions on a V4 pool with hooks, tracking growth, movements and pool state.

Uniswap V4 Replayer

Created At

ETHGlobal Bangkok

Winner of

Uniswap Foundation - Integrations, Research, and Experiments 1st place

Project Description

Uniswap v4 introduces hooks which are able to run arbitrary logic along with the pool transitions, this makes hooks have a very high impact on how the pool operates and how profitable it is going to be for LPs. Uniswap v4 and v3 have the same overall structure with the exception of hooks, and so this tools allows you to replicate the state from any v3 pool onto a new v4 pool with a hook attached.

As Uniswap v4 goes into production and more people start using it, we'll need better tools to judge how well certain hooks do, both from a trading perspective and from a LP perspective. This tools help in both ways by tracking how a hook impacts the pool.

The tool utilizes several techniques to make it extremely fast which puts it at par with institutional v3 backtesting tools.

How it's Made

There are several parts to this:

Event Collection: Typescript, NodeJS and Viem are used to query chain for historical state. Along with that, we use services like The Graph to query event state faster than directly querying via RPC.

State Replication: We use tevm and foundry to replicate chain state on Unichain Sepolia to run tests in a more realistic scenario.

Engine: The final process runs inside foundry using a script to parse existing events and then executing them in the v4 format.

background image mobile

Join the mailing list

Get the latest news and updates