This repository contains the pure TypeScript benchmarking engine used to evaluate continuous optimization algorithms (Golden Section Search vs. Derivative Binary Search) for finding the exact amountIn maxima on Uniswap V3 profit curves.
Read the full mathematical teardown and latency analysis on Substack: here
To accurately measure algorithmic CPU latency without JSON-RPC I/O contamination, this engine decouples state-fetching from routing math.
snapshot.tsextracts the exact tick horizon from a local mainnet fork.hydrate.tsloads the V3 pool state into local memory, bypassing SDK invariants.benchmark.tsruns the algorithms purely off-chain usingJSBIinteger math.
This project is built using Bun for minimal runtime overhead.
# 1. Install dependencies
bun install
# 2. Run the benchmarking engine
bun benchmark