Skip to content

Commit

Permalink
amm > fix brackets + grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenad committed Jun 4, 2024
1 parent 19cf4bc commit 3f2b907
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub mod ConstantProductAmm {
assert(reserve0 * amount1 == reserve1 * amount0, 'x / y != dx / dy');
}

// How much shares to mint?
// How many shares to mint?
//
// f(x, y) = value of liquidity
// We will define f(x, y) = sqrt(xy)
Expand Down Expand Up @@ -178,11 +178,11 @@ pub mod ConstantProductAmm {
//
// Multiply by sqrt(x) / sqrt(x)
// Equation 2 = (sqrt(x^2y + 2xydx + dx^2 * y) - sqrt(x^2y)) / sqrt(x^2y)
// = (sqrt(y)(sqrt(x^2 + 2xdx + dx^2) - sqrt(x^2)) / (sqrt(y)sqrt(x^2))
// = (sqrt(y)(sqrt(x^2 + 2xdx + dx^2) - sqrt(x^2))) / (sqrt(y)sqrt(x^2))
// sqrt(y) on top and bottom cancels out
//
// --- Equation 3 ---
// Equation 2 = (sqrt(x^2 + 2xdx + dx^2) - sqrt(x^2)) / (sqrt(x^2)
// Equation 2 = (sqrt(x^2 + 2xdx + dx^2) - sqrt(x^2)) / sqrt(x^2)
// = (sqrt((x + dx)^2) - sqrt(x^2)) / sqrt(x^2)
// = ((x + dx) - x) / x
// = dx / x
Expand Down

0 comments on commit 3f2b907

Please sign in to comment.