In this post, we'll invent Curve AMM as if for the first time.Here's the problem Curve wants to solve: how can we enable token trades [1] at a constant exchange rate and [2] without any slippage? For example, a trader wants to convert arbitrary amounts of USDC into DAI at the price of 1 USDC for 1 DAI. Consider a liquidity pool containing 1,000 USDC and 1,000 DAI for which trades must satisfy the Constant Sum invariant (CS):$$x + y = D$$G.1: graph of the Constant Sum invariant with ...