Swap Part 1 | Uniswap V3 Core Contract Explained - Part 20

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии •

  • @smartcontractprogrammer
    @smartcontractprogrammer  Год назад

    0:19 - Inputs and outputs
    1:38 - Structs
    3:15 - Swap function
    4:00 - Check sqrt price limit
    6:10 - Swap state
    7:45 - Update sqrt price and tick
    9:20 - Update liquidity
    9:50 - Update fee growth global
    10:40 - Calculate final amount 0 and amount 1
    13:42 - Transfer tokens
    Code
    github.com/t4sk/clamm
    Take a course
    www.smartcontract.engineer/

  • @mohamedabuyounes3136
    @mohamedabuyounes3136 Год назад

    great explanation , thanks

  • @Rollex-rr2xq
    @Rollex-rr2xq 10 месяцев назад +1

    How can squareroot price change without changing tick?

    • @smartcontractprogrammer
      @smartcontractprogrammer  10 месяцев назад +1

      ticks increment by tick spacing
      for example if tick spacing is 10, during a swap the active tick would move but the change may be less than tick spacing

    • @Rollex-rr2xq
      @Rollex-rr2xq 9 месяцев назад +1

      @@smartcontractprogrammer
      Thanks for reply.
      I wonder why the tick spacing is being used? What is the purpose of introducting tick spacing.

    • @mcfincher29
      @mcfincher29 8 месяцев назад

      @@Rollex-rr2xq I think it's mostly for liquidity providers. It allows them to set a range for active liquidity.