Skip to content

Latest commit

 

History

History
88 lines (88 loc) · 3.32 KB

uniswap-v2.md

File metadata and controls

88 lines (88 loc) · 3.32 KB
  • Uniswap V2
    • 1. Math overview, graph and examples
    • 2 Contracts overview
    • Swap
      • 1. Swap math
      • 2. Swap fee math
      • 3. Contract calls diagram
      • Code walkthrough
        • 4. Periphery and core repositories
        • 5. swapExactTokensForTokens
          • 6. getAmountsOut
          • 7. getAmountsOut fork
          • 8. getAmountsOut example
        • 9. swapTokensForExactTokens
          • 10. getAmountsIn
          • 11. getAmountsIn fork
          • 12. getAmountsIn example
        • 13. pair.swap
      • 14. Code exercise 1
      • 15. Code solution 1
      • 16. Code exercise 2
      • 17. Code solution 2
      • 18. Spot price graph
      • 19. Spot price math
      • 20. Slippage
    • Create pool
      • 1. Code walkthrough
      • 2. Code exercise
      • 3. Code solution
    • Add liquidity
      • 1. Pool shares intro
        • 2. Pool shares mint math
        • 3. Pool shares mint math example
        • 4. Pool shares burn
        • 5. Pool shares burn math
        • 6. Pool shares burn math example
      • 7. Add liquidity graph
      • 8. Add liquidity math
      • 9. Add liquidity pool shares math intro
        • 10. Liquidity functions
        • 11. Liquidity functions - sqrt
        • 12. Liquidity functions - 2x
        • 13. Summary
      • 14. Contract calls diagram
      • Code walkthrough
        • 15. addLiquidity
        • 16. mint
      • 17. Code exercise
      • 18. Code solution
    • Remove liquidity
      • 1. Remove liquidity graph
      • Remove liquidity math
        • 2. How many dx and dy to remove?
        • 3. Pool shares intro
        • 4. Liquidity functions
        • 5. Liquidity delta with liquidity function = sqrt
      • 6. Contract calls diagram
      • Code walkthrough
        • 7. removeLiquidity
        • 8. burn
      • 9. Code exercise
      • 10. Code solution
    • Flash swap
      • 1. Flash swap fee math
      • 2. Contract calls diagram
      • 3. Code walkthrough
      • 4. Code exercise
      • 5. Code solution
    • TWAP
      • 1. Spot price manipulation
      • TWAP math
        • 2. Intro
        • 3. Cumulative price
        • 4. Example
        • 5. TWAP approximation to current time
        • 6. Misconception
      • 7. Code walkthrough
      • 8. Code exercise
      • 9. Code solution
    • Application - Flash swap arbitrage
      • Intro
        • 1. arbitrage, flash swap -> swap -> swap)
        • 2. flash swap -> swap
      • 3. Exercise 1
      • 4. Solution 1
      • 5. Exercise 2
      • 6. Solution 2
      • 7. Optimal amount in math (optional)