Summary
This chapter introduced various types of DEXs. As a popular type of DEX, we dived into the AMM by explaining the mathematical formulas of these AMMs. With the visualization of the mathematical functions, we understood how they work, their features, and their limitations. Because we’ll build a full stack AMM with the type of CPMM, we explained its architecture and the three main workflows of the AMM: adding liquidity, removing liquidity, and swapping.
DEX is one of the most important and popular DeFi applications. It has a complex system that is worth intensive research. This chapter was mainly a conceptual demonstration to help you understand the principles of building a real-world DeFi application. Now, you may get excited about using the knowledge you have gained to build something that runs!
In the next chapter, we will dive into the implementation of these components and write the smart contracts for the AMM.