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 Жыл бұрын
great explanation , thanks
@Rollex-rr2xq11 ай бұрын
How can squareroot price change without changing tick?
@smartcontractprogrammer11 ай бұрын
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-rr2xq10 ай бұрын
@@smartcontractprogrammer Thanks for reply. I wonder why the tick spacing is being used? What is the purpose of introducting tick spacing.
@mcfincher2910 ай бұрын
@@Rollex-rr2xq I think it's mostly for liquidity providers. It allows them to set a range for active liquidity.