Degen Code

Degen Code

Pool Reserves — Part II: Partial Swaps, Max Profits

The Calculatooooooor

Jan 09, 2022
∙ Paid

> ahhhh I’m gonna derive!

Hot on the heels of the introduction to getReserves(), it’s ya boi Devil back with another equation to Make Swaps Great Again.

Partial Swaps

First, I want to give kudos to commenter Mike, who correctly guessed the reason for this post.

The previous post concluded with a long derivation and implementation of a formula to calculate t…

Keep reading with a 7-day free trial

Subscribe to Degen Code to keep reading this post and get 7 days of free access to the full post archives.

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