Degen Code

Degen Code

Share this post

Degen Code
Degen Code
Performance Optimization: V3/V4 Swap Step Caching

Performance Optimization: V3/V4 Swap Step Caching

Been There, Calced That...

Jun 25, 2025
∙ Paid

Share this post

Degen Code
Degen Code
Performance Optimization: V3/V4 Swap Step Caching
Share

Optimization ideas come to me at odd times — in the shower, sitting in traffic, trying to fall sleep, during the morning standup, etc.

I typically write them down, code them up and put them to git without much fanfare.

But some of these are pretty neat and discussing them may give readers deeper insight into how all this stuff works.

So I’m going to write about them more regularly instead of just silently making degenbot better and assuming people notice.

A Brief Review of Uniswap V3 Swap Step Computation

I reviewed the Uniswap V3 Pool Contract and then illustrated how its swap calculations worked in a three part series. If you don’t know what “tick” or “square root price” means in the context of a liquidity pool, you should review them.

UniswapV3 — Pool Contract

UniswapV3 — Pool Contract

BowTiedDevil
·
September 16, 2022
Read full story
UniswapV3 — Swap Prediction (Part I)

UniswapV3 — Swap Prediction (Part I)

BowTiedDevil
·
October 8, 2022
Read full story
UniswapV3 — Swap Prediction (Part II)

UniswapV3 — Swap Prediction (Part II)

BowTiedDevil
·
October 11, 2022
Read full story
UniswapV3 — Swap Prediction (Part III)

UniswapV3 — Swap Prediction (Part III)

BowTiedDevil
·
October 28, 2022
Read full story

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 BowTiedDevil
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share