Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save frankolson/47a9606b2e6b95cc436d45ea9869c6bf to your computer and use it in GitHub Desktop.
Save frankolson/47a9606b2e6b95cc436d45ea9869c6bf to your computer and use it in GitHub Desktop.
Constant product market maker expansion for LW3
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
x y& = k\\
(x + \Delta x) (y - \Delta y)& = k\\
(x + \Delta x) (y - \Delta y)& = x y
\end{align*}
Flip it, then:
\begin{align*}
x y& = (x + \Delta x) (y - \Delta y)\\
x y& = y(x + \Delta x) - \Delta y(x + \Delta x)\\
x y& = x y + y \Delta x - \Delta y x - \Delta y \Delta x\\
x y - x y& = y \Delta x - \Delta y x - \Delta y \Delta x\\
0& = y \Delta x - \Delta y x - \Delta y \Delta x\\
\Delta y x& = y \Delta x - \Delta y \Delta x\\
\Delta y x + \Delta y \Delta x& = y \Delta x\\
\Delta y (x + \Delta x)& = y \Delta x\\
\Delta y& = \frac{y \Delta x}{(x + \Delta x)}\\
\end{align*}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment